root@seafile:/opt/seafile/seafile-server-latest# ./seahub.sh start
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
What can I do to fix this? What am I doing wrong?
The issue was the lack of mysqlclient
installed via pip3. So the instructions should be updated to install
apt-get install libmysqlclient-dev
and then
pip3 install mysqlclient
How did you determine that was the missing dependency? I’m in a similar boat as you with seahub unable to start, I installed all the pip modules from the instructions plus this mysql client but I’m still stuck, I’d love to be able to figure out the problem but I can’t get any log output or more detailed error message. start-fastcgi just gives me Unknown command: 'runfcgi'
.
try pip3 install --timeout=3600 Pillow pylibmc captcha jinja2 sqlalchemy django-pylibmc django-simple-captcha python3-ldap future mysqlclient lxml captcha
If you still get start errors, make sure to run seahub.sh start with your seafile user instead of root to catch any permission problems.
I have never had pip3 on my Debian 10 system. I am running mariadb and getting
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
Error:Seahub failed to start.
even though I have run the following:
apt-get install default-libmysqlclient-dev python-pip3
pip3 --version
pip 18.1 from /usr/lib/python3/dist-packages/pip (python 3.7)
when I run sudo pip3 install future mysqlclient, I get:
error: invalid command ‘bdist_wheel’
Failed building wheel for mysqlclient
Reverting back to 7.1.5 until I have more info on how to potentially resolve this.
Thank you, I was missing the lxml
python dependency. Now it’s working. The frustrating part is that this dependency is (apparently) not documented, and that the error messages when a python dependency is missing are completely opaque.
Edit: Seahub not actually working, my eyes fooled me.
Sorry, although I was in fact missing the lxml
module, installing it didn’t correct my error. I didn’t see the Seahub failed to start
message somehow at first, but when I went to pull up seahub in the browser it didn’t work and when I went back to the terminal I saw that dreaded error message. So I’m back at square one, I can’t start seahub and I have zero error output as to why it won’t work.
Hello, i have the same problem, but I did not understand what to do to correct?
No error found on log : seafile.log :
[01/30/21 12:43:01] socket file exists, delete it anyway
[01/30/21 12:43:01] …/common/seaf-utils.c(328): Use database sqlite
[01/30/21 12:43:01] http-server.c(181): fileserver: worker_threads = 10
[01/30/21 12:43:01] http-server.c(196): fileserver: fixed_block_size = 8388608
[01/30/21 12:43:01] http-server.c(211): fileserver: web_token_expire_time = 3600
[01/30/21 12:43:01] http-server.c(226): fileserver: max_indexing_threads = 1
[01/30/21 12:43:01] http-server.c(241): fileserver: max_index_processing_threads= 3
[01/30/21 12:43:01] http-server.c(263): fileserver: cluster_shared_temp_file_mode = 600
[01/30/2021 12:43:05 PM] start to serve on pipe client
controler.log
[01/30/21 12:43:00] seafile-controller.c(189): starting seaf-server …
[01/30/21 12:43:00] seafile-controller.c(80): spawn_process: seaf-server -F /home/haiwen/conf -c /home/haiwen/ccnet -d /home/haiwen/seafile-data -l /home/haiwen/logs/seafile.log -P /home/haiwen/pids/seaf-server.pid -p /home/haiwen/seafile-server-8.0.2/runtime
[01/30/21 12:43:00] seafile-controller.c(114): spawned seaf-server, pid 356985
bart@FR-Online:~$ uname -a
Linux FR-Online 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Same start issue here. But it’s maybe I already use Debian 9?
Here version of default-libmysqlclient-dev
:
root@canterlot /home/seafile # apt list default-libmysqlclient-dev
Listing... Done
default-libmysqlclient-dev/oldstable,oldstable,now 1.0.2 amd64 [installed]
And here of the pips:
root@canterlot /home/seafile # pip3 list
Package Version
------------------------- -------
altgraph 0.17
asgiref 3.2.10
captcha 0.3
Cython 0.29.21
Django 3.1
django-pylibmc 0.6.1
django-ranged-response 0.2.0
django-simple-captcha 0.5.12
future 0.18.2
Jinja2 2.11.2
lxml 4.6.2
MarkupSafe 1.1.1
mysqlclient 2.0.3
Pillow 7.2.0
pip 21.0.1
pyasn1 0.4.8
pyinstaller 4.0
pyinstaller-hooks-contrib 2020.7
pylibmc 1.6.1
python3-ldap 0.9.8.4
pytz 2020.1
setuptools 40.8.0
six 1.15.0
SQLAlchemy 1.3.18
sqlparse 0.3.1
wheel 0.35.1
Btw. There is no something useful in the logs.
Somehow installing mysqlclient with pip wasn’t enough. The error log was constantly complaining about the wrong mysqlclient version.
return _bootstrap._gcd_import(name[level:], package, level)
File "/opt/seafile/seafile-server-8.0.3/seahub/thirdpart/django/db/backends/mysql/base.py", line 36, in <module>
raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 1.3.10.
The following worked for me, Debian 10.
I actually have had to upgrade mysqlclient
as well.
apt remove -y default-libmysqlclient-dev
apt-get install -y libmariadbclient-dev
pip3 install mysqlclient
pip3 install -U mysqlclient
It would be very nice if the manual would somehow contain working instructions. mysql ist not used on most Debian/Ubuntu systems but mariadb instead. Hence many references need changing.
Thanks - following these I figured that I had some dependencies not installed and sorted it out using the following command:
sudo apt-get install build-essential autoconf libtool pkg-config python3-dev python-dev
I’m trying to update from 7.1.5 to 8.0.4 and also have problems with seahub.
I’ve made sure that libmariadbclient-dev
and mysqlclient
are installed as mentioned in this post, which removed the Error:Seahub failed to start
error.
However, seahub exists just after printing Done
right after it started. Looking at the logfile /opt/haiwen/logs/seahub.log
. I have the following errors:
2021-03-30 18:58:34,429 [ERROR] seahub.api2.authentication:138 authenticate_v2 error when save token v2:
Traceback (most recent call last):
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.7/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.7/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.7/dist-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1665, 'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/haiwen/seafile-server-8.0.4/seahub/seahub/api2/authentication.py", line 136, in authenticate_v2
token.save()
File "/opt/haiwen/seafile-server-8.0.4/seahub/seahub/api2/models.py", line 173, in save
return super(TokenV2, self).save(*args, **kwargs)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/base.py", line 744, in save
force_update=force_update, update_fields=update_fields)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/base.py", line 782, in save_base
force_update, using, update_fields,
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/base.py", line 854, in _save_table
forced_update)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/base.py", line 903, in _do_update
return filtered._update(values) > 0
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/query.py", line 760, in _update
return query.get_compiler(self.db).execute_sql(CURSOR)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/sql/compiler.py", line 1471, in execute_sql
cursor = super().execute_sql(result_type)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/models/sql/compiler.py", line 1142, in execute_sql
cursor.execute(sql, params)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/utils.py", line 76, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/utils.py", line 89, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/opt/haiwen/seafile-server-8.0.4/seahub/thirdpart/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/usr/local/lib/python3.7/dist-packages/MySQLdb/cursors.py", line 206, in execute
res = self._query(query)
File "/usr/local/lib/python3.7/dist-packages/MySQLdb/cursors.py", line 319, in _query
db.query(q)
File "/usr/local/lib/python3.7/dist-packages/MySQLdb/connections.py", line 259, in query
_mysql.connection.query(self, query)
django.db.utils.OperationalError: (1665, 'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.')
To me this seems like a problem related to MySQL/mariadb.
According to this post, this is fixed by setting binlog format to row. So I changed that with the following sql command:
SET GLOBAL binlog_format = 'ROW';
The entry in the logfile goes away, but seahub still restarts just as before.
Any ideas?
Ok, I sorted it out. The problem was that ccnet-server component is removed in v<=8.0.0 and my script shut everything down if not every component was up and running.
Anyways, the sql log error still remains (e.g BINLOG_FORMAT = STATEMENT
causes problems). Should there be something in the upgrade script for that, or is the responsibility of managing sql database up to the user?
It seams that the BINLOG_FORMAT
resets on startup of mariadb server. I now have to set binlog format on every system reboot which is quite odd. imo, seahub should execute SET SESSION binlog_format = 'ROW';
when it connects to mariadb/mysql.
Am I the only one with this problem?