We're Hiring!

nginx bad gateway - odd

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

nginx bad gateway - odd

Postby lando.wark » Tue Nov 15, 2016 1:16 am

I'm having an odd problem with omero web. I wanted to install on a Ubuntu 14.04 virtualbox using my username for development purposes. I had already installed on a 14.04 server and I used the same procedure, but with the virtualbox 'omero web start' says:

Starting OMERO.web... [OK]

But 'omero web status' says:

OMERO.web status... [NOT STARTED]

And when I go to the nginx page I get "502 - Bad Gateway". The Insight clients work fine.
If I set omero.web.application_server.host=0.0.0.0 and run the dev server to connect to port 4080 everything works fine.
The weird part is if I run "gunicorn --bind 127.0.0.1:4080 omeroweb.wsgi:application" I get a python traceback:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 136, in load_wsgi
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 357, in import_app
__import__(module)
ImportError: No module named omeroweb.wsgi

Until I run "export PYTHONPATH=/home/omero/OMERO.server/lib/python:$PYTHONPATH". Then the error disappears, gunicorn runs and I can reach the web interface through nginx. The thing is I don't have any folder /home/omero.

I'm fine using the dev server here (It's what I was planning on using this install for), but I'd like to better understand what's going on here so I can better administer Omero.
Any thoughts?
lando.wark
 
Posts: 11
Joined: Fri May 20, 2016 3:23 am

Re: nginx bad gateway - odd

Postby atarkowska » Tue Nov 15, 2016 9:05 am

Hi

what
Code: Select all
bin/omero admin diagnostics
bin/omero config get --hide-password
say?

Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: nginx bad gateway - odd

Postby lando.wark » Tue Nov 15, 2016 1:57 pm

Replaced username with $USER manually.

================================================================================
OMERO Diagnostics 5.2.6-ice36-b35
================================================================================

Commands: java -version 1.8.0 (/usr/bin/java)
Commands: python -V 2.7.6 (/usr/bin/python)
Commands: icegridnode --version 3.6.3 (/usr/bin/icegridnode)
Commands: icegridadmin --version 3.6.3 (/usr/bin/icegridadmin)
Commands: psql --version 9.6.1 (/usr/bin/psql)

Server: icegridnode running
Server: Blitz-0 active (pid = 1730, enabled)
Server: DropBox active (pid = 1941, enabled)
Server: FileServer active (pid = 1748, enabled)
Server: Indexer-0 active (pid = 1751, enabled)
Server: MonitorServer active (pid = 1750, enabled)
Server: OMERO.Glacier2 active (pid = 1749, enabled)
Server: OMERO.IceStorm active (pid = 1761, enabled)
Server: PixelData-0 active (pid = 1754, enabled)
Server: Processor-0 active (pid = 1740, enabled)
Server: Tables-0 active (pid = 1753, enabled)
Server: TestDropBox inactive (enabled)

Log dir: /home/$USER/dev/omero/OMERO.server/var/log exists
Log files: Blitz-0.log 2.0 MB errors=152 warnings=6
Log files: DropBox.log 18.0 KB errors=10 warnings=9
Log files: FileServer.log 1.0 KB
Log files: Indexer-0.log 88.0 KB errors=76 warnings=5
Log files: MonitorServer.log 6.0 KB
Log files: OMEROweb.lock 0.0 KB
Log files: OMEROweb.log 935.0 KB errors=4 warnings=21
Log files: OMEROweb_brokenrequest.lock 0.0 KB
Log files: OMEROweb_brokenrequest.log 0.0 KB
Log files: PixelData-0.log 43.0 KB errors=30 warnings=0
Log files: Processor-0.log 137.0 KB errors=34 warnings=4
Log files: Tables-0.log 15.0 KB errors=5 warnings=4
Log files: TestDropBox.log n/a
Log files: master.err 10.0 KB errors=9 warnings=18
Log files: master.out 0.0 KB
Log files: Total size 3.84 MB


Environment:OMERO_HOME=(unset)
Environment:OMERO_NODE=(unset)
Environment:OMERO_MASTER=(unset)
Environment:OMERO_USERDIR=(unset)
Environment:OMERO_TMPDIR=(unset)
Environment:PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/$USER/dev/omero/OMERO.server/bin
Environment:PYTHONPATH=(unset)
Environment:ICE_HOME=(unset)
Environment:LD_LIBRARY_PATH=(unset)
Environment:DYLD_LIBRARY_PATH=(unset)

OMERO SSL port:4064
OMERO TCP port:4063
OMERO data dir:'/home/$USER/dev/omero/data' Exists? True Is writable? True
OMERO temp dir:'/home/$USER/omero/tmp' Exists? True Is writable? True (Size: 0)

JVM settings: Blitz-${index} -Xmx512m -XX:MaxPermSize=256m -XX:+IgnoreUnrecognizedVMOptions
JVM settings: Indexer-${index} -Xmx341m -XX:MaxPermSize=256m -XX:+IgnoreUnrecognizedVMOptions
JVM settings: PixelData-${index} -Xmx512m -XX:MaxPermSize=256m -XX:+IgnoreUnrecognizedVMOptions
JVM settings: Repository-${index} -Xmx341m -XX:MaxPermSize=256m -XX:+IgnoreUnrecognizedVMOptions

OMERO.web status... Django version: 1.8.16


omero.data.dir=/home/$USER/dev/omero/data
omero.db.name=omero_database
omero.db.pass=********
omero.db.user=$USER
omero.web.application_server=wsgi-tcp
omero.web.application_server.host=0.0.0.0
omero.web.debug=true
lando.wark
 
Posts: 11
Joined: Fri May 20, 2016 3:23 am

Re: nginx bad gateway - odd

Postby atarkowska » Wed Nov 16, 2016 10:18 pm

lando.wark wrote:I had already installed on a 14.04 server and I used the same procedure, but with the virtualbox 'omero web start' says:


which procedure? could you point me to the link?

which gunicorn version did you installed? what
Code: Select all
pip freeze
says?

lando.wark wrote:The weird part is if I run "gunicorn --bind 127.0.0.1:4080 omeroweb.wsgi:application" I get a python traceback:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 557, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 136, in load_wsgi
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 357, in import_app
__import__(module)
ImportError: No module named omeroweb.wsgi


that is expected. to run gunicorn by hand you have to export
Code: Select all
export PYTHONPATH=/home/$USER/OMERO.server/lib/python:/home/$USER/OMERO.server/lib/python/omeroweb:$PYTHONPATH


lando.wark wrote:Until I run "export PYTHONPATH=/home/omero/OMERO.server/lib/python:$PYTHONPATH". Then the error disappears, gunicorn runs and I can reach the web interface through nginx. The thing is I don't have any folder /home/omero.


Something doesnt' looks right here ;-) what
Code: Select all
sudo ls -al /home/omero
says?

Also could you check if pid in /home/$USER/OMERO.server/var/django_pid is the same as in ps -ef | grep gunicorn

Ola
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm


Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest