Seafile server hiccup


#1

I am running seafile server 4.3 on a raspberry pi using nginx. I know, the server version is old now, but you know, never touch a running system… And to be honest, I am not really good at linux etc. and it took me quite a while to get the server running in the first place.

So, today I could not connect anymore, neither from the windows client, nor from a mobile client. The windows error message was “Sorry, but the requested page is unavailable due to a server hiccup. Our engineers have been notified, so check back later.”

Checking the seafile.log was difficult, as the raspberry pi took about half an hour to scroll to the latest entries. The log has increased over the course of the two years I have been running the server to about 250 MB, and the raspberry editor can hardly cope with that.

Anyway, the latest entries are from July 3 to July 5, stating: “http-server.c(1354): Failed to write block 9b1979a4…”.

I don’t quite understand why there has been no error message dating from today.

I’ve just checked the remaining disk space on the SD card. Everything is OK.

So - any ideas how I could continue with my troubleshooting bearing in mind my limited understanding of Linux and the internal workings of the Seafile server?


#2

I stopped seafile and and seahub.

Then I started seafile server with ./seafile.sh start
Done.

I tried to start seahub with ./seahub-sh startfastcgi
Error:Seahub failed to start.


#3

Use tail -f for that.

Try to run seaf-fsck.sh and repair the issues.

Please post the last entries of seahub.log and seahub_django_request.log (of course with tail -f)


#4

Here are the log results:

seahub.log:

Blockquote
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/base.py”, line 546, in save
force_update=force_update, update_fields=update_fields)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/base.py”, line 626, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/query.py”, line 605, in _update
return query.get_compiler(self.db).execute_sql(None)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/sql/compiler.py”, line 1020, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/sql/compiler.py”, line 846, in execute_sql
cursor.execute(sql, params)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/backends/sqlite3/base.py”, line 366, in execute
six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/backends/sqlite3/base.py”, line 362, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: database is locked

seahub_django_request.log:

Blockquote
2018-07-05 17:17:50,020 [ERROR] django.request:210 handle_uncaught_exception Internal Server Error: /api2/avatars/user/xyz@xyz.com/resized/80/
Traceback (most recent call last):
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/core/handlers/base.py”, line 185, in get_response
response = middleware_method(request, response)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/contrib/sessions/middleware.py”, line 38, in process_response
request.session.save()
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/contrib/sessions/backends/db.py”, line 57, in save
obj.save(force_insert=must_create, using=using)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/base.py”, line 546, in save
force_update=force_update, update_fields=update_fields)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/base.py”, line 626, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File “/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/models/query.py”, line 605, in _update
return query.get_compiler(self.db).execute_sql(None)
File "/home/seafile/seafile-server-4.3.0/seahub/thirdpart/Django-1.5.12-py2.7.egg/django/db/model


#5

I have run seaf-fsck.sh: no errors, nothing corrupted!


#6

The user where seafile is running has no permission to acces the seafile databes. You should change the owner of them. Are you using SQLite or MariaDB?


#7

I am using SQLite.

Strange, I haven’t changed any permissions. All of a sudden, I could not access the server anymore. I wonder what happened…

By the way: thanks a lot for your help, very appreciated indeed!


#8

Can you show me the outptut of ls -l in your SQLite folder?


#9

Sorry if I appear a bit clueless… I set up the server following some step by step instructions that I had to modify a bit. That was more than two years ago. The details are a bit hazy now for me.

When I check the instructions I used, the only reference to SQL is the initial command “sudo apt-get install sqlite3”, so I assume that my server uses sqlite. However, when I ceck the directories, I only find two folders related to sql in the seafile-server-latest folder (I hope that is the right one): setup-seafile-mysql.py and setup-seafile-mysql.sh

When I check the official guide here: https://manual.seafile.com/deploy/using_sqlite.html
I cannot see any sqlite folder. Where is that supposed to be?