LaTeXTools icon indicating copy to clipboard operation
LaTeXTools copied to clipboard

Log parser returning "[no file]" for latex errors

Open aaronhendry opened this issue 8 years ago • 6 comments

As the title suggests, I have tried to compile a document with an error in it, and the result in the ST window is

Errors:

[no file]:217: LaTeX Error: File `./img/non-existent' not found. [...]

Warnings:

[no file]:202: Package caption Warning: \label without proper reference on input line 202.
[no file]:199: LaTeX Warning: Reference `tab:cs2_degrad' on page 16 undefined on input line 199.
[no file]:251: LaTeX Warning: Reference `fig:cs9.2_idp_close' on page 19 undefined on input line 251.
[no file]: LaTeX Warning: There were undefined references.
(Log parsing issues. Disregard unless something else is wrong.)

I have looked into the parseTeXlog.py code + debug log, and have tracked the issue down to the following code, from lines 584--596:

		if len(line) > 0 and line[0] == ')':
			if files:
				debug(" "*len(files) + files[-1] + " (%d)" % (line_num,))
				f = files.pop()
				debug(u"Popped file: {0} ({1})".format(f, line_num))
				extra = line[1:]
				debug("Reprocessing " + extra)
				reprocess_extra = True
				continue
			else:
				parsing.append("PERR [')' no files]")
				debug("PERR [')' no files] (%d)" % (line_num,))
				break

I'm not familiar with the code, so I don't know what this section normally does, but for whatever reason for my document it pops the actual tex file, so all of the errors and warnings return [no file], as opposed to the real file+location. As far as I can tell, this problem is related to these two lines in my log file:

 <use  "./img/cs2_scm.pdf" > [11] ( FP-GT? ) ( FP-CLIP
) ( FP-NEG? ) ( FP-ABS ) ( FP-CLIP ) ( FP-NEG? )

Note the close-parenthesis on the second line, caused due to the page number [11] being inserted into the line, causing the ) character to wrap to the next line. Unfortunately, for whatever reason, the code snipped above reads this line, sees the closed parenthesis, and pops the tex file from the file list.

I was able to stop this from happening by setting the env variable max_print_line to 1000, however doing this also stopped all errors and warnings (apart from "Log parsing issues. Disregard unless something else is wrong.") from appearing. So that doesn't really work as a work-around.

Unfortunately, I have not been able to create a MWE, as this seems to be a fairly rare edge-case, and I cannot upload my full document due to privacy issues.

aaronhendry avatar May 24 '17 06:05 aaronhendry

For me this problem happens with every single of my tex files, both of my computers affected (both running Linux).

chodounsky avatar Aug 16 '18 09:08 chodounsky

Same problem met with MacOS.

syrte avatar Jan 30 '22 22:01 syrte