We're Hiring!

OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

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.

OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby tinat » Thu Jun 30, 2011 3:26 pm

Hi all,

I upgraded from 4.2.2 to 4.3.0. OMERO.server is running fine, and I imported some files with the new 4.3.0 clients. Insight client is working fine. I am having trouble with OMERO.web

when I start the web client, it gives:
Code: Select all
Starting OMERO.web... [OK]


but then if I run
Code: Select all
$ bin/omero web status

I get:
Code: Select all
OMERO.web status... [NOT STARTED]


It seems that Django is not getting the correct database parameters, though the OMERO.server is getting to the database fine.

Here is part of OMEROweb.log file:
Code: Select all
Thu, 30 Jun 2011 10:11:19 root         DEBUG    APPLICATION_SERVER = 'fastcgi-tcp' (source:omero.web.application_server)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    APPLICATION_SERVER_HOST = '0.0.0.0' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    APPLICATION_SERVER_PORT = '4080' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    CACHE_BACKEND = '(unset)' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_ENGINE = 'sqlite3' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_HOST = '(unset)' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_NAME = '(unset)' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_PASSWORD = '***' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_PORT = '(unset)' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_USER = '(unset)' (source:default)
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DEBUG = True (source:omero.web.debug)
...
Thu, 30 Jun 2011 10:11:19 root         DEBUG    WEBGATEWAY_CACHE = '/var/www/omeroweb/weblitz_cache' (source:omero.web.webgateway_cache)


How do I configure Django to use PostgreSQL instead of sqlite3 ?

Thanks,
Tina
tinat
 
Posts: 7
Joined: Thu Apr 21, 2011 1:30 pm

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby wmoore » Thu Jun 30, 2011 3:43 pm

Django never really uses it's own database (sqlite). That's just there for various test functionality. It gets all it's data by connecting to the OMERO server (which does all the database access to postgreSQL).

Do you have any other error logs or maybe you can just try again?
Did you set the omero.web.application_server as described here: http://www.openmicroscopy.org.uk/site/s ... nstall_web ?

Code: Select all
bin/omero config set omero.web.application_server development


Presumably you've tried pointing a web browser at the url?

Will
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby tinat » Tue Jul 05, 2011 2:51 pm

Hi Will,

Thanks for the suggestion to set to development for troubleshooting. When I set to the web application server to development:

Code: Select all
bin/omero config set omero.web.application_server development
bin/omero web start


I get the following exception stack:
Code: Select all
File "manage.py", line 43, in ?
    execute_manager(settings)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/__init__.py", line 362, in execut        e_manager
    utility.execute()
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/__init__.py", line 303, in execut        e
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/base.py", line 195, in run_from_a        rgv
    self.execute(*args, **options.__dict__)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/base.py", line 213, in execute
    translation.activate('en-us')
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/__init__.py", line 73, in activ        ate
    return real_activate(language)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/__init__.py", line 43, in delay        ed_loader
    return g['real_%s' % caller](*args, **kwargs)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/trans_real.py", line 205, in ac        tivate
    _active[currentThread()] = translation(language)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/trans_real.py", line 194, in tr        anslation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/trans_real.py", line 180, in _f        etch
    app = import_module(appname)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/contrib/admin/__init__.py", line 1, in ?
    from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/contrib/admin/helpers.py", line 7, in ?
    from django.contrib.admin.util import flatten_fieldsets
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/contrib/admin/util.py", line 2, in ?
    from django.db import models
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/db/__init__.py", line 41, in ?
    backend = load_backend(settings.DATABASE_ENGINE)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/db/__init__.py", line 17, in load_backend
    return import_module('.base', 'django.db.backends.%s' % backend_name)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/db/backends/sqlite3/base.py", line 30, in ?
    raise ImproperlyConfigured, "Error loading %s: %s" % (module, exc)
django.core.exceptions.ImproperlyConfigured: Error loading pysqlite2 module: No module named pysqlite2


my env settings:
Code: Select all
PYTHONPATH=/opt/apps/OMERO.server-Beta-4.3.0/lib/python:/opt/apps/Ice-3.3.1/python:/opt/apps/lib64/python/pyinotify:/usr/lib64/python2.4:/usr/lib64/python2.4/site-packages:/usr/lib64/python2.4/site-packages/M2Crypto:/usr/lib64/python2.4/site-packages/PIL:/usr/lib64/python2.4/site-packages/OpenSSL:/usr/lib64/python2.4/site-packages/dbus:/opt/apps/lib64/python2.4/site-packages:/opt/apps/lib64/python2.4/site-packages/numpy
PYTHON_HOME=/usr/lib64/python2.4
OMERO_HOME=/opt/apps/OMERO.server-Beta-4.3.0


Thanks in advance,
Tina
tinat
 
Posts: 7
Joined: Thu Apr 21, 2011 1:30 pm

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby wmoore » Tue Jul 05, 2011 8:00 pm

User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby atarkowska » Tue Jul 05, 2011 9:05 pm

Hi Tina,

OMERO.web does not use sqlite database, but it looks like for some reason is looking fo py-sqlite drivers.
Could you please give the details what python version you are currently using? I assume is 2.4 based on your PYTHONPATH, is it correct?

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

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby tinat » Tue Jul 05, 2011 9:23 pm

Yes, I am using Python 2.4

I have the Python dependent libraries installed in several directories (some in $PYTHON_HOME, and some under other directories. The Python libraries and current $PYTHONPATH worked with OMERO.web before I upgraded to 4.3.0 (I was on version 4.2.2). I followed the upgrade instructions for upgrading 4.2.2 to 4.3.0)

I noticed that in 4.3.0, the $OMERO_HOME/lib/python/omeroweb/settings.py file there are new settings for omero.web.database_engine, omero.web.database_host, omero.web.database_name, omero.web.database_port , etc -- so I tried the following:

Code: Select all
bin/omero config set omero.web.database_engine 'postgresql'
bin/omero web start


But got a similar error, but with PostgreSQL driver instead:
Code: Select all
Starting OMERO.web... Traceback (most recent call last):
  File "manage.py", line 43, in ?
    execute_manager(settings)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/__init__.py", line 362, in exee_manager
    utility.execute()
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/__init__.py", line 303, in exee
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/base.py", line 195, in run_frorgv
    self.execute(*args, **options.__dict__)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/core/management/base.py", line 213, in execute
    translation.activate('en-us')
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/__init__.py", line 73, in acate
    return real_activate(language)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/__init__.py", line 43, in deed_loader
    return g['real_%s' % caller](*args, **kwargs)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/trans_real.py", line 205, intivate
    _active[currentThread()] = translation(language)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/trans_real.py", line 194, inanslation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/translation/trans_real.py", line 180, inetch
    app = import_module(appname)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/contrib/admin/__init__.py", line 1, in ?
    from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/contrib/admin/helpers.py", line 7, in ?
    from django.contrib.admin.util import flatten_fieldsets
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/contrib/admin/util.py", line 2, in ?
    from django.db import models
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/db/__init__.py", line 41, in ?
    backend = load_backend(settings.DATABASE_ENGINE)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/db/__init__.py", line 17, in load_backend
    return import_module('.base', 'django.db.backends.%s' % backend_name)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/opt/apps/OMERO.server-Beta-4.3.0/lib/python/django/db/backends/postgresql/base.py", line 20, in ?
    raise ImproperlyConfigured("Error loading psycopg module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg



I am confused -- since all works if I am using the OMERO.cli (command line). Python does not connect to PostgreSQL DB directly, but goes though Hibernate in the OMERO.server via Ice Grid. Not sure why we need to specify a omero.web.database_engine in the settings.py file in this version of OMERO.web .

Thanks,
Tina
tinat
 
Posts: 7
Joined: Thu Apr 21, 2011 1:30 pm

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby atarkowska » Wed Jul 06, 2011 8:36 am

Hi Tina

There is no need to install py-sqlite lib and specify database engine settings. The error you faced is unexpected and I am going to provide you with the solution in order to fix this bug.

Settings you were trying to set up omero.web.database_engine, omero.web.database_host, omero.web.database_name, omero.web.database_port are optional and created for developers. You do not need to set them up.

If you haven't install pysqlite please continue to apply following.

Please first run:
Code: Select all
bin/omero config get

check which of them you already set up and wipe them by the following:
Code: Select all
bin/omero config set omero.web.database_engine
bin/omero config set omero.web.database_name
bin/omero config set omero.web.database_port


Once you config match the requirements provided by the install page, please apply attached patch1 and try to run webclient.

Code: Select all
patch -p0 -i patch1 /opt/apps/OMERO.server-Beta-4.3.0/lib/python/lib/omeroweb/settings.py


I assume this might not be enough, then please apply patch2 (this disable one of the component).

Code: Select all
patch -p0 -i patch2 /opt/apps/OMERO.server-Beta-4.3.0/lib/python/lib/omeroweb/settings.py


Please let me know how it goes

Ola
Attachments
patch.zip
(1.07 KiB) Downloaded 207 times
atarkowska
 
Posts: 327
Joined: Mon May 18, 2009 12:44 pm

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby atarkowska » Wed Jul 06, 2011 8:54 am

tinat wrote:
Here is part of OMEROweb.log file:
Code: Select all
...
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_ENGINE = 'sqlite3' (source:default)
...
Thu, 30 Jun 2011 10:11:19 root         DEBUG    DATABASE_PASSWORD = '***' (source:default)
...




I haven't noticed that before, how did you get to the point where you set up DATABASE_ENGINE = 'sqlite3' and password?

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

Re: OMERO.web not starting after upgrade from 4.2.2 to 4.3.0

Postby tinat » Wed Jul 06, 2011 9:39 pm

Hi Ola,

It WORKED!! I unset all the omero.web.database* parameters and applied your patch and it worked. In the admin diagnostics where it showed DATABASE_ENGINE = "sqlite3" in my initial post -- I had not explicitly set any of the omero.web.database* parameters with bin/omero config set or any other command. I just copied my old 4.2.2 config.xml file over and followed your upgrade instructions. The settings.py had the omero.web.database in the distribution zip file (I downloaded the Linux binary install zip file). It was after I was trying to fix the exception in the stack (above) that I tried setting the omero.web.database parameters.

I just applied patch1 only, did not have to do patch2.

Thanks for all your help,
Tina
tinat
 
Posts: 7
Joined: Thu Apr 21, 2011 1:30 pm


Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest