Google Drive syncing made Manim report a LaTeX installation failure
A failed render pointed at the LaTeX installation
On October 1, an unattended explanatory-video pipeline stopped with exit code 1. Manim reported an error that appeared to identify the next thing to inspect:
RuntimeError: latex failed but did not produce a log file. Check your LaTeX installation.
The message contained both an observation and a recommendation. The observation was that LaTeX had failed without leaving a log file. The recommendation was to check the LaTeX installation. Initially, the investigation followed the recommendation.
Because the pipeline ran through launchd, the first suspicion was its PATH. A missing TeX directory would have provided a direct explanation for why an unattended job could fail. But both the launchd plist and the script included /Library/TeX/texbin. The expected directory was already present.
The next checks tested whether LaTeX itself worked under the same PATH used in production. Running latex --version succeeded. Compiling a simple .tex file also succeeded. Both returned exit code 0.
Those results did not explain the interrupted render, but they changed the question. The installation was available and could compile a document in the production environment. The investigation needed to account for the missing log, rather than treating the installation warning as a diagnosis.
The failed formula compiled successfully on its own
A simple test document could leave open the possibility that the actual formula was wrong. To test that possibility, the investigation compiled the exact .tex file from the failed render independently.
It succeeded with exit code 0. It also produced both a log file and a DVI file.
That was a more specific result than confirming that LaTeX could run. The input associated with the failure was compilable. When executed separately, it produced the very log that had been absent during the pipeline failure.
The record also considered whether a new LaTeX package was involved. The two failed renders belonged to different episodes and used different formulas. Their failure times were 11:00:04 and 12:20:23. That check did not support the package explanation.
Other checks removed additional candidates. The disk had 39 GiB free, so it was not full. Inspecting power-management history with the following command showed no Sleep/Wake entries for October 1:
pmset -g log
Repeated execution did not expose the problem either. Running with the same arguments succeeded on all 30 attempts.
This left an awkward combination of evidence: the unattended pipeline had failed, the original input worked independently, and repeated attempts with the same arguments also worked. The failure could not be explained by pointing to a consistently broken installation or an input that consistently failed to compile.
The repeated successes were useful evidence, but they did not reproduce the circumstances of the failed render. The missing log remained the distinguishing symptom.
Reproducing the missing log narrowed the investigation
Instead of continuing to test only whether ordinary compilation succeeded, the investigation deliberately created failures. The target was the specific combination Manim had reported: a nonzero exit code with no log file.
Making the output directory unwritable produced this error:
! I can't write on file `xxx.log'
The process exited with a nonzero code and left no log. That matched the shape of the original failure.
Killing the process externally produced another match: exit code 137, again without a log file. An ordinary LaTeX error behaved differently. It produced a log.
These experiments separated failures that could look similar in a top-level error message. A normal LaTeX error left diagnostic output behind. Preventing output from being written, or terminating the process externally, could leave no log at all.
The experiments did not, by themselves, identify Google Drive. Both the unwritable-directory test and the external-kill test matched the observed absence of a log. Their value was in narrowing the investigation to mechanisms consistent with that absence.
This also explained why checking the formula had not resolved the incident. The exact formula compiled successfully on its own, and an intentionally created ordinary LaTeX error still produced a log. The original failure had a different signature.
The recommendation to inspect the installation was less useful than the preceding observation. “Did not produce a log file” described the behavior that the investigation could reproduce and compare.
The working directory was inside Google Drive
Manim’s working directory, scripts/manim/media/, was inside Google Drive’s synchronization scope. It contained 4.9 GB across 13,300 files.
The directory was listed in .gitignore, so its contents did not appear in Git. That exclusion had hidden the growing working directory from the Git view without excluding it from synchronization.
Google Drive was running with this setting:
use_mac_fileprovider=on
The recorded cause was interference from Drive’s file provider during rendering: when it touched the working directory, LaTeX could become unable to write there.
This accounted for the intermittent behavior documented in the investigation. Repeating the command did not reproduce the failure. A video render, however, called LaTeX hundreds of times, creating repeated opportunities for the write problem to occur.
The distinction between Git and Drive mattered here. The directory’s absence from Git did not mean it was outside the reach of other software. Git ignored the generated files; Google Drive continued synchronizing them.
The fix was to direct Manim’s media output to a location outside Google Drive. Using a generic local directory name, the command took this form:
manim --media_dir "$HOME/.cache/manim-media"
The important part of the change was the destination’s position outside the synchronized folder.
The existing 4.9 GB of media was moved with mv, rather than deleted. The move stayed on the same volume and completed immediately. Keeping those files avoided the rerendering that deleting them would have required.
Verification then used the production PATH and the configured media directory to render a scene containing MathTex. The .tex file count increased from 479 to 480, and the .svg count increased from 477 to 478. Those changes showed that the verification render had passed through LaTeX.
The render also produced an MP4. Finally, the old media/ directory did not reappear on the Google Drive side. The check therefore covered both the rendering result and whether generated output had returned to the synchronized location.
Check the output location and reproduce the failure signature
The first check to carry into another project is the location of generated working files. Find the media directory the renderer actually uses, then check whether that directory sits inside a synchronized folder. A .gitignore entry answers a question about Git; it does not exclude files from Google Drive, Dropbox, or iCloud synchronization.
The second check is whether the error’s observation supports its suggested remedy. In this incident, the installation recommendation led to useful tests, but those tests passed. The missing log provided the more discriminating evidence.
That distinction can be tested directly. Compare the failed input’s standalone behavior with the pipeline failure. Check whether a normal compilation error produces a log. In a controlled test, compare that result with an unwritable output destination or an externally terminated process. Here, those experiments produced different outcomes that helped narrow the investigation.
The final check belongs after the change. A successful command alone would not have shown that the renderer was using the intended destination. The verification used the production environment, exercised MathTex, confirmed new intermediate files and an MP4, and checked that the synchronized directory stayed absent.
The practical lesson is to verify both execution and placement. In this case, LaTeX worked; its working directory was exposed to synchronization. Moving that directory outside Drive addressed the recorded cause, and the follow-up render confirmed that the changed configuration was being used.
Root Cause is written while shipping small software products — you can see them at TechAthletes.