Cannot get Seahub to start. Have tried all options in the release notes

I previously had a good running version of Seafile server (v6.3.4) running on an rPi 3 with Raspbian Scratch. But the USB/Ethernet bus died and I had to upgrade to a rPi4. As such I had to upgrade to Buster and reinstall (v7.1.4). I was able to get everything reinstalled and then import the MySQL database as well. Seafile loads and I am able to access my files again via the network drive on my PC. But I cannot get Seahub to start successfully.

Installation seemed to work without any errors, but upon completion I noticed that the ccnet directory was empty. Since Seahub failed to start I copied over seafile.ini & mykey.peer from my old installation. But per the documentation I am still missing PeerMgr. I figure this is where the problem lies, but have not found any way to fix it.

I also tried the python3.6 symlink and reinstalling Pillow suggestions from the release notes. Below is the error output I get. I am not well versed enough to understand it , but it does seem to be an issue with python and/or pillow.

I have also reset ownership for everything in /opt/seafile to seafile.nogroup.

root@raspberrypi:/opt/seafile/seafile-server-7.1.4 # ./seahub.sh start-fastcgi

LC_ALL is not set in ENV, set to en_US.UTF-8
Starting seahub (fastcgi) at 127.0.0.1:8000 ...
Traceback (most recent call last):
  File "/opt/seafile/seafile-server-7.1.4/seahub/seahub/avatar/models.py", line 23, in <module>
from PIL import Image
  File "/opt/seafile/seafile-server-7.1.4/seahub/thirdpart/PIL/Image.py", line 94, in <module>
from . import _imaging as core
ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/seafile/seafile-server-7.1.4/seahub/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
  File "/opt/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
  File "/opt/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/__init__.py", line 338, in execute
django.setup()
  File "/opt/seafile/seafile-server-7.1.4/seahub/thirdpart/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/opt/seafile/seafile-server-7.1.4/seahub/thirdpart/django/apps/registry.py", line 108, in populate
app_config.import_models()
  File "/opt/seafile/seafile-server-7.1.4/seahub/thirdpart/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/opt/seafile/seafile-server-7.1.4/seahub/seahub/avatar/models.py", line 26, in <module>
import Image
ModuleNotFoundError: No module named 'Image'
Error:Seahub failed to start.

Any help would be greatly appreciated.

Maybe that’s the culprit. Try installing libopenjp2-7. That should give you the required file.
(See https://packages.debian.org/buster/armhf/libopenjp2-7/filelist)

Thank you Squirrel. That got me there. I also had to install libtiff5. I am not sure why these weren’t covered in the dependencies.

The only odd thin is now the start-fastcgi command doesn’t work anymore. When I try it I get “Unknown command: ‘runfcgi’” But I am able to get seahub to start up with just the start command.

So I got the service to start, but now cannot access the web interface. At first I go a “Connection refused” error. After some digging I changed “bind=127.0.0.1:8000” to “bind=0.0.0.0:8000” in gunicorn.conf.py. This led me to a “Page not available due to server hiccup” notice (at least we made a connection. So I turned debugging on and it gave me this error from django:

(1054, "Unknown column 'constance_config.constance_key' in 'field list'")

The same error is spammed in the seahub.log file as well. I saved the full HTML debug page if needed.

Also I am not sure if it is related, but the following error message is spammed in seafile.log:

[09/15/2020 09:11:32 AM] ../common/seaf-db.c(638): Failed to prepare sql SELECT r.repo_id, s.size, b.commit_id, v.repo_id, v.origin_repo, v.path, v.base_commit, fc.file_count, i.status FROM Repo r LEFT JOIN Branch b ON r.repo_id = b.repo_id LEFT JOIN RepoSize s ON r.repo_id = s.repo_id LEFT JOIN VirtualRepo v ON r.repo_id = v.repo_id LEFT JOIN RepoFileCount fc ON r.repo_id = fc.repo_id LEFT JOIN RepoInfo i on r.repo_id = i.repo_id WHERE r.repo_id = ? AND b.name = 'master': Unknown column 'i.status' in 'field list'

Also appears to be a DB query error, but a different one. As mentioned above I restored a previous database. I found some references to similar errors online, but for different columns and table when people upgraded from 6.x to 7.x, but didn’t want to try implementing those solutions and muck my DB up. Thanks.

I got brave and went into the seahub-db and changed the column name from key to constance_key in the constance_config table and now I can log on.

Any idea on what the seafile-db error means? everything seems to be working ok.

is deprecated since 6.3, that’s why it doesn’t work :wink:

About the mysql-stuff: Sorry, been using sqlite. Good luck!

1 Like

I found the solution. When upgrading from 6.x to 7.x the “status” column was added to table seafile-db.RepoInfo. I just had to create it as an integer with default value 0. This column must have been dumped when I imported my old 6.3 database.