Page 1 of 1

CLOSED: 4.1 syncdb problem?

PostPosted: Thu Oct 22, 2009 5:33 am
by lbl-dude
In trying to run the syncdb I get:

# sudo -u omero bin/omero web syncdb
Database synchronization...
Traceback (most recent call last):
File "manage.py", line 28, in ?
from django.core.management import execute_manager
ImportError: No module named django.core.management
OMERO.web was prepared. Please start the application.


When trying to connect to the omero.web I get this error:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
result = object(req)

File "/data/OMERO/omero_dist/lib/python/django/core/handlers/modpython.py", line 222, in handler
return ModPythonHandler()(req)

File "/data/OMERO/omero_dist/lib/python/django/core/handlers/modpython.py", line 195, in __call__
response = self.get_response(request)

File "/data/OMERO/omero_dist/lib/python/django/core/handlers/base.py", line 128, in get_response
return self.handle_uncaught_exception(request, resolver, exc_info)

File "/data/OMERO/omero_dist/lib/python/django/core/handlers/base.py", line 159, in handle_uncaught_exception
callback, param_dict = resolver.resolve500()

File "/data/OMERO/omero_dist/lib/python/django/core/urlresolvers.py", line 217, in resolve500
return self._resolve_special('500')

File "/data/OMERO/omero_dist/lib/python/django/core/urlresolvers.py", line 211, in _resolve_special
raise ViewDoesNotExist, "Tried %s. Error was: %s" % (callback, str(e))

ViewDoesNotExist: Tried omeroweb.feedback.views.handler500. Error was: 'Settings' object has no attribute 'FEEDBACK_URL'

Re: 4.1 syncdb problem?

PostPosted: Thu Oct 22, 2009 7:29 am
by cxallan
Assuming /home/<username>/omero_dist:

Code: Select all
sudo -u omero -s
export PYTHONPATH=$PYTHONPATH:/home/<username>/omero_dist/lib/python
bin/omero web syncdb

Re: 4.1 syncdb problem?

PostPosted: Thu Oct 22, 2009 7:50 am
by lbl-dude
]# su - omero -s
su: option requires an argument -- s
Try `su --help' for more information.

$ env | grep PYTHON
PYTHONPATH=/data/OMERO/omero_dist/lib/python/omeroweb:/data/OMERO/omero_dist/lib/python:/data/OMERO/omero_dist/lib/python/IPython/Extensions:/data/OMERO/omero_dist/lib/python/omero

$ cd /data/OMERO/*dist
$ bin/omero web syncdb

Database synchronization...
Installing json fixture 'initial_data' from absolute path.
Problem installing fixture 'initial_data.json': Traceback (most recent call last):
File "/data/OMERO/omero_dist/lib/python/django/core/management/commands/loaddata.py", line 117, in handle
for obj in objects:
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/json.py", line 41, in Deserializer
for obj in PythonDeserializer(simplejson.load(stream)):
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/python.py", line 69, in Deserializer
Model = _get_model(d["model"])
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/python.py", line 107, in _get_model
raise base.DeserializationError(u"Invalid model identifier: '%s'" % model_identifier)
DeserializationError: Invalid model identifier: 'feedback.emailtemplate'

OMERO.web was prepared. Please start the application.

Re: 4.1 syncdb problem?

PostPosted: Thu Oct 22, 2009 7:54 am
by cxallan
lbl-dude wrote:# su - omero -s
su: option requires an argument -- s
Try `su --help' for more information.


sudo, not su.

lbl-dude wrote:$ env | grep PYTHON
PYTHONPATH=/data/OMERO/omero_dist/lib/python/omeroweb:/data/OMERO/omero_dist/lib/python:/data/OMERO/omero_dist/lib/python/IPython/Extensions:/data/OMERO/omero_dist/lib/python/omero


Looks good.

lbl-dude wrote:$ cd /data/OMERO/*dist
$ bin/omero web syncdb

Database synchronization...
Installing json fixture 'initial_data' from absolute path.
Problem installing fixture 'initial_data.json': Traceback (most recent call last):
File "/data/OMERO/omero_dist/lib/python/django/core/management/commands/loaddata.py", line 117, in handle
for obj in objects:
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/json.py", line 41, in Deserializer
for obj in PythonDeserializer(simplejson.load(stream)):
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/python.py", line 69, in Deserializer
Model = _get_model(d["model"])
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/python.py", line 107, in _get_model
raise base.DeserializationError(u"Invalid model identifier: '%s'" % model_identifier)
DeserializationError: Invalid model identifier: 'feedback.emailtemplate'

OMERO.web was prepared. Please start the application.


Did you run bin/omero web settings already?

Re: 4.1 syncdb problem?

PostPosted: Thu Oct 22, 2009 8:04 am
by lbl-dude
Yes, I ran "web settings" without any errors. I just can't get syncdb to work.

$ sudo -u omero -s
$ bin/omero web settings
Reconfiguring OMERO.web...
Please enter the domain you want to run OMERO.web on (http://www.domain.com:8000/):myserver.mydomain.com
Please enter the Email address you want to send from (omero_admin@example.com): root@myserver.mydomain.com
Please enter the SMTP server host you want to send from (smtp.example.com): smtp.mydomain.com
Optional: please enter the SMTP server port (default 25):
Optional: Please enter the SMTP server username:
Optional: Password:
Optional: TSL? (yes/no):
Saving to /data/OMERO/omero_dist/lib/python/omeroweb/custom_settings.py

$ bin/omero web syncdb
Database synchronization...
Installing json fixture 'initial_data' from absolute path.
Problem installing fixture 'initial_data.json': Traceback (most recent call last):
File "/data/OMERO/omero_dist/lib/python/django/core/management/commands/loaddata.py", line 117, in handle
for obj in objects:
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/json.py", line 41, in Deserializer
for obj in PythonDeserializer(simplejson.load(stream)):
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/python.py", line 69, in Deserializer
Model = _get_model(d["model"])
File "/data/OMERO/omero_dist/lib/python/django/core/serializers/python.py", line 107, in _get_model
raise base.DeserializationError(u"Invalid model identifier: '%s'" % model_identifier)
DeserializationError: Invalid model identifier: 'feedback.emailtemplate'

OMERO.web was prepared. Please start the application.

I give up on this for now and will look into it again next week. Thank you for your help.

Re: 4.1 syncdb problem?

PostPosted: Thu Oct 29, 2009 4:13 pm
by blah
Heya,

I do have one as well.

[jw@biogrid omero_dist]$ bin/omero web syncdb
Database synchronization...
Traceback (most recent call last):
File "manage.py", line 28, in <module>
from django.core.management import execute_manager
ImportError: No module named django.core.management
OMERO.web was prepared. Please start the application.


in addition is this a typo?

<option>10.0.0.1:8000</option><!-- your ip & port here -->

django = ["python","manage.py","runserver","0.0.0.0:8080","--noreload"]+list(args)

do you mean 8000 and 8080 or shall those be the same?

Best

Jan

Re: 4.1 syncdb problem?

PostPosted: Thu Oct 29, 2009 5:04 pm
by cxallan
blah wrote:Heya,

I do have one as well.

[jw@biogrid omero_dist]$ bin/omero web syncdb
Database synchronization...
Traceback (most recent call last):
File "manage.py", line 28, in <module>
from django.core.management import execute_manager
ImportError: No module named django.core.management
OMERO.web was prepared. Please start the application.


PYTHONPATH=lib/python bin/omero web syncdb

(This was updated in the documentation a few days ago)

blah wrote:in addition is this a typo?

<option>10.0.0.1:8000</option><!-- your ip & port here -->

django = ["python","manage.py","runserver","0.0.0.0:8080","--noreload"]+list(args)

do you mean 8000 and 8080 or shall those be the same?

Best

Jan


Yes, it's a typo, they should both be the same.

(We're updating this in the documentation now)

Re: 4.1 syncdb problem?

PostPosted: Thu Nov 19, 2009 10:18 pm
by atarkowska
Have you still faced 'DeserializationError: Invalid model identifier: 'feedback.emailtemplate''?

The new release we are testing right now fixes that problem, and that release should be out soon!
Please find the solution below:

Here is the story:
1) Please delete every fixtures which includes:
Code: Select all
{
...
        "model": "feedback.emailtemplate",
...
}


Your file should look like:
Code: Select all
[
  {
    "pk": 1,
    "model": "auth.user",
    "fields": {
      "username": "admin",
      "first_name": "",
      "last_name": "",
      "is_active": true,
      "is_superuser": true,
      "is_staff": true,
      "last_login": "2009-11-19 22:21:01",
      "groups": [],
      "user_permissions": [],
      "password": "sha1$63f2a$10968d9d0e90faa5237c6e38d2d646be7b60e851",
      "email": "email@example.com",
      "date_joined": "2009-11-19 22:21:01"
    }
  },
  {
      "pk": 1,
      "model": "webadmin.gateway",
      "fields": {
          "server": "omero",
          "host": "localhost",
          "port": 4063
      }
  }
]

You can replate 'password' by the string was generated in your own file.

It means it will only create 2 objects:
...
Installing json fixture 'initial_data' from absolute path.
Installed 2 object(s) from 1 fixture(s)

2) Please save emailTemplate.sql (http://trac.openmicroscopy.org.uk/omero ... edback/sql) under /home/omero/omero_dist/lib/python/omeroweb/feedback/sql/ (first you need to create sql dir)

3) Delete db.sqlite3

mac:omeroweb ola$ rm -f db.sqlite3

4) Synchronize it:

mac:omeroweb ola$ python manage.py syncdb --noinput
Creating table django_admin_log
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table feedback_emailtemplate
Creating table webadmin_gateway
Installing custom SQL for feedback.EmailTemplate model
Installing index for admin.LogEntry model
Installing index for auth.Permission model
Installing index for auth.Message model
Installing json fixture 'initial_data' from absolute path.
Installed 2 object(s) from 1 fixture(s)
mac:omeroweb ola$

I hope it will help.