haiwen / seafile-rpi

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

ModuleNotFoundError: No module named 'seaserv' #108

Closed MattDHarding closed 2 years ago

MattDHarding commented 2 years ago

I'm on raspberry pi 32 bit using an ubuntu 18.04 docker and when I came to try to update my 8.0.7 to 9.0.2 I ran into the same problem as: https://github.com/haiwen/seafile-rpi/issues/71

So my error was:

Starting seahub at port 8000 ...
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-9.0.2/check_init_admin.py", line 19, in <module>
    from seaserv import ccnet_api
ModuleNotFoundError: No module named 'seaserv'
[2022-01-22 10:26:17] Skip running setup-seafile-mysql.py because there is existing seafile-data folder.
Traceback (most recent call last):
  File "/scripts/start.py", line 86, in <module>
    main()
  File "/scripts/start.py", line 72, in main
    call('{} start'.format(get_script('seahub.sh')))
  File "/scripts/utils/__init__.py", line 68, in call
    return subprocess.check_call(*a, **kw)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '/opt/seafile/seafile-server-9.0.2/seahub.sh start' returned non-zero exit status 1.
*** /scripts/start.py exited with status 1.
*** Shutting down runit daemon (PID 36)...
*** Running /etc/my_init.post_shutdown.d/10_syslog-ng.shutdown...
Jan 22 10:26:23 250ee5493814 syslog-ng[29]: syslog-ng shutting down; version='3.13.2'
*** Killing all processes...

The problem seems to be that in seahub.sh the export PYTHONPATH line 227 is wrong for the install in the current arm32v7l bionic archive?

I think the following change was made but the arm32v7l bionic archive wasn't updated? https://github.com/haiwen/seafile-server/commit/e996f5750299da9fbf633e043e23dc47013137fe

The above changes the python dir in lib to be just 'python3' when in the actual arm32v7l bionic version it's still 'python3.6'

If you look within the archive you can see this. https://github.com/haiwen/seafile-rpi/releases/download/v9.0.2/seafile-server-9.0.2-bionic-arm32v7l.tar.gz

I fixed this locally by doing: mv /opt/seafile/seafile-server-9.0.2/seafile/lib/python3.6 /opt/seafile/seafile-server-9.0.2/seafile/lib/python3

MattDHarding commented 2 years ago

I can confirm that switching to ubuntu 20.04 and thus using the respective archive for that works using the same docker setup (bar a few package name changes).

BernieO commented 2 years ago

I hit the same error after compiling seafile-server-9.0.4 for Debian Bullseye (Raspberry Pi OS).
Similarly to @MattDHarding I could fix it locally - in my case with:

mv /opt/seafile/seafile-server-9.0.4/seafile/lib/python2.7 /opt/seafile/seafile-server-9.0.4/seafile/lib/python3