Seafile 7.1.4 Seahub fails to start correctly

Hi,

I have installed a fresh copy of Seafile 7.1.4 on Ubuntu 18.04 LTS x86_64, and when I try to start seahub, it says “Error happened during creating seafile admin.” but the daemon starts

When i try opening the page, there i get the Internal Error

Below is the log from seahub.log

2020-06-16 06:21:04,678 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 88, in _get_transport
    transport = self._pool.get(False)
  File "/usr/lib/python3.6/queue.py", line 161, in get
    raise Empty
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/auth/views.py", line 121, in login
    if form.is_valid():
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 183, in is_valid
    return self.is_bound and not self.errors
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 175, in errors
    self.full_clean()
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 385, in full_clean
    self._clean_form()
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 412, in _clean_form
    cleaned_data = self.clean()
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/auth/forms.py", line 55, in clean
    password=password)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/auth/__init__.py", line 56, in authenticate
    user = backend.authenticate(**credentials)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 576, in authenticate
    user = self.get_user(username)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 570, in get_user
    user = self.get_user_with_import(username)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 541, in get_user_with_import
    emailuser = seaserv.get_emailuser_with_import(username)
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/seaserv/service.py", line 128, in get_emailuser_with_import
    return ccnet_threaded_rpc.get_emailuser_with_import(email)
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/client.py", line 126, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 100, in call_remote_func_sync
    transport = self._get_transport()
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 90, in _get_transport
    transport = self._create_transport()
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 83, in _create_transport
    transport.connect()
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 47, in connect
    self.pipe.connect(self.socket_path)
FileNotFoundError: [Errno 2] No such file or directory
2020-06-16 06:21:10,031 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /accounts/login/
Traceback (most recent call last):
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 88, in _get_transport
    transport = self._pool.get(False)
  File "/usr/lib/python3.6/queue.py", line 161, in get
    raise Empty
queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/auth/views.py", line 121, in login
    if form.is_valid():
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 183, in is_valid
    return self.is_bound and not self.errors
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 175, in errors
    self.full_clean()
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 385, in full_clean
    self._clean_form()
  File "/home/drive2/seafile-server-7.1.4/seahub/thirdpart/django/forms/forms.py", line 412, in _clean_form
    cleaned_data = self.clean()
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/auth/forms.py", line 55, in clean
    password=password)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/auth/__init__.py", line 56, in authenticate
    user = backend.authenticate(**credentials)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 576, in authenticate
    user = self.get_user(username)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 570, in get_user
    user = self.get_user_with_import(username)
  File "/home/drive2/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 541, in get_user_with_import
    emailuser = seaserv.get_emailuser_with_import(username)
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/seaserv/service.py", line 128, in get_emailuser_with_import
    return ccnet_threaded_rpc.get_emailuser_with_import(email)
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/client.py", line 126, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 100, in call_remote_func_sync
    transport = self._get_transport()
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 90, in _get_transport
    transport = self._create_transport()
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 83, in _create_transport
    transport.connect()
  File "/home/drive2/seafile-server-7.1.4/seafile/lib64/python3.6/site-packages/pysearpc/named_pipe.py", line 47, in connect
    self.pipe.connect(self.socket_path)
FileNotFoundError: [Errno 2] No such file or directory
1 Like

I have exactly this same error from fresh install on a Raspberry running Debian Buster.

The “File not found” error with the named pipe is usually caused by a permission problem. Double check the owner and permissions on your Seafile install.

All my files are owned by seafile:seafile. The processes are run by seafile user, is there any special permission that I’m missing?

edit: did chown -R seafile:seafile . on seafile home just to be sure, and still have the same issue.

I get similar exception when I try to ./reset-admin.sh

seafile@blackberrypi:~/seafile-server-latest $ ./reset-admin.sh
Traceback (most recent call last):
  File "/home/seafile/seafile-server-7.1.4/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 88, 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 "/home/seafile/seafile-server-7.1.4/seahub/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/base.py", line 330, in execute
    output = self.handle(*args, **options)
  File "/home/seafile/seafile-server-7.1.4/seahub/seahub/base/management/commands/createsuperuser.py", line 88, in handle
    User.objects.get(email=default_username)
  File "/home/seafile/seafile-server-7.1.4/seahub/seahub/base/accounts.py", line 95, in get
    emailuser = ccnet_threaded_rpc.get_emailuser(email)
  File "/home/seafile/seafile-server-7.1.4/seafile/lib/python3.6/site-packages/pysearpc/client.py", line 126, in newfunc
    ret_str = self.call_remote_func_sync(fcall_str)
  File "/home/seafile/seafile-server-7.1.4/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 100, in call_remote_func_sync
    transport = self._get_transport()
  File "/home/seafile/seafile-server-7.1.4/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 90, in _get_transport
    transport = self._create_transport()
  File "/home/seafile/seafile-server-7.1.4/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 83, in _create_transport
    transport.connect()
  File "/home/seafile/seafile-server-7.1.4/seafile/lib/python3.6/site-packages/pysearpc/named_pipe.py", line 47, in connect
    self.pipe.connect(self.socket_path)
FileNotFoundError: [Errno 2] No such file or directory

Reviewing my notes, I encountered something similar at it had to do with the ccnet/ccnet-rpc.sock file and not having the correct permission to read. Make sure you check the read/write permissions as well as the ownership.

Also post the information before the traceback - that should give a hint as to what file was attempted to be read. It’s really not a good description of the problem and it’s definitely not a graceful handling of the error.

Did some debugging of the code and I’m not sure if it’s permissions.

What I saw was this

> /home/seafile/seafile-server-7.1.4/seahub/seahub/base/management/commands/createsuperuser.py(88)handle()
-> User.objects.get(email=default_username)

This throws FileNotFound. For the context, default_username in my case is “seafile”

Inside it’s failing at retrieving information on ccnet I guess.

ccnet_threaded_rpc.get_emailuser(email) <-- Fails

So I tracked down deep the problem and it’s the file that you are mentioning. But in my case of a fresh install it seems that doesn’t exist.

Update: I got seafile running. For some reason after I restarted the machine, this time seahub.sh did ask me about setting up an admin. First time, when I installed it and run it, never asked me. For me it’s a mystery.

Glad you got it working.