New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatabaseError after Upgrade to 5.0 #1429

Closed
1resu opened this Issue Nov 3, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@1resu
Copy link
Contributor

1resu commented Nov 3, 2015

Hi,

following the seafile manual I upgraded the server from 4.4.5 to 5.0 - all successful. But the server doesn't start.

output from seahub_django_request.log:

2015-11-03 22:47:53,852 [ERROR] django.request:210 handle_uncaught_exception Internal Server Error: /seafile/
Traceback (most recent call last):
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/core/handlers/base.py", line 90, in get_response
    response = middleware_method(request)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/middleware/locale.py", line 23, in process_request
    request, check_path=check_path)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/utils/translation/__init__.py", line 126, in get_language_from_request
    return _trans.get_language_from_request(request, check_path)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/utils/translation/trans_real.py", line 390, in get_language_from_request
    lang_code = request.session.get('django_language', None)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/contrib/sessions/backends/base.py", line 55, in get
    return self._session.get(key, default)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/contrib/sessions/backends/base.py", line 167, in _get_session
    self._session_cache = self.load()
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/contrib/sessions/backends/db.py", line 18, in load
    expire_date__gt=timezone.now()
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/models/manager.py", line 143, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/models/query.py", line 398, in get
    num = len(clone)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/models/query.py", line 106, in __len__
    self._result_cache = list(self.iterator())
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/models/query.py", line 317, in iterator
    for row in compiler.results_iter():
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/models/sql/compiler.py", line 775, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/models/sql/compiler.py", line 846, in execute_sql
    cursor.execute(sql, params)
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/backends/sqlite3/base.py", line 366, in execute
    six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
  File "/data/seafile/seafile-server-5.0.0/seahub/thirdpart/Django-1.5.12-py2.6.egg/django/db/backends/sqlite3/base.py", line 362, in execute
    return Database.Cursor.execute(self, query, params)
DatabaseError: no such table: django_session

I don't know why the server executes /sqlite3/bases.py as I use a mysql database.

@freeplant

This comment has been minimized.

Copy link
Member

freeplant commented Nov 4, 2015

Is seahub_settings.py be moved to folder conf? What is the database configuration in conf/seahub_settings.py?

@1resu

This comment has been minimized.

Copy link
Contributor

1resu commented Nov 4, 2015

The upgrade script moved all files to conf correctly. This is my database configuration:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'seafile_seahub-db',
        'USER': 'seafile',
        'PASSWORD': 'xxx',
        'HOST': 'database.server',
        'PORT': '3306',
        'OPTIONS': {
            'init_command': 'SET storage_engine=INNODB',
        }
    }
}
@freeplant

This comment has been minimized.

Copy link
Member

freeplant commented Nov 4, 2015

Can you try to remove files top_level/seahub_settings.py and top_level/seahub_settings.pyc?

@1resu

This comment has been minimized.

Copy link
Contributor

1resu commented Nov 4, 2015

I've got it: on my system seafile runs with the rights of an unprivileged user called 'seafile'. For some reasons the copied conf-files in conf were root:root and not seafile:seafile.

After changing the ownership everything works fine.

Thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment