Summary: | www/seahub: failed upgrade 7.0 -> 7.1 | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Boris Tassou <boris.tassou> |
Component: | Individual Port(s) | Assignee: | Richard Gallamore <ultima> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | cedric |
Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(ultima) |
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Boris Tassou
2020-08-04 19:36:58 UTC
Hi, Even with updates, i still have the issue : [root@lytan ~]# /usr/local/etc/rc.d/seahub onestart LANG is not set in ENV, set to en_US.UTF-8 LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... Error:Seahub failed to start. Please try to run "./seahub.sh start" again Packages have been update : [root@lytan ~]# pkg info | grep sea libsearpc-3.2.0_1,1 Simple RPC framework based on GObject System in C py37-seafdav-7.1.6 Python library for accessing seafile data model py37-seafobj-7.1.6 Python library for accessing seafile data model seafile-server-7.1.4 Open Source Cloud Storage (Server) seahub-7.1.5 Web frontend for Seafile If i try the command line in the init script : su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" 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"' I have no return/information in the console. 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 Some help will be appreciated! Thanks Hello Boris,
You should not invoke the seahub.sh startup scripit in the seafile-server folder. Seahub/Seafile is executed under the seafile user and it is possible that invoking it under root will change some of the file permissions.
In order to invoke through cli over service, the command executed is shown when you turned -x on.
> + su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" 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"'
Try to invoke this as root and see if it provides more details.
I also suggest deleting or moving all logs before this so we don't have old entries confusing us.
One other tip, I suggest completely uninstalling seafile/seahub and also doing an pkg autoremove. Look into the folder and check the permissions of everything. ccnet, conf, logs, pids, seafile-data and seahub-data should all be owned by seafile as well as files in these directories.
I'm not currently using sqlite, but sqlite files should also be under seafile. Once this has been checked reinstall seafile/seahub and try starting seafile/seahub again.
I tried the ./seahub.sh because it's in the error message : [root@lytan ~]# /usr/local/etc/rc.d/seahub onerestart Seahub is not running LANG is not set in ENV, set to en_US.UTF-8 LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... Error:Seahub failed to start. Please try to run "./seahub.sh start" again If i try the su method i haven't any return in the console : [root@lytan /usr/local/www/haiwen/logs]# su -m seafile -c '/usr/local/bin/python3.7 "/usr/local/bin/gunicorn-3.7" 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@lytan /usr/local/www/haiwen/logs]# ps aux | grep sea seafile 8619 0.0 0.7 23076 14316 - Ss 20:11 0:00.01 /usr/local/www/haiwen/seafile-server/seafile/bin/seafile-controller -c /usr/local/www/haiwen/ccnet -d /usr/local/www/haiwen/seafile-data -F /usr/l seafile 8620 0.0 1.0 29136 19760 - Ss 20:11 0:00.02 ccnet-server -F /usr/local/www/haiwen/conf -c /usr/local/www/haiwen/ccnet -f /usr/local/www/haiwen/logs/ccnet.log -d -P /usr/local/www/haiwen/pids seafile 8622 0.0 1.2 49948 24276 - Ss 20:11 0:00.03 seaf-server -F /usr/local/www/haiwen/conf -c /usr/local/www/haiwen/ccnet -d /usr/local/www/haiwen/seafile-data -l /usr/local/www/haiwen/logs/seafi root 8666 0.0 0.1 11296 2764 0 S+ 20:13 0:00.00 grep sea i uninstall/remove/reinstall and do "chown -R seafile:seafile /usr/local/www/haiwenn" but nothing change. In the log file seahub.log i have nothing : [root@lytan /usr/local/www/haiwen/logs]# cat seahub.log [root@lytan /usr/local/www/haiwen/logs]# ls -Alrth total 0 -rw-r--r-- 1 seafile seafile 0B Sep 16 20:12 seahub.log The su method probably doesn't work because it is expecting environment variables which aren't set. Don't worry about this. I don't suggest using this method anyway. Instead, to debug this, in /usr/local/www/haiwen/conf/gunicorn.conf.py change the daemon option to False. Then Invoke service seahub onestart. This should provide stdout and stderr to help solve whatever the issue is starting gunicorn. Thanks for the help! With daemon to false : [root@lytan ~]# /usr/local/etc/rc.d/seahub onestart LANG is not set in ENV, set to en_US.UTF-8 LC_ALL is not set in ENV, set to en_US.UTF-8 Starting seahub at port 8000 ... Traceback (most recent call last): File "/usr/local/bin/gunicorn-3.7", line 11, in <module> load_entry_point('gunicorn==19.9.0', 'console_scripts', 'gunicorn')() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 61, in run WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 223, in run super(Application, self).run() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run Arbiter(self).run() File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 60, in __init__ self.setup(app) File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 120, in setup self.app.wsgi() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi self.callable = self.load() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load return self.load_wsgiapp() File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp return util.import_app(self.app_uri) File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 350, in import_app __import__(module) File "/usr/local/www/haiwen/seafile-server/seahub/seahub/wsgi.py", line 25, in <module> application = get_wsgi_application() File "/usr/local/lib/python3.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application django.setup(set_prefix=False) File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/usr/local/lib/python3.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: bad magic number in 'seahub.group.models': b'\x03\xf3\r\n' Error:Seahub failed to start. Please try to run "./seahub.sh start" again Did you run the upgrade script for 7.0 to 7.1? This should be located in /usr/local/www/haiwen/seafile-server/upgrade/ Ok, I'm not sure how you ended up running into that problem as I have not been able to reproduce. On the Seafile forums there was a bug[1] like this. It looks like something to do with your database is causing problems. In any case, this looks more like a Seafile problem than a port problem. I suggest taking this bug on the Seafile forums. [1] https://forum.seafile.com/t/seafile-server-7-1-0-is-ready-for-testing-migrate-to-python-3/10566/12 Yes i use the migration script. Thanks for the help, i will search on the forum! (In reply to Boris Tassou from comment #8) Hey Boris, Did you ever figure out the issue you were having? Hi, No, i posted on the seafile forum but no one answer so, i reinstalled with mysql support and not sqlite. I made a backup before reinstall so haven't lost anything. I found a solution that works for me: The "ImportError: bad magic number in 'seahub.group.models': b'\x03\xf3\r\n'" error is due to a change in Python when using precompiled files (.pyc). To solve it, one can run find /usr/local/www/haiwen -name "*.pyc" -exec rm -f {} \; See https://stackoverflow.com/questions/52477683/importerror-bad-magic-number-in-time-b-x03-xf3-r-n-in-django . (In reply to Cédric Chevalier from comment #11) This should be managed by the package, but for safe measure in the future, I will add an install and deinstall action of cleaning up these files. Thanks for the tip and the fix! |