# Bibliography does not compile - I found no \bibdata command---while reading file

I worked for a while on a Latex thesis without any issue using Git to commit the changes I made across the time.

I just changed the device where I'm working on, cloning the repo and using the same configuration editor (Texstudio) and I run into this issue:

Process started: bibtex.exe "thesis"

I couldn't open auxiliary file appendix/appendice.aux
---line 468 of file thesis.aux
: \@input{appendix/appendice.aux
:                               }
I'm skipping whatever remains of this command
I couldn't open auxiliary file appendix/lists.aux
---line 469 of file thesis.aux
: \@input{appendix/lists.aux
:                           }
I'm skipping whatever remains of this command
I couldn't open auxiliary file appendix/bib.aux
---line 470 of file thesis.aux
: \@input{appendix/bib.aux
:                         }
I'm skipping whatever remains of this command
I couldn't open auxiliary file bu.aux
---line 471 of file thesis.aux
: \@input{bu.aux
:               }
I'm skipping whatever remains of this command
I found no \bibdata command---while reading file thesis.aux
I found no \bibstyle command---while reading file thesis.aux
(There were 6 error messages)

Process exited with error(s)


I really don't know why it was working on one machine and not on this one, despite using the same source code, the same editor (TexStudio), same OS (Win10) and MikTeX.

This is the Chapter related to the bibliography:

\chapter{Bibliography}
\nocite{*}
\bgroup
\bibliographyunit
\bibliographystyle{ieeetr}
\renewcommand{\chapter}[1]{}
\renewcommand\bibname{~}
\bibliography{bib/mybib}
\egroup
\cleardoublepage


Some online solutions said that this problem is often related to putting two times \end{document}, resulting in aborting the compilation of the bibliography. But, I really checked each single .tex file and no one has \end{document} (except for the main one, of course).

Any ideas? Where can be the source of trouble?

• Did you make sure to run LaTeX (that is: your favourite flavour of LaTeX, i.e. pdfLaTeX, LuaLaTeX, XeLaTeX, ...) before you run BibTeX? Can check that the .aux files BibTeX complains about appendix/appendice.aux, appendix/lists.aux, appendix/bib.aux, bu.aux are present in/relative to your document directory? Aug 4, 2020 at 16:17
• I'm using PdfLatex and BibTex. Actually I press on "Build and View" inside TexStudio, I think it does the job but unsure if I there is a way to explictly compile it first, then run bibtex. I see in the messages that pdflatex run first, then bibtex, so it should be fine. As for the second question, yes they are present in the correct directory. Aug 4, 2020 at 16:27
• Hrmm, if the .aux files are present, BibTeX should be able to find them. Can you try running BibTeX from the command line/console/terminal directly instead of having it run by your editor? (Open the command line, navigate into the correct folder using cd, run bibtex thesis [assuming your main .tex document is called thesis.tex]). Aug 4, 2020 at 19:55
• I did it and the result is: "I couldn't open file name thesis.tex.aux'" That's very strange! Any idea? Thanks! Aug 4, 2020 at 22:35
• That message sounds as if you ran bibtex thesis.tex. You need to run bibtex thesis or bibtex thesis.aux. Aug 5, 2020 at 5:25

I was able to identify the culprit by stripping down the thing to a minimal example that still demonstrates the error and "fix" it by removing a \usepackage{bibunits}` declaration.