Hi,
When upgrading my Raspberry Pi 2 running Debian 10, I got an error when starting seahub.
The error is now already resolved but I would still like to share the answer here for other users.
Unfortunately there was also no specific error message shown but with this hint starting with fastcgi altough not needed I got more details about the error:
LC_ALL is not set in ENV, set to en_US.UTF-8
./seahub.sh: line 210: 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/seafile/haiwen/seafile-server-8.0.7/seahub/seahub/avatar/models.pyβ, line 23, in
from PIL import Image
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/thirdpart/PIL/Image.pyβ, line 114, in
from . import _imaging as core
ImportError: libopenjp2.so.7: cannot open shared object file: No such file or directoryDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/manage.pyβ, line 10, in
execute_from_command_line(sys.argv)
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/thirdpart/django/core/management/init.pyβ, line 381, in execute_from_command_line
utility.execute()
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/thirdpart/django/core/management/init.pyβ, line 357, in execute
django.setup()
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/thirdpart/django/init.pyβ, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/thirdpart/django/apps/registry.pyβ, line 114, in populate
app_config.import_models()
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/thirdpart/django/apps/config.pyβ, line 211, 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 ββ, line 1006, in _gcd_import
File ββ, line 983, in _find_and_load
File ββ, line 967, in _find_and_load_unlocked
File ββ, line 677, in _load_unlocked
File ββ, line 728, in exec_module
File ββ, line 219, in _call_with_frames_removed
File β/home/seafile/haiwen/seafile-server-8.0.7/seahub/seahub/avatar/models.pyβ, line 26, in
import Image
ModuleNotFoundError: No module named βImageβ
Error:Seahub failed to start.
With this information I found out that the line from PIL import Image
at seahub/seahub/avatar/models.py causes this error. Pillow itself was installed so I got curious and when trying the same thing directly in Python3, it shows the following error which finally guided me to the right place:
>>> from PIL import Image
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/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
After I installed the missing library simply with sudo apt install libopenjp2-7
I could successfully start seahub and my seafile installation is now working properly.
I donβt know why I hadnβt this library installed but maybe this is also a thing to add at the update documentation for Raspberry Pi 2.
Additionally, Python PyMySQL was missing but only later I realized that this was actually written in the announcement that Seafile Server 8.0.3 for Raspberry Pi is ready.