Upgrade killing the image?

General Discussion

Upgrade killing the image?

Postby magudelo58 » Sat Jun 13, 2015 9:47 pm

Hello,

I downloaded the latest version from http://www.alarmdecoder.com/downloads/p ... -05-22.zip and flashed in the SD card of my Raspberry PI.

Everything was working without problem until I applied updates and upgrades to the OS using apt-get.

After the upgrade NGINX was removed from the packages, (I have not clue why this happened), so I had to reinstall it.

After the reinstall, I tried bouncing the services (nginx and gurnicon) and noticed the server was reporting: "Services might still be starting - please wait and try again. If this continues, please let us know on GitHub. You can also email us at Support."

This is the log from /var/log/gunicorn/alarmdecoder.log

[2015-06-13 20:33:13 +0000] [3837] [INFO] Starting gunicorn 19.3.0
[2015-06-13 20:33:13 +0000] [3837] [INFO] Listening at: http://127.0.0.1:8000 (3837)
[2015-06-13 20:33:13 +0000] [3837] [INFO] Using worker: socketio.sgunicorn.GeventSocketIOWorker
[2015-06-13 20:33:13 +0000] [3859] [INFO] Booting worker with pid: 3859
[2015-06-13 20:33:49 +0000] [3859] [ERROR] Exception in worker process:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 192, in init_process
super(GeventWorker, self).init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 118, in init_process
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 355, in import_app
__import__(module)
File "/opt/alarmdecoder-webapp/wsgi.py", line 24, in <module>
from ad2web import create_app
File "/opt/alarmdecoder-webapp/ad2web/__init__.py", line 3, in <module>
from app import create_app
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 30, in <module>
from .decoder import decodersocket, Decoder, create_decoder_socket
File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 27, in <module>
from .updater import Updater
File "/opt/alarmdecoder-webapp/ad2web/updater/__init__.py", line 1, in <module>
from .models import Updater
File "/opt/alarmdecoder-webapp/ad2web/updater/models.py", line 15, in <module>
from pip.locations import build_prefix, src_prefix
ImportError: cannot import name build_prefix
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 507, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 192, in init_process
super(GeventWorker, self).init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 118, in init_process
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 355, in import_app
__import__(module)
File "/opt/alarmdecoder-webapp/wsgi.py", line 24, in <module>
from ad2web import create_app
File "/opt/alarmdecoder-webapp/ad2web/__init__.py", line 3, in <module>
from app import create_app
File "/opt/alarmdecoder-webapp/ad2web/app.py", line 30, in <module>
from .decoder import decodersocket, Decoder, create_decoder_socket
File "/opt/alarmdecoder-webapp/ad2web/decoder.py", line 27, in <module>
from .updater import Updater
File "/opt/alarmdecoder-webapp/ad2web/updater/__init__.py", line 1, in <module>
from .models import Updater
File "/opt/alarmdecoder-webapp/ad2web/updater/models.py", line 15, in <module>
from pip.locations import build_prefix, src_prefix
ImportError: cannot import name build_prefix
[2015-06-13 20:33:49 +0000] [3859] [INFO] Worker exiting (pid: 3859)
[2015-06-13 20:33:49 +0000] [3837] [INFO] Shutting down: Master
[2015-06-13 20:33:49 +0000] [3837] [INFO] Reason: Worker failed to boot.

I also tried initializing the database, but no much luck here.

So the question is: why updating/upgrading the OS is cauing so many issues?
magudelo58
newt
newt
 
Posts: 4
Joined: Sat Jun 14, 2014 7:30 pm

Re: Upgrade killing the image?

Postby kevin » Sun Jun 14, 2015 11:24 am

We use and compile from source a specific version of nginx with our image. It is detailed in our instructions. It is specifically for websocket support.

This was posted in the wrong section, so I am going to move it.
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Upgrade killing the image?

Postby kevin » Mon Jun 15, 2015 10:45 am

gunicorn version 19.3.0 and nginx version 1.7.4 are required for this. If you are doing an update you will need to hold these packages back from the update, you can do this with an apt-mark hold on the packages:

sudo apt-mark hold gunicorn for example

or

sudo echo "gunicorn hold" | sudo dpkg --set-selections
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Upgrade killing the image?

Postby kevin » Sat Jun 27, 2015 8:32 pm

After looking at this more closely, it seems that the pip version might be to blame for the build_prefix import error seen. If you can revert the pip version, it should work until we push out a fix to support the new pip version(s) in the requirements updater.

Advice on gunicorn and nginx still stands!
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am

Re: Upgrade killing the image?

Postby kevin » Mon Jun 29, 2015 9:28 am

Until we figure out what the newest pip changed/broke and handle it in the code accordingly, I suggest using the same pip version provided by our image - version 6.1.1
Not an employee of the company. Just here to help and keep things clean.
kevin
Platinum Nut
Platinum Nut
 
Posts: 994
Joined: Fri Aug 16, 2013 10:10 am


Return to General

Who is online

Users browsing this forum: No registered users and 5 guests

cron