After upgrade from 7.0.5 to 7.1.4 on Raspbian Stretch seahub fails to start

Today I upgraded from 7.0.5 to 7.1.4 on Stretch. I followed https://download.seafile.com/published/seafile-manual/upgrade/upgrade_notes_for_7.1.x.md. seahub doesn’t start any more :-(. I found Seahub fails after upgrade to 7.1.4 but this one talks about upgrade on buster and talks about a module not found error message. But I frankly don’t get any error message :frowning:

sudo  systenctl start seahub
Job for seahub.service failed because the control process exited with error code. 
See "systemctl status seahub.service" and "journalctl -xe" for details.
 journalctl -xe -u seahub
 -- Subject: Unit seahub.service has begun start-up
    -- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit seahub.service has begun starting up.
Jun 22 15:21:49 seafile seahub.sh[999]: LC_ALL is not set in ENV, set to en_US.UTF-8
Jun 22 15:21:49 seafile seahub.sh[999]: Starting seahub at port 8000 ...
Jun 22 15:22:06 seafile systemd[1]: Started Seafile hub.
-- Subject: Unit seahub.service has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit seahub.service has finished starting up.
-- 
-- The start-up result is done.
Jun 22 15:22:07 seafile systemd[1]: seahub.service: Main process exited, code=exited, status=1/FAILURE
Jun 22 15:22:07 seafile systemd[1]: seahub.service: Unit entered failed state.
Jun 22 15:22:07 seafile systemd[1]: seahub.service: Failed with result 'exit-code'.
Jun 22 15:32:08 seafile systemd[1]: Starting Seafile hub...
-- Subject: Unit seahub.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit seahub.service has begun starting up.
Jun 22 15:32:08 seafile seahub.sh[1605]: LC_ALL is not set in ENV, set to en_US.UTF-8
Jun 22 15:32:08 seafile seahub.sh[1605]: Starting seahub at port 8000 ...
Jun 22 15:32:14 seafile systemd[1]: seahub.service: Control process exited, code=exited status=1
Jun 22 15:32:14 seafile systemd[1]: Failed to start Seafile hub.
-- Subject: Unit seahub.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- Unit seahub.service has failed.

– The result is failed.
Jun 22 15:32:14 seafile systemd[1]: seahub.service: Unit entered failed state.
Jun 22 15:32:14 seafile systemd[1]: seahub.service: Failed with result ‘exit-code’.

seahub.log is empty.

When I invoke bash -x ./seahub.sh the last lines I get are

+ python3 /seafile-data/home/buddy/seafile/seafile-server-7.1.4/check_init_admin.py
+ python3 /seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /seafile-data/home/buddy/seafile/conf/gunicorn.conf.py --preload
+ sleep 5
+ pgrep -f seahub.wsgi:application
+ printf '\033[33mError:Seahub failed to start.\033[m\n'
Error:Seahub failed to start.
+ echo 'Please try to run "./seahub.sh start" again'
Please try to run "./seahub.sh start" again
+ exit 1

Would be great somebody knows how can I can get more information about the root cause of gunicorn to fail :slight_smile:

cat gunicorn.conf.py
import os

daemon = True
workers = 5

bind = “127.0.0.1:8000”

pids_dir = ‘/seafile-data/home/buddy/seafile/pids’
pidfile = os.path.join(pids_dir, ‘seahub.pid’)

timeout = 1200

limit_request_line = 8190

Just ask for any other details/configs which will help to find the root cause of the miracle :slight_smile:

UPDATE:
When I execute the following command used to start gunicorn I get

python3 /seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/bin/gunicorn seahub.wsgi:application -c /seafile-data/home/buddy/seafile/conf/gunicorn.c
onf.py --preload
Traceback (most recent call last):
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/bin/gunicorn”, line 5, in
from gunicorn.app.wsgiapp import run
ImportError: No module named ‘gunicorn’

May this be the root cause of the issue?

Running Seahub in FastCGI mode should give you better (more detailed) error messages.

Thank you very much for this hint. That’s what I get now:

./seahub.sh start-fastcgi 8000

Starting seahub (fastcgi) at 127.0.0.1:8000 …
Traceback (most recent call last):
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/seahub/avatar/models.py”, line 23, in
from PIL import Image
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/PIL/Image.py”, line 93, in
from . import _imaging as core
ImportError: cannot import name ‘_imaging’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/manage.py”, line 10, in
execute_from_command_line(sys.argv)
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/init.py”, line 364, in execute_from_command_line
utility.execute()
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/django/core/management/init.py”, line 338, in execute
django.setup()
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/django/init.py”, line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/thirdpart/django/apps/registry.py”, line 108, in populate
app_config.import_models()
File “/seafile-data/home/buddy/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.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 673, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/seafile-data/home/buddy/seafile/seafile-server-7.1.4/seahub/seahub/avatar/models.py”, line 26, in
import Image
ImportError: No module named ‘Image’
Error:Seahub failed to start.

You need python 3.6 or newer. Please read all of:

Thank you very much for the link.

You are right. I run right now

python3 --version
Python 3.5.3

I followed this page which unfortunately doesn’t refer to your link. I will upgrade my python now.

Does it still work?

No. seahub doesn’t start any more. I just followed these instructions

When I execute ```
pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy \ django-pylibmc django-simple-captcha python3-ldap


I get a lot of error messages:

>  running bdist_wheel
>   running build
>   running build_py
>   creating build
>   creating build/lib.linux-armv7l-3.5
>   creating build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/consts.py -> build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/__init__.py -> build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/autoconf.py -> build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/__main__.py -> build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/test.py -> build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/pools.py -> build/lib.linux-armv7l-3.5/pylibmc
>   copying src/pylibmc/client.py -> build/lib.linux-armv7l-3.5/pylibmc
>   running build_ext
>   building '_pylibmc' extension
>   creating build/temp.linux-armv7l-3.5
>   creating build/temp.linux-armv7l-3.5/src
>   arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE_ZLIB -I/usr/include/python3.5m -c src/_pylibmcmodule.c -o build/temp.linux-armv7l-3.5/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
>   In file included from src/_pylibmcmodule.c:34:0:
>   src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
>    #include <libmemcached/memcached.h>
>                                       ^
>   compilation terminated.
>   error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
>   
>   ----------------------------------------
>   Failed building wheel for pylibmc
>   Running setup.py clean for pylibmc
> Failed to build pylibmc
> Installing collected packages: Pillow, pylibmc, captcha, MarkupSafe, jinja2, sqlalchemy, django-pylibmc, six, sqlparse, pytz, Django, django-ranged-response, django-simple-captcha, pyasn1, python3-ldap
>   Running setup.py install for pylibmc ... error
>     Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wonnoae8/pylibmc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-wii__cum-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
>     running install
>     running build
>     running build_py
>     creating build
>     creating build/lib.linux-armv7l-3.5
>     creating build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/consts.py -> build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/__init__.py -> build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/autoconf.py -> build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/__main__.py -> build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/test.py -> build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/pools.py -> build/lib.linux-armv7l-3.5/pylibmc
>     copying src/pylibmc/client.py -> build/lib.linux-armv7l-3.5/pylibmc
>     running build_ext
>     building '_pylibmc' extension
>     creating build/temp.linux-armv7l-3.5
>     creating build/temp.linux-armv7l-3.5/src
>     arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6waWnr/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DUSE_ZLIB -I/usr/include/python3.5m -c src/_pylibmcmodule.c -o build/temp.linux-armv7l-3.5/src/_pylibmcmodule.o -fno-strict-aliasing -std=c99
>     In file included from src/_pylibmcmodule.c:34:0:
>     src/_pylibmcmodule.h:42:36: fatal error: libmemcached/memcached.h: No such file or directory
>      #include <libmemcached/memcached.h>
>                                         ^
>     compilation terminated.
>     error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
>     
>     ----------------------------------------
> Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wonnoae8/pylibmc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-wii__cum-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-wonnoae8/pylibmc/

:-(

Not sure for production, but it works fine to get detailed python errors in case seahub.sh does not start.

1 Like

Not sure I get you. Do you say even these error messages pop up seahub will work? I use this seafile server in production and want to have a clean environment. Actually the upgrade of python already fails and thus seahub still doesn’t start up.

Reading the doc about the upgrade to 7.1.4 it looks like there has a lot of stuff changed - not only the python upgrade. It’s even worse seafdav has issues in 7.1.4 because I need this functionality.

Does it make sense to setup buster and install 7.1.4 on top because the buster version of 7.1.4 is more reliable than the stretch version? Or should I consider 7.1.4 as a buggy release and revert to 7.0.5?

I only see in your latest error message that libmemcached/memcached.h is not found.
I resolved this error (on Ubuntu 20.04, but still) by installing libmemcached-dev - which seems to be available for stretch.

Yet, I don’t know how much this will help you as your python version is still 3.5 which does not seem to work anyway. (Again, no experience myself, just what I’ve read.)

From a fresh install I noticed that even if you update to python3.6+ (in my case python3.7) you have issues with finding packages. You will need to link seafile-server-7.1.4/seafile/lib/python3.7 -> seafile-server-7.1.4/seafile/lib/python3.6 and that makes thing to work.

1 Like

Correct. It’s all documented in the referenced post.

I had serious issues to upgrade python on stretch to 7. So I decided to setup a new system with buster. Again I had serious issues to get seafile 7.1.4 up and running. I now revert to 7.0.5 to get my seafile up and running again. I have to have a running seafile again and cannot spend any more time on trial and error install of 7.1.4.

I run seafile for a long time already and upgraded seafile a lot of times without any issues on my production system successfully. When wsgi was introduced I decided to setup a test system to check how to upgrade and how the upgrade works and then started the upgrade on my production system. Looks like I should have done this again when upgrading from 7.0.5 to 7.1.4. I hope next upgrade to 7.1.5 will run again smoothly and there is no need to setup a dedicated test environment first :slight_smile:

Seems you were having trouble switching to python 3. Since 7.1.5 will by python 3 as well, I assume you will have the same issues all over again. Worth looking into your problems when you got time.

buster already has python 7. I frankly just stopped when I got seahub to fail to start on buster and didn’t spend any time to isolate the root cause because I was frustated. There was no need for me to upgrade to 7.1.4 but given my past experiences with seafile upgrades I thought it’s worth to upgrade to 7.1.4 … but looks like this was a bad idea.

For now I will stick with 7.0.5 which works fine for me. Maybe I will give it another try to install 7.1.4 on a test system when I have some spare time …

1 Like

Once you pass the “it runs phase” there are more issues as seen in other threads. I’m happy that 7.0.5 worked for you, I’m switching back too.

I just got my seafile up and running with version 7.0.5 with my backups. It took me a while because I never had to use my seafile backups before to revert after an upgrade to a weak version and thus I never tested the restore before.

I’m not sure how I’m going to make sure this incident will not happen any more. For now I will stick with 7.0.5 until Stretch has EOS. Hope then there will be a new version of seafile available which allows a smooth upgrade without any issues as it was in all previous upgrades.