Using FreeBSD 13.2-RELEASE with Python 3.9 When executing seahub using the command './seahub.sh start' and it failed to start. LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... python3.9: can't open file '/usr/local/www/haiwen/seafile-server/seahub/thirdpart/bin/gunicorn': [Errno 2] No such file or directory Error:Seahub failed to start. Please try to run "./seahub.sh start" again
It was done with a clean install in jail and error is confirmed.
Hi, Same problem on 13.2-RELEASE-p2 after an upgrade.
It looks like you are trying to use the built-in script, I created custom rc scripts for seafile/seahub. The help message during setup should mention to use: service seahub start
Seahub still not starting : https://paste.swordarmor.fr/N3nx
Custom rc script still doesn't work.
Are there any logs here: /usr/local/www/haiwen/seafile-server/logs ? The seahub.log should be the one you are looking for. If not, you could run the start command in a tty: su -m seafile -c '/usr/local/bin/python3.9 "/usr/local/bin/gunicorn-3.9" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"' There was an option you could pass to gunicorn that forced it to run in the foreground if there was no output. Should be able to run -h to find the correct option.
there is no log folder in /usr/local/www/haiwen/seafile-server: [root@seafile /usr/local/www/haiwen/seafile-server]# ls check-db-type.py pro.py seaf-backup-cmd.py seafile setup-seafile-mysql.sh check_init_admin.py remove-objs.py seaf-backup-cmd.sh seafile-background-tasks.sh setup-seafile.sh index_op.py remove-objs.sh seaf-encrypt.sh seafile.sh sql migrate-repo.py reset-admin.sh seaf-fsck.sh seafobj_migrate.py sqlite2mysql.py migrate-repo.sh run_index_master.sh seaf-fuse.sh seahub sqlite2mysql.sh migrate.py run_index_worker.sh seaf-gc.sh seahub.sh upgrade migrate.sh runtime seaf-import.sh setup-seafile-mysql.py And the only one i found, no logs in it : [root@seafile /usr/local/www/haiwen]# find . -name "log*" -type d ./seafile-server/seahub/frontend/src/pages/sys-admin/logs-page ./logs [root@seafile /usr/local/www/haiwen]# cd logs/ [root@seafile /usr/local/www/haiwen/logs]# ls -Al total 0 This command doesn't have any output : [root@seafile /usr/local/www/haiwen/seafile-server]# su -m seafile -c '/usr/local/bin/python3.9 "/usr/local/bin/gunicorn-3.9" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"' [root@seafile /usr/local/www/haiwen/seafile-server]# If i run it with -h : [root@seafile /usr/local/www/haiwen]# su -m seafile -c '/usr/local/bin/python3.9 /usr/local/bin/gunicorn-3.9 -h' usage: gunicorn-3.9 [OPTIONS] [APP_MODULE] optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -c CONFIG, --config CONFIG :ref:`The Gunicorn config file<configuration_file>`. [./gunicorn.conf.py] -b ADDRESS, --bind ADDRESS The socket to bind. [['127.0.0.1:8000']] --backlog INT The maximum number of pending connections. [2048] -w INT, --workers INT The number of worker processes for handling requests. [1] -k STRING, --worker-class STRING I tried with this command to have log in debug but nothing : su -m seafile -c '/usr/local/bin/python3.9 /usr/local/bin/gunicorn-3.9 seahub.wsgi:application -c /usr/local/www/haiwen/conf/gunicorn.conf.py -b 127.0.0.1:8000 --preload --chdir /usr/local/www/haiwen/seafile-server/seahub -D --log-config /tmp/gunicorn.log --log-level DEBUG' The gunicorn.conf.py file : [root@seafile /usr/local/www/haiwen]# cat /usr/local/www/haiwen/conf/gunicorn.conf.py import os daemon = True workers = 5 # default localhost:8000 bind = "127.0.0.1:8000" # Pid pids_dir = '/usr/local/www/haiwen/pids' pidfile = os.path.join(pids_dir, 'seahub.pid') # for file upload, we need a longer timeout value (default is only 30s, too short) timeout = 1200 limit_request_line = 8190
Ah yeah, ok so it was the config, just change the daemon = True to False and it will run in foreground. Couple questions. 1. Is this a fresh install and configured? 2. Is the seafile service started? Based on your previous comment, it sounds like seafile is not configured. If both the above are no, please follow the pkg-message instructions after install. https://www.freshports.org/www/seahub/
For me, it's an upgrade, this seafile is installed since 3 or 4 years. I changed to False and now i have : ++ su -m seafile -c '/usr/local/bin/python3.9 "/usr/local/bin/gunicorn-3.9" seahub.wsgi:application -c "/usr/local/www/haiwen/conf/gunicorn.conf.py" -b "127.0.0.1:8000" --preload --chdir "/usr/local/www/haiwen/seafile-server/seahub"' Traceback (most recent call last): File "/usr/local/bin/gunicorn-3.9", line 33, in <module> sys.exit(load_entry_point('gunicorn==21.2.0', 'console_scripts', 'gunicorn')()) File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 67, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 236, in run super().run() File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 72, in run Arbiter(self).run() File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 58, in __init__ self.setup(app) File "/usr/local/lib/python3.9/site-packages/gunicorn/arbiter.py", line 118, in setup self.app.wsgi() File "/usr/local/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load return self.load_wsgiapp() File "/usr/local/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.9/site-packages/gunicorn/util.py", line 371, in import_app mod = importlib.import_module(module) File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/usr/local/www/haiwen/seafile-server/seahub/seahub/wsgi.py", line 25, in <module> application = get_wsgi_application() File "/usr/local/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application django.setup(set_prefix=False) File "/usr/local/lib/python3.9/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate app_config.import_models() File "/usr/local/lib/python3.9/site-packages/django/apps/config.py", line 301, in import_models self.models_module = import_module(models_module_name) File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 850, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "/usr/local/www/haiwen/seafile-server/seahub/seahub/avatar/models.py", line 28, in <module> from seahub.avatar.util import invalidate_cache, get_avatar_file_storage File "/usr/local/www/haiwen/seafile-server/seahub/seahub/avatar/util.py", line 8, in <module> from seahub.avatar.settings import AVATAR_DEFAULT_URL, AVATAR_CACHE_TIMEOUT,\ File "/usr/local/www/haiwen/seafile-server/seahub/seahub/avatar/settings.py", line 25, in <module> AVATAR_RESIZE_METHOD = getattr(settings, 'AVATAR_RESIZE_METHOD', Image.ANTIALIAS) AttributeError: module 'PIL.Image' has no attribute 'ANTIALIAS' Seafile is already running : [root@lytan /usr/local/www/haiwen]# ps aux | grep seafile seafile 1076 0.0 0.1 25276 5188 - Ss 17:54 0:01.52 /usr/local/www/haiwen/seafile-server/seafile/bin/seafile-controller -c /usr/local/www/haiwen/ccnet -d /private/seafile/ seafile 1078 0.0 0.3 109064 10712 - Ss 17:54 0:03.86 seaf-server -F /usr/local/www/haiwen/conf -c /usr/local/www/haiwen/ccnet -d /private/seafile/ -l /var/log/seafile/seafi root 43031 0.0 0.0 12812 2072 1 S+ 09:34 0:00.00 grep seafile
(In reply to Boris Tassou from comment #9) Did you run the upgrade scripts? What version did you upgrade from? You'll need to run every upgrade from whatever version you are on to the installed version. If you haven't upgraded for 3 to 4 years, you will probably have several to run.
(In reply to Boris Tassou from comment #9) Disregard my previous comment, it looks like the error is pillow's recent update to 10 which removed ANTIALIAS is 10.0.0. If you are able to rollback pillow, that should fix your issue.
(In reply to Richard Gallamore from comment #11) I can't downgrade it, it comes with seahub in dependances. [root@seafile /usr/local/www/haiwen]# pkg remove py39-pillow Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 4 packages (of 0 packages in the universe): Installed packages to be REMOVED: py39-django-simple-captcha: 0.5.14_1 py39-pillow: 10.0.0_1 py39-qrcode: 7.4 seahub: 9.0.10
(In reply to Boris Tassou from comment #12) If you have the old pillow package, I think you should be able to force-install it. I'll try and set up a repro to give specific instructions later today.
(In reply to Richard Gallamore from comment #13) I had this package in the pkg cache folder! But another error with the version 9.5.0 : https://paste.swordarmor.fr/FNkr thanks for your help!
I recommend moving to the quarterly branch until this can be sorted out. Just tested the quarterly branch and a fresh install is working fine.
It seems the problem has been fixed in this commit [1]. I could run the above command in Comment #9 successfully. Please try this patch [2]. [1] https://github.com/haiwen/seahub/commit/cbe0817f2bee0c2b00d3ffd3e047c3141862c6c5 [2] https://people.freebsd.org/~sunpoet/patch/www-seahub.txt
(In reply to Po-Chuan Hsieh from comment #16) with this patch, i no longer have the error for PIL, but still this error when i try to access to seafile: https://paste.swordarmor.fr/gqMz
(In reply to Boris Tassou from comment #17) Disregard this comment, if i install : pkg install py39-packaging seahub start \o/
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ffaa8cd925c26ff03e8d7e358b9fa54e774a9db5 commit ffaa8cd925c26ff03e8d7e358b9fa54e774a9db5 Author: Richard Gallamore <ultima@FreeBSD.org> AuthorDate: 2023-08-26 17:24:40 +0000 Commit: Richard Gallamore <ultima@FreeBSD.org> CommitDate: 2023-08-26 17:24:40 +0000 www/seahub: Patch for new version of Pillow PR: 272942 Reported by: Scott Kitchin (scott@kitchin.com), Boris Tassou (boris.tassou@securmail.fr) Submitted by: sunpoet Obtained from: Seafile www/seahub/Makefile | 3 ++- www/seahub/files/patch-pillow (new) | 50 +++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-)
Committed, thanks everyone.
The patched seahub-9.0.10_1 doesn't work without py39-packaging installed as it displayed 'internal server error' on the browser. You need to include py39-packaging as a required package.
(In reply to Scott Kitchin from comment #21) Thanks Scott, yes I see what you mean now... This is a missing dependency in gunicorn. https://github.com/benoitc/gunicorn/blob/master/setup.py#L75
Created: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273412 for the missing depend.