Seahub service start problems

Hi i am trying to start seahub 7.0.5 on my raspberry pi 4 and was getting this error

LC_ALL is not set in ENV, set to en_US.UTF-8
./seahub.sh: line 208: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
Starting seahub (fastcgi) at 127.0.0.1:8000 …
Traceback (most recent call last):
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/Django-1.11.16-py2.7.egg/django/core/management/init.py”, line 364, in execute_from_command_line
utility.execute()
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/Django-1.11.16-py2.7.egg/django/core/management/init.py”, line 338, in execute
django.setup()
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/Django-1.11.16-py2.7.egg/django/init.py”, line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/Django-1.11.16-py2.7.egg/django/apps/registry.py”, line 85, in populate
app_config = AppConfig.create(entry)
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/Django-1.11.16-py2.7.egg/django/apps/config.py”, line 94, in create
module = import_module(entry)
File “/usr/lib/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/social_django/init.py”, line 4, in
from social_core.backends.base import BaseAuth
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/social_auth_core-1.7.0-py2.7.egg/social_core/backends/base.py”, line 3, in
from requests import request, ConnectionError
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/requests-2.20.1-py2.7.egg/requests/init.py”, line 112, in
from . import utils
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/requests-2.20.1-py2.7.egg/requests/utils.py”, line 24, in
from . import certs
File “/home/jonathan/temp/seafile-server-7.0.5/seahub/thirdpart/requests-2.20.1-py2.7.egg/requests/certs.py”, line 15, in
from certifi import where
ImportError: No module named certifi

I then tried to create a unit called seahub.service inside etc/systemd/system with the followin:

[Unit]
Description=Seafile hub
After=network.target seafile.service

[Service]

change start to start-fastcgi if you want to run fastcgi

Environment=“LC_ALL=C”
ExecStart=/home/jonathan/temp/seafile-server-7.0.5/seahub.sh start-fastcgi
ExecStop=/home/jonathan/temp/seafile-server-7.0.5/seahub.sh stop
User=seafile
Group=seafile
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

I then got this error when executing sudo systemctl daemon-reload and sudo systemctl start seahub.service

Job for seahub.service failed because the control process exited with error code.
See “systemctl status seahub.service” and “journalctl -xe” for details.

And the output for checking the status logs via sudo journalctl -u seahub.service is below:

Oct 23 19:38:38 raspberrypi systemd[1]: Starting Seafile hub…
Oct 23 19:38:38 raspberrypi systemd[6309]: seahub.service: Failed to determine user credentials: No such process
Oct 23 19:38:38 raspberrypi systemd[6309]: seahub.service: Failed at step USER spawning /home/jonathan/temp/seafile-s
Oct 23 19:38:38 raspberrypi systemd[1]: seahub.service: Main process exited, code=exited, status=217/USER
Oct 23 19:38:38 raspberrypi systemd[1]: seahub.service: Failed with result ‘exit-code’.
Oct 23 19:38:38 raspberrypi systemd[1]: Failed to start Seafile hub.

Hi jonneymendoza,

the first error message is easy. ImportError: No module named certifi means that the Seafile system is missing this python package.
Try installing the package with sudo pip install certifi and then restart Seafile.

the second error message is also simple: failed to determine user credentials: No such process
Seahub needs a started Seafile and simply reports that Seafile is not running yet.

The procedure must therefore be:

  • fix all issues with seafile
  • start seafile
  • start seahub

happy testing. :slight_smile:
Best regards
Christoph

Hi i did the following.

sudp pop install certifi
sudo ./seafile.sh stop
sudo ./seafile.sh start
sud ./seahub.start

When i tried to start seahub again i got the same ```ImportError: No module named Image

Hey jonneymendoza,

I hope you use sudo pip install ad not sudp pop :-).
Well I think it is clear what you have to do. There is another missing python library and you have to install them. You can try pip install image. If that is not working, google for packagename + python + raspberry pi. This will help you to identify the necessary python packages.

Best regards
Christoph

Brilliant thanks it worked!

So i have the seafile and seahub running but i cant seem to access it on my other machine via the client i installed on my windows based machine.

the port i am using for seafile is 8085 and the seahub seems to be set at 8000.

I added both ports in my router for port forwarding and tried to connect to the sea file server via the pi’s local ip address(192.168.x.xxx) with either 8000 or 8085 port and no joy. It does not seem to hit the server or the server not quite active/setup?

I also tried to see if i can locally ping into the seafile via “ping https://localost:8000” and no joy either via ssh into the the pi device

Hi jonneymendoza,

sorry, but now you mixed so many things and all are related to basic understanding of ip-networks. Let me try to give you some guidance:
(I made a video about these topic but it is german: https://www.youtube.com/watch?v=o7XwVpLsgIo)

So what is wrong:

  • you don’t open port 8085 and 8000 at your router. You use a webserver as proxy and you only access seafile via port 80 (http) or 443 (https)
  • you can not access a server over the internet with the local ip. 192.168.x.x is only accessable on LAN
  • https:// requires a certificate and a webserver. I don’t think you have one
  • localhost means = local computer. So your windows will try to access seafile on itself. This will not work.

what do you have to do:

  1. you have to decide if you want to access seafile only from the same network (=lan) via IP-Adresse or access from everywhere via URL
  2. you should not use seafile without a webserver (nginx or apache). This webserver is responsible for https.

I don’t want to be harsch, but your should build up a little bit more knowledge on networks before you are ready to build, host and maintain your own seafile server.

Best regards
Christoph

Hi. i already have knowledge on network :slight_smile:
I Think i did not explain myself well so i will try again.

After starting up both the seafile an seahub i tried to connect to via LAN.

i have the seafile server running on a pi and the client app installed on a seperate windows laptop.

I installed this client and then tried to connect to it using 192.168.x.xxx:8000 using http and https . Both did not work.

I then SSH into my pi 4 and tried to launch that PING command through basically the pi device using localhost .

The ports are forwarded on my router the same way i have forwarded ports for other web services i run on my pi and those web services work fine.

I am trying to connect to this via LAN first before i tackle seeing how to connect via outside of LAN.

please post the output of netstat -tulpn from your pi.
Best regards
Christoph

Sure ok here it goes

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8112 0.0.0.0:* LISTEN 659/python
tcp 0 0 0.0.0.0:8082 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:58846 0.0.0.0:* LISTEN 649/python
tcp 0 0 0.0.0.0:64319 0.0.0.0:* LISTEN 649/python
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN -
tcp6 0 0 :::80 :::* LISTEN -
tcp6 0 0 :::22 :::* LISTEN -
tcp6 0 0 :::445 :::* LISTEN -
tcp6 0 0 :::64319 :::* LISTEN 649/python
tcp6 0 0 :::139 :::* LISTEN -
udp 0 0 0.0.0.0:50477 0.0.0.0:* 649/python
udp 0 0 0.0.0.0:64319 0.0.0.0:* 649/python
udp 0 0 192.168.1.111:55130 0.0.0.0:* 649/python
udp 0 0 192.168.1.111:1900 0.0.0.0:* 649/python
udp 0 0 127.0.0.1:1900 0.0.0.0:* 649/python
udp 0 0 0.0.0.0:1900 0.0.0.0:* 649/python
udp 0 0 127.0.0.1:45001 0.0.0.0:* 649/python
udp 0 0 0.0.0.0:68 0.0.0.0:* -
udp 0 0 127.0.0.1:41040 0.0.0.0:* 649/python
udp 0 0 192.168.1.111:6771 0.0.0.0:* 649/python
udp 0 0 127.0.0.1:6771 0.0.0.0:* 649/python
udp 0 0 0.0.0.0:6771 0.0.0.0:* 649/python
udp 0 0 0.0.0.0:35958 0.0.0.0:* -
udp 0 0 192.168.1.255:137 0.0.0.0:* -
udp 0 0 192.168.1.111:137 0.0.0.0:* -
udp 0 0 0.0.0.0:137 0.0.0.0:* -
udp 0 0 192.168.1.255:138 0.0.0.0:* -
udp 0 0 192.168.1.111:138 0.0.0.0:* -
udp 0 0 0.0.0.0:138 0.0.0.0:* -
udp 0 0 192.168.1.111:50393 0.0.0.0:* 649/python
udp 0 0 0.0.0.0:5353 0.0.0.0:* -
udp6 0 0 :::64319 :::* 649/python
udp6 0 0 :::35828 :::* -
udp6 0 0 fe80::d03a:7464:41:6771 :::* 649/python
udp6 0 0 ::1:6771 :::* 649/python
udp6 0 0 :::6771 :::* 649/python
udp6 0 0 fe80::d03a:7464:4:56510 :::* 649/python
udp6 0 0 ::1:41666 :::* 649/python
udp6 0 0 :::5353 :::* -

Thanks for your help in advance. appreciate it

this is the relevant part:
tcp 0 0 127.0.0.1:8000 0.0.0.0: LISTEN -*

This means that the seafile server only accepts requests from 127.0.0.1 what means his self.
Go to seafile-folder/conf/guniconf.conf and change 127.0.0.1:8000 to 0.0.0.0:8000. Then restart seafile and your should be able to access seafile from your windows client with:
http://IP-of-seafile-server:8000.

If this works, the next step should be to add a webserver to change the access to https://ip-of-seafile-server (without :8000)

Best regards
Christoph

sorry it must be: gunicorn.conf. not guniconf.conf.

Just another hint:
As soon as you added a webserver, don’t forget to change back gunicorn.conf to 127.0.0.1:8000 to prevent direct access to seafile.

Ok brilliant that worked!

However, i am able to login via the web browser but on the actual Seafile window client program, i keep getting an "failed to login: internal server error.

After i can successfully login using the client i will try and add this in the apache web server.

I kind of thought that the python script would have set all this up for me but i guess there is more setting up to do so