localwiki / localwiki-backend-server

Primary LocalWiki backend server environment
GNU General Public License v2.0
48 stars 16 forks source link

Error creating a new region on fresh installed development sites #81

Closed pm5 closed 8 years ago

pm5 commented 8 years ago

I started a fresh development sites with Vagrant following the steps in fabfile.py. Everything seems fine until I logged in and started creating the first new region. No matter what I tried to draw on the map, after submitting the form the web site always returns "There was a problem with the map area you drew. Please re-draw it and try again.".

Just want to see if anyone runs into the same problem?

philipn commented 8 years ago

@pm5 Do you experience the same error on https://localwiki.org? Also, you may want to try a different browser as well.

pm5 commented 8 years ago

@philipn I'm not experiencing the same error on https://localwiki.org. On my development site with Chromium version 47.0.2491.0 (64-bit), I get the following error page along with stack trace. Could it be some steps I've missed in setting up the environment?

AssertionError at /_region/_add
Bad response code: 107 mdfcqiodhbtrdruszsvozjdvkyucunyh (auth 447061ba57e956c1920099969f59a18377ad80f33864952318ec6d32bc087585)
Request Method: POST
Request URL:    http://localhost:8082/_region/_add
Django Version: 1.5.4
Exception Type: AssertionError
Exception Value:    
Bad response code: 107 mdfcqiodhbtrdruszsvozjdvkyucunyh (auth 447061ba57e956c1920099969f59a18377ad80f33864952318ec6d32bc087585)
Exception Location: /srv/localwiki/env/local/lib/python2.7/site-packages/varnish.py in fetch, line 91
Python Executable:  /srv/localwiki/env/bin/python
Python Version: 2.7.3
Python Path:    
['/srv/localwiki/env/bin',
 '/srv/localwiki/env/src/sorl-thumbnail',
 '/srv/localwiki/env/src/south',
 '/srv/localwiki/env/src/django-olwidget/django-olwidget',
 '/srv/localwiki/env/src/django-honeypot',
 '/srv/localwiki/env/src/django-constance',
 '/srv/localwiki/env/src/djangorestframework',
 '/srv/localwiki/env/src/djangorestframework-gis',
 '/srv/localwiki/env/src/django-endless-pagination',
 '/srv/localwiki/env/src/django-static-sitemaps',
 '/srv/localwiki/env/src/django-celery-email',
 '/srv/localwiki/env/src/django-xsession',
 '/srv/localwiki/env/src/django-hosts',
 '/srv/localwiki/env/src/johnny-cache',
 '/srv/localwiki/env/src/django-phased',
 '/srv/localwiki/src',
 '/srv/localwiki/env/lib/python2.7',
 '/srv/localwiki/env/lib/python2.7/plat-linux2',
 '/srv/localwiki/env/lib/python2.7/lib-tk',
 '/srv/localwiki/env/lib/python2.7/lib-old',
 '/srv/localwiki/env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/srv/localwiki/env/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/srv/localwiki/env/share/localwiki/env/lib/python2.7/site-packages',
 '/srv/localwiki/src/localwiki',
 '/srv/localwiki/env/share/localwiki/conf',
 '/home/vagrant']
Server time:    Sun, 5 Jun 2016 07:56:17 -0500
philipn commented 8 years ago

Can you see if varnish is running on the VM? I'd do vagrant ssh then `ps auxww|grep varnish.

pm5 commented 8 years ago

I think varnish is running. Doing ps auxww|grep varnish on the VM I got

root     26028  0.0  0.1 117208  1416 ?        Ss   08:50   0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s file,/mnt/varnish//varnish_storage.bin,20G
nobody   26030  0.1  0.1 21242432 1400 ?       Sl   08:50   0:00 /usr/sbin/varnishd -P /var/run/varnishd.pid -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s file,/mnt/varnish//varnish_storage.bin,20G
pm5 commented 8 years ago

I just noticed that regions have area restrictions, so I tried a much smaller region geometry, and the error message changed to the following:

ImproperlyConfigured at /_region/_add
Error importing module celery_haystack.tasks: "cannot import name get_connection"
Request Method: POST
Request URL:    http://localhost:8082/_region/_add
Django Version: 1.5.4
Exception Type: ImproperlyConfigured
Exception Value:    
Error importing module celery_haystack.tasks: "cannot import name get_connection"
Exception Location: /srv/localwiki/env/local/lib/python2.7/site-packages/celery_haystack/utils.py in get_update_task, line 16
Python Executable:  /srv/localwiki/env/bin/python
Python Version: 2.7.3
Python Path:    
['/srv/localwiki/env/bin',
 '/srv/localwiki/env/src/sorl-thumbnail',
 '/srv/localwiki/env/src/south',
 '/srv/localwiki/env/src/django-olwidget/django-olwidget',
 '/srv/localwiki/env/src/django-honeypot',
 '/srv/localwiki/env/src/django-constance',
 '/srv/localwiki/env/src/djangorestframework',
 '/srv/localwiki/env/src/djangorestframework-gis',
 '/srv/localwiki/env/src/django-endless-pagination',
 '/srv/localwiki/env/src/django-static-sitemaps',
 '/srv/localwiki/env/src/django-celery-email',
 '/srv/localwiki/env/src/django-xsession',
 '/srv/localwiki/env/src/django-hosts',
 '/srv/localwiki/env/src/johnny-cache',
 '/srv/localwiki/env/src/django-phased',
 '/srv/localwiki/src',
 '/srv/localwiki/env/lib/python2.7',
 '/srv/localwiki/env/lib/python2.7/plat-linux2',
 '/srv/localwiki/env/lib/python2.7/lib-tk',
 '/srv/localwiki/env/lib/python2.7/lib-old',
 '/srv/localwiki/env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-linux2',
 '/usr/lib/python2.7/lib-tk',
 '/srv/localwiki/env/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PIL',
 '/srv/localwiki/env/share/localwiki/env/lib/python2.7/site-packages',
 '/srv/localwiki/src/localwiki',
 '/srv/localwiki/env/share/localwiki/conf',
 '/home/vagrant']
Server time:    Thu, 9 Jun 2016 06:47:58 -0500

So I guess the problem is rather why localwiki is not giving me this error message?

I'll go on and try to figure out why Celery is not properly configured...

pm5 commented 8 years ago

Finally got this fixed. Apparently celery-haystack doesn't freeze its version of django-celery-transactions and we need to do it ourselves.