Seafile-pro-server-9.0.7 (Docker) crashes after upgrade with "No module named 'seahub_extra'"

Hi everybody,

for the first time in years I’ve been running into an issue upgrading my Seafile Pro Docker setup – and I’m running out of ideas. So any suggestion would be awesome!

  • After running docker-compose pull and restarting the compose app (stop, rm, up),
  • I’m constantly getting a blank ‘Page unavailable’ screen
  • and the seahub.log keeps on complaining about
    ModuleNotFoundError: No module named 'seahub_extra'.

The only related issue, I was able to find was this:
forum.seafile.com/t/seahub-problems-after-upgrading-8-0-17-to-9-05/16493

but unfortunately in my case it does not seem to solve itself. :wink:

I just found out that curling the instance localhost does return the login page! That would point to nginx being the bad guy here – but I do not see any errors!?

My Stacktrace looks like this:

ModuleNotFoundError: No module named 'seahub_extra'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/seafile/seafile-pro-server-9.0.7/seahub/thirdpart/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/opt/seafile/seafile-pro-server-9.0.7/seahub/thirdpart/django/utils/deprecation.py", line 116, in __call__
    response = self.process_request(request)
  File "/opt/seafile/seafile-pro-server-9.0.7/seahub/seahub/auth/middleware.py", line 33, in process_request
    if request.user.is_authenticated and not request.user.is_active:
  File "/opt/seafile/seafile-pro-server-9.0.7/seahub/seahub/auth/middleware.py", line 23, in __get__
    request._cached_user = get_user(request)
  File "/opt/seafile/seafile-pro-server-9.0.7/seahub/seahub/auth/__init__.py", line 119, in get_user
    backend = load_backend(backend_path)
  File "/opt/seafile/seafile-pro-server-9.0.7/seahub/seahub/auth/__init__.py", line 23, in load_backend
    raise ImproperlyConfigured('Error importing authentication backend %s: "%s"' % (module, e))
django.core.exceptions.ImproperlyConfigured: Error importing authentication backend seahub_extra.django_cas_ng.backends: "No module named 'seahub_extra'"

We will check the issue.

I guess you have configured seahub_extra_settings.py before, which is no longer required in Seafile 9.0.x, you can delete it.

Or change the

seahub_extra.django_cas_ng.backends.CASBackend

to

seahub.django_cas_ng.backends

in seahub_extra_settings.py

Hi @lian,
thanks a lot for your response. Your support is highly appreciated!

I just had a look at /opt/seafile-data/seafile/conf and just as I remembered, there is no seahub_extra.py available.

ls /opt/seafile-data/seafile/confreturns:

ccnet.conf
gunicorn.conf.py
seafdav.conf
seafevents.conf
seafile.conf
seaf-key.txt
seahub_settings.py
seahub_settings.pyc

Also there is no such key in seahub_settings.py (or any other conf file I was able to find).

Is there any other place where I might find this – or could it be that the Docker image provides this file and uses it if I do not provide it (unlikely, I know)?

Can you grep seahub_extra in /opt/seafile-data/seafile to find which file contains the seahub_extra.django_cas_ng.backends string, you can try this command:

grep -r seahub_extra /opt/seafile-data/seafile

There is only one type of result, being repeated over and over: :cry:

/opt/seafile-data/seafile/logs/seahub.log:ModuleNotFoundError: No module named 'seahub_extra'
/opt/seafile-data/seafile/logs/seahub.log:django.core.exceptions.ImproperlyConfigured: Error importing authentication backend seahub_extra.django_cas_ng.backends: "No module named 'seahub_extra'

Please run this command to find where seahub_extra is.

grep -r seahub_extra /opt/seafile-data/seafile

Happened to help one customer to resolve the issue. It is actually caused by session cache. Clear browser cache can solve the issue.