Seahub.sh doesn't start with wsgi - pro server

Hi,

I’m testing the upgrade from 6.0.4 to 6.2.9 (Professional server).

Using fastcgi everything work good, but when I switch to WSGI mode seahub.sh fails to start if thrown from the root account.

Seafile is running on an Ubuntu 14.04 without memcached.

I had to change the init script as follows, in order to make it works:
sudo -i -u ${user} ${script_path}/seahub.sh start >> ${seahub_init_log}

Adding the -i option to sudo I could workaround the issue, but I’d rather fix it.

This is the scenario:

  • root~# /etc/init.d/seafile start - seafile.sh run and seahub.sh fails to start
  • root~# sudo -u user /home/user/seafile/seafile-server-latest/seahub.sh start - it fails after the pgrep -f seahub.wsgi:application
  • Rebooting the server gunicorn is launched correctly, if I restart the service it fails
  • user~# /home/user/seafile/seafile-server-latest/seahub.sh start - it works
  • Adding the -i option at sudo it works.

What I did so far that didn’t work:

  • I checked for permissions issues on the seafile folder, running chown -cR
  • I debugged gunicorn using --log-level debug, but I can’t find anything relevant
  • I debugged gunicorn using the pdb -m option at the python execution line in seahub.sh script
  • I deleted cache and logs in the runtime folder
  • I checked in the forum for similar issues

Any ideas?
Thanks

P.S. the package with the “_Ubuntu.tar.gz” suffix when it should be used? I tried both, same result.

Did you check the init.d script? It likely starts Seafile with fastcgi enabled.

The option fastcgi is set to false and Seafile starts with wsgi.

This is where it gets stuck, it doesn’t start the python processes and bind the port 8000.

python2.7 /home/user/seafile/seafile-pro-server-6.2.9/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/user/seafile/seafile-pro-server-.2.9/runtime/seahub.conf -b 0.0.0.0:8000 --preload

And does it find python2.7?

Also it looks like this path is wrong: /seafile-pro-server-.2.9/ (only an excerpt from above)

My bad, removing the spaces I deleted the 6 as well, this is the correct command:

python2.7 /home/user/seafile/seafile-pro-server-6.2.9/seahub/thirdpart/gunicorn seahub.wsgi:application -c /home/user/seafile/seafile-pro-server-6.2.9/runtime/seahub.conf -b 0.0.0.0:8000 --preload

It does find python2.7, otherwise the seahub.sh script would get stuck calling function check_python_executable()

I can’t find the solution, so as workaround I will use the -i sudo’s parameter.

However, when the package with the “_Ubuntu.tar.gz” suffix should be used?

Thanks