Forums

WSGI Error

I'm getting the following error

Error running WSGI application
2021-09-19 21:03:04,097: FileNotFoundError: [Errno 2] No such file or directory: '/home/Jamesb67/mysite/static/results.pdf'
2021-09-19 21:03:04,097:   File "/var/www/jamesb67_eu_pythonanywhere_com_wsgi.py", line 16, in <module>
2021-09-19 21:03:04,097:     from flask_app import app as application  # noqa

The file "results.pdf" is in the statics folder and had been working with a different implementation of the code.

I'm a bit out of my depth here, not sure why it is giving this error and what it means really. Any help would be greatly appreciated!

Make sure that this file: /home/Jamesb67/mysite/static/results.pdf exists -- it looks like your web app code is dependent on existence of this file.

Hi @pafk it definitely exists so not sure what else is happening.

Image of the directory 1

Are you sure that it was called results.pdf when the error was raised? If there was a process that was creating it under a different name, then it's possible the code would not be able to find it.

@glenn & @pafk

Thanks for your patience with this, turns out there was an error with the function creating the PDF. Sometimes it would generate, sometimes there would be issue. Have resolved this issue now!

Excellent, glad to hear you worked it out!