1

I have a Django+celery site running on Elastic Beanstalk that used pyodbc 3. Because of another issue, I had to update to pyodbc 4.

However, the web site starting giving error 500 and this is the information logged:

[Fri Feb 24 20:02:14.448536 2017] [core:notice] [pid 27978] AH00052: child pid 28292 exit signal Segmentation fault (11)
[Fri Feb 24 20:02:15.145503 2017] [core:error] [pid 27988] [client 205.165.34.225:50040] End of script output before headers: wsgi.py, referer: ...

During that time the Celery worker was still running and working just fine! I've re-deployed the whole server (Rebuild Environment in AWS) and it didn't fix the issue.

I had to revert to pyodbc 3 and it started working just fine. Any ideas?

django 1.10.4, pyodbc 4.0.11, django-pyodbc-azure 1.10.0.1

Diego Jancic
  • 7,280
  • 7
  • 52
  • 80
  • If you have reason to believe that this is a bug in pyodbc 4.x then you probably should report it as an issue [here](https://github.com/mkleehammer/pyodbc/issues). – Gord Thompson Feb 24 '17 at 21:42
  • @GordThompson I couldn't say it's a bug, I'm pretty new to Linux and Django, so it could easily be a configuration problem – Diego Jancic Feb 25 '17 at 01:15
  • When you say " I've re-deployed the whole server and it fixed the issue" do you mean that it started working with pyodbc 4.x after the re-deploy, or that the re-deploy reverted pyodbc back to 3.x? – Gord Thompson Feb 25 '17 at 11:25
  • Sorry I meant to say "it didn't fix the issue" clicking on "Rebuild Environment". I'll correct the question – Diego Jancic Feb 25 '17 at 15:25

1 Answers1

2

We have run into this issue as well, and will be providing a stack trace and related information to pyodbc on Monday. We've fixed it by pinning our requirements like this:

pyodbc==3.1.1
django-pyodbc-azure==1.10.4.0

While this doesn't get you pyodbc 4.0 yet, it will work for the rest of your site. We had some luck using 4.0.5 for running the site, but ran into some issues with migrations. (Note: if you use django-pyodbc-azure, you should use the highest version that matches your Django version, I.e. 1.10.4.0 for Django 1.10.)

Good luck!

FlipperPA
  • 13,607
  • 4
  • 39
  • 71
  • Thanks but I believe I need v4 to fix some encoding issues https://github.com/mkleehammer/pyodbc/issues/112 do you know if that's fixed in v3.1.1 (I believe it's not). – Diego Jancic Feb 26 '17 at 05:56
  • I won't get a chance to test more until tomorrow, but you could try versions < 4.0.11. Perhaps try `pip install pyodbc==4.0.0`? – FlipperPA Feb 27 '17 at 11:22
  • The issue is already reported here: https://github.com/mkleehammer/pyodbc/issues/181?_pjax=%23js-repo-pjax-container Please add any info you can so this can get fixed ASAP. I don't know how to provide such info. Thank you. – Diego Jancic Mar 01 '17 at 17:10