google-code-export / amcat

Automatically exported from code.google.com/p/amcat
0 stars 0 forks source link

hotfix crashes production server, runs fine locally #637

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The github branch named 'hotfix_accept_pdf_upload' works on my machine, i'm 
able to run the server and use the script that it affects.

However, when i updated the codebase of amcat-production and restarted the 
server this afternoon, the website went down for a few minutes with HTTP error 
502 - bad gateway, with me hastily trying to fix it :) luckily resetting the 
code worked.

Nel needs this feature, but I wouldn't want to crash AmCAT again, so how should 
we go about solving this issue?

Original issue reported on code.google.com by Toon.Alfrink@gmail.com on 14 Dec 2013 at 9:38

GoogleCodeExporter commented 9 years ago
Did you check the AmCAT log? The log is located at /var/log/amcat_uwsgi.log. It 
could be something not related to your code.

Original comment by Martijn....@gmail.com on 15 Dec 2013 at 10:59

GoogleCodeExporter commented 9 years ago
Actually, the log is moved to /var/log/amcat/amcat_wsgi.log, see 
/etc/init/amcat_wsgi for the exact location.

The log file contains the error:

File "/srv/amcat/amcat/amcat/scripts/article_upload/text.py", line 64, in 
<module>
    import pyPdf
ImportError: No module named pyPdf

So I think you need to install pypdf on production?

It might be more elegant to import the module inside the function call, so only 
the pdf importing fails if the module can't be found?

Original comment by vanatteveldt@gmail.com on 15 Dec 2013 at 5:06

GoogleCodeExporter commented 9 years ago
Ah, obviously, i could've thought of that :)

I think it would be better to simply list pyPdf as an amcat requirement, it 
might not be used from article_upload/text only, and why treat it differently 
than other modules?

Original comment by Toon.Alfrink@gmail.com on 15 Dec 2013 at 5:25

GoogleCodeExporter commented 9 years ago

Original comment by Toon.Alfrink@gmail.com on 15 Dec 2013 at 6:54