haiwen / seafile-rpi

Seafile server package for Raspberry Pi.
Other
558 stars 89 forks source link

empty queue and ConnectionRefusedError and no seafile admin #72

Closed PDiracDelta closed 2 years ago

PDiracDelta commented 3 years ago

Fresh 8.0.0 build and install on RPI2B with RPI OS. Starting seafile and seahub works fine, but:

  1. when starting seahub 'manually' (not as seafile user via systemd service, but with sudo ./seahub start) it says

    "Error happened during creating seafile admin."

  2. I can access the seahub landing page, but I have no account yet. When I try to login anyway, it says "page unavailable" due to "server hiccup" and the following is in the seahub log (see below).

What can I do to fix these issues? EDIT: interestingly, I get exactly the same error when I try to run sudo ./reset-admin.sh.

2020-12-27 22:31:55,227 [ERROR] django.request:228 log_response Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 85, in _get_transport
    transport = self._pool.get(False)
  File "/usr/lib/python3.7/queue.py", line 167, in get
    raise Empty
_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/utils/decorators.py", line 142, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/views/decorators/cache.py", line 44, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/seahub/auth/views.py", line 121, in login
    if form.is_valid():
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/forms/forms.py", line 185, in is_valid
    return self.is_bound and not self.errors
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/forms/forms.py", line 180, in errors
    self.full_clean()
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/forms/forms.py", line 382, in full_clean
    self._clean_form()
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/thirdpart/django/forms/forms.py", line 409, in _clean_form
    cleaned_data = self.clean()
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/seahub/auth/forms.py", line 55, in clean
    password=password)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/seahub/auth/__init__.py", line 56, in authenticate
    user = backend.authenticate(**credentials)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/seahub/base/accounts.py", line 576, in authenticate
    user = self.get_user(username)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/seahub/base/accounts.py", line 570, in get_user
    user = self.get_user_with_import(username)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seahub/seahub/base/accounts.py", line 541, in get_user_with_import
    emailuser = seaserv.get_emailuser_with_import(username)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/seaserv/service.py", line 125, in get_emailuser_with_import
    return ccnet_threaded_rpc.get_emailuser_with_import(email)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/pysearpc/client.py", line 125, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 97, in call_remote_func_sync
    transport = self._get_transport()
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 87, in _get_transport
    transport = self._create_transport()
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 80, in _create_transport
    transport.connect()
  File "/mnt/hdd/seafile/seafile-server-8.0.0/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 44, in connect
    self.pipe.connect(self.socket_path)
ConnectionRefusedError: [Errno 111] Connection refused
PDiracDelta commented 3 years ago

I've managed to work around this by temporarily changing permissions on the socket file: chmod 777 runtime/seafile.sock The file normally has 700 permissions (changed it back after I created an admin user) and was owned by the seafile user. Therefore I could not successfully execute reset-admin.sh as pi nor as root. I suspect this is also why the install script didn't create an admin user. This should probably be fixed?

unai-ndz commented 3 years ago

You should run all seafile scripts with the seafile user. This: sudo -u seafile bash seafile.sh should work for you but I cannot really test it as I found out about this issue because seafile.sh does not create runtime/seafile.sock on my machine.

You should close this issue, your had a permission problem but running the scripts as seafile will solve it.

PDiracDelta commented 3 years ago

You should run all seafile scripts with the seafile user. This: sudo -u seafile bash seafile.sh should work for you but I cannot really test it as I found out about this issue because seafile.sh does not create runtime/seafile.sock on my machine.

You should close this issue, your had a permission problem but running the scripts as seafile will solve it.

Thanks for the suggestion! I have a working system atm and don't have free time to verify this right now; but I'm happy to close it if an additional person can confirm after testing. Or a seafile developer.

Xalendis commented 2 years ago

I made an update from 8.0.7 to 9.0.2 and have the same issue but neither suggestion worked (my system does not have runtime/seafile.sock either)

jobenvil commented 2 years ago

@Xalendis at least one suggestion from many worked ;-) Closing.