haiwen / seafile

High performance file syncing and sharing, with also Markdown WYSIWYG editing, Wiki, file label and other knowledge management features.
http://seafile.com/
Other
12.39k stars 1.55k forks source link

ImportError: cannot import name 'SeafEventsSession' from 'seahub.utils' #2795

Closed hamedty closed 4 months ago

hamedty commented 4 months ago

I am running seafile multi container using docker compose. I am running version 11.0.9. When I create a new library using the web interface, I receive 500 error and after checking the seahub log file, I am seeing the following error line and traceback stack. Any ideas?

ImportError: cannot import name 'SeafEventsSession' from 'seahub.utils' (/opt/seafile/seafile-server-11.0.9/seahub/seahub/utils/__init__.py)

The traceback stack:

2024-07-07 13:38:59,425 [ERROR] django.request:241 log_response Internal Server Error: /api2/repos/
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/django/views/decorators/csrf.py", line 56, in wrapper_view
    return view_func(*args, **kwargs)
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/seafile/seafile-server-11.0.9/seahub/seahub/api2/base.py", line 23, in dispatch
    response = super(APIView, self).dispatch(*a, **kw)
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/opt/seafile/seafile-server-11.0.9/seahub/seahub/api2/base.py", line 20, in handle_exception
    return super(APIView, self).handle_exception(exc)
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/opt/seafile/seafile-server-11.0.9/seahub/seahub/api2/views.py", line 1006, in post
    repo_created.send(sender=None,
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/django/dispatch/dispatcher.py", line 176, in send
    return [
  File "/opt/seafile/seafile-server-11.0.9/seahub/thirdpart/django/dispatch/dispatcher.py", line 177, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/opt/seafile/seafile-server-11.0.9/seahub/seahub/handlers.py", line 44, in repo_created_cb
    from .utils import SeafEventsSession
ImportError: cannot import name 'SeafEventsSession' from 'seahub.utils' (/opt/seafile/seafile-server-11.0.9/seahub/seahub/utils/__init__.py)
hamedty commented 4 months ago

It turned out that this installation is updated from docker 6.x to docker-mc 11.0 and they needed to create seafevents.confmanually. After creating that file and disabling notification in seafile.conf it seams everything works well.