This could be a bug in the fasta file reader component of fai_build_core. The fasta file format is very relaxed, and allows some odd constructions, for example:
A few programs will complain about fasta files that look like this, because it usually means that data has been corrupted. These programs only accept fasta files that have sequences with identical line lengths for all but the last line:
One way to work around this input error problem is to get rid of all line breaks in the sequence of a fasta file, but then you run the risk of programs not properly being able to read all the characters in a line. A better approach is to feed the fasta file through a less restrictive data cleaning program and convert the lines back to all have a consistent length.
There's a good chance this is not the problem you are experiencing, but without more information about your input data, all we have to go on are the error messages and the sequence lengths [not line lengths] you have provided.