kuruczgy / web_services

A collection of some small web services
GNU Affero General Public License v3.0
0 stars 0 forks source link

The cache dir can sometimes disappear, resulting in errors #3

Open kuruczgy opened 6 days ago

kuruczgy commented 6 days ago

This seems to happen despite the attempted fix at https://github.com/kuruczgy/web_services/blob/788f2e1e69d0deddd70e334823ee918fe3ccf9df/latex_templater/main.py#L66

kuruczgy commented 6 days ago
May 29 07:45:01 vps-2 uwsgi[476101]: Output written on /tmp/tmp8nj4rqh1/latex.pdf (1 page, 56601 bytes).
May 29 07:45:01 vps-2 uwsgi[476101]: Transcript written on /tmp/tmp8nj4rqh1/latex.log.
May 29 07:45:01 vps-2 uwsgi[834]: [2024-05-29 07:45:01,408] ERROR in app: Exception on /latex [GET]
May 29 07:45:01 vps-2 uwsgi[834]: Traceback (most recent call last):
May 29 07:45:01 vps-2 uwsgi[834]:   File "/nix/store/vkqciggrvbvh4bp7155834hzp2lyq2qx-python3-3.11.8-env/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
May 29 07:45:01 vps-2 uwsgi[834]:     response = self.full_dispatch_request()
May 29 07:45:01 vps-2 uwsgi[834]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 29 07:45:01 vps-2 uwsgi[834]:   File "/nix/store/vkqciggrvbvh4bp7155834hzp2lyq2qx-python3-3.11.8-env/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
May 29 07:45:01 vps-2 uwsgi[834]:     rv = self.handle_user_exception(e)
May 29 07:45:01 vps-2 uwsgi[834]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 29 07:45:01 vps-2 uwsgi[834]:   File "/nix/store/vkqciggrvbvh4bp7155834hzp2lyq2qx-python3-3.11.8-env/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
May 29 07:45:01 vps-2 uwsgi[834]:     rv = self.dispatch_request()
May 29 07:45:01 vps-2 uwsgi[834]:          ^^^^^^^^^^^^^^^^^^^^^^^
May 29 07:45:01 vps-2 uwsgi[834]:   File "/nix/store/vkqciggrvbvh4bp7155834hzp2lyq2qx-python3-3.11.8-env/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
May 29 07:45:01 vps-2 uwsgi[834]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
May 29 07:45:01 vps-2 uwsgi[834]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 29 07:45:01 vps-2 uwsgi[834]:   File "/nix/store/v5fkypvi1b1vy4hdpiasnizjm8jaq2vl-latex_templater/main.py", line 98, in template
May 29 07:45:01 vps-2 uwsgi[834]:     fn = gen_template(template_name, request.args)
May 29 07:45:01 vps-2 uwsgi[834]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 29 07:45:01 vps-2 uwsgi[834]:   File "/nix/store/v5fkypvi1b1vy4hdpiasnizjm8jaq2vl-latex_templater/main.py", line 71, in gen_template
May 29 07:45:01 vps-2 uwsgi[834]:     os.rename(os.path.join(tmp, "latex.pdf"), filename)
May 29 07:45:01 vps-2 uwsgi[834]: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmp8nj4rqh1/latex.pdf' -> '/tmp/tmpjlkah1hf/13c8b392bd4e8966786b980068e7e8b5947b40ac661e29044c44eb696875fa53.pdf'
May 29 07:45:01 vps-2 uwsgi[834]: [pid: 834|app: 0|req: 7/7] 127.0.0.1 () {42 vars in 835 bytes} [Wed May 29 07:45:00 2024] GET /latex?name=befott&mycaption=&mystrdetails=&mycount=&myfancycorner=on => generated >