Seafile service becomes inactive/dead every few hours

The service starts off just fine

seafile.service - Seafile
Loaded: loaded (/etc/systemd/system/seafile.service; enabled)
Active: active (exited) since Sun 2017-03-26 19:16:17 UTC; 2min 18s ago
Process: 24430 ExecStop=/home/seafile/haiwen/seafile-server-latest/seafile.sh stop (code=exited, status=0/SUCCESS)
Process: 26425 ExecStart=/home/seafile/haiwen/seafile-server-latest/seafile.sh start (code=exited, status=0/SUCCESS)
Main PID: 26425 (code=exited, status=0/SUCCESS)

After a few hours this is output of service status:

 $ service seafile status
 seafile.service - Seafile
 Loaded: loaded (/etc/systemd/system/seafile.service; enabled)
 Active: inactive (dead) since Sun 2017-03-26 17:20:41 UTC; 1h 54min ago
 Process: 24430 ExecStop=/home/seafile/haiwen/seafile-server-latest/seafile.sh stop (code=exited, status=0/SUCCESS)
 Process: 24278 ExecStart=/home/seafile/haiwen/seafile-server-latest/seafile.sh start (code=exited, status=0/SUCCESS)
 Main PID: 24278 (code=exited, status=0/SUCCESS)

I’m using systemd services to start at boot and works fine. My services are configured as follows:

[Unit]
Description=Seafile
# add mysql.service or postgresql.service depending on your database to the line below
After=network.target mysql.service
RequiresMountsFor=/mnt/iomegahdd

[Service]
Type=oneshot
ExecStart=/home/seafile/haiwen/seafile-server-latest/seafile.sh start
ExecStop=/home/seafile/haiwen/seafile-server-latest/seafile.sh stop
RemainAfterExit=yes
User=seafile
Group=seafile

[Install]
WantedBy=multi-user.target

Seahub:

[Unit]
Description=Seafile hub
After=network.target seafile.service

[Service]
# change start to start-fastcgi if you want to run fastcgi
ExecStart=/home/seafile/haiwen/seafile-server-latest/seahub.sh start-fastcgi
ExecStop=/home/seafile/haiwen/seafile-server-latest/seahub.sh stop
User=seafile
Group=seafile
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Anyone know why it keeps stopping every few hours? The sync stops working but Seahub service keeps on running. I’m using seafile with mysql and nginx on a raspberry pi using raspbian.

1 Like

I think you should use Seafile Server version 6.0.8 for Raspberry Pi, with raspbian I think there must be a problem with raspberry RAM (it takes at least 2 GB of RAM on a standard installation). The seafile server version for raspberry is optimized for this lack of RAM memory.
Check the kern.log file in /var/log to see if this is a memory problem.

Thanks for your reply but that’s the version I’m using.

/home/seafile/haiwen $ ls
ccnet  installed  pids                  seafile-server-latest
conf   logs       seafile-server-6.0.8  seahub-data

it’s a raspberry pi3?
Check the kernel.log, the error should be saved on

Yes it’s a raspberry pi 3

Here’s the log from around the time the service went dead

Mar 26 13:54:28 raspberrypi kernel: [144938.487462] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:70:f1:96:84:8b:20:08:00:45:28:00:2c:37:bb:00:00:2d:$
Mar 26 17:12:37 raspberrypi kernel: [156827.756894] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:70:f1:96:84:8b:20:08:00:45:00:00:28:af:34:00:00:f6:$
Mar 26 17:18:05 raspberrypi kernel: [157155.559224] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:98:d6:f7:90:c7:0a:08:00:45:00:00:34:29:41:40:00:40:$
Mar 26 17:18:06 raspberrypi kernel: [157156.306380] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:98:d6:f7:90:c7:0a:08:00:45:00:00:34:8f:55:40:00:40:$
Mar 26 17:18:12 raspberrypi kernel: [157162.927476] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:98:d6:f7:90:c7:0a:08:00:45:00:00:34:29:42:40:00:40:$
Mar 26 17:18:13 raspberrypi kernel: [157163.365701] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:98:d6:f7:90:c7:0a:08:00:45:00:00:34:8f:56:40:00:40:$
Mar 26 17:18:27 raspberrypi kernel: [157177.686072] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:98:d6:f7:90:c7:0a:08:00:45:00:00:34:29:43:40:00:40:$
Mar 26 17:18:57 raspberrypi kernel: [157207.163647] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:98:d6:f7:90:c7:0a:08:00:45:00:00:34:29:44:40:00:40:$
Mar 26 17:20:40 raspberrypi kernel: [157310.970660] usb 1-1.4: USB disconnect, device number 5
Mar 26 17:20:41 raspberrypi kernel: [157311.250149] usb 1-1.4: new high-speed USB device number 6 using dwc_otg
Mar 26 17:20:41 raspberrypi kernel: [157311.351118] usb 1-1.4: New USB device found, idVendor=059b, idProduct=0475
Mar 26 17:20:41 raspberrypi kernel: [157311.351133] usb 1-1.4: New USB device strings: Mfr=10, Product=11, SerialNumber=5
Mar 26 17:20:41 raspberrypi kernel: [157311.351140] usb 1-1.4: Product: USB to ATA/ATAPI bridge
Mar 26 17:20:41 raspberrypi kernel: [157311.351146] usb 1-1.4: Manufacturer: Iomega
Mar 26 17:20:41 raspberrypi kernel: [157311.351152] usb 1-1.4: SerialNumber: 159B820946FF
Mar 26 17:20:41 raspberrypi kernel: [157311.352075] usb-storage 1-1.4:1.0: USB Mass Storage device detected
Mar 26 17:20:41 raspberrypi kernel: [157311.352417] scsi host2: usb-storage 1-1.4:1.0
Mar 26 17:20:42 raspberrypi kernel: [157312.350671] scsi 2:0:0:0: Direct-Access     SAMSUNG  HD103SI               PQ: 0 ANSI: 2 CCS
Mar 26 17:20:42 raspberrypi kernel: [157312.351472] sd 2:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
Mar 26 17:20:42 raspberrypi kernel: [157312.351585] sd 2:0:0:0: Attached scsi generic sg0 type 0
Mar 26 17:20:42 raspberrypi kernel: [157312.351808] sd 2:0:0:0: [sda] Write Protect is off
Mar 26 17:20:42 raspberrypi kernel: [157312.351585] sd 2:0:0:0: Attached scsi generic sg0 type 0
Mar 26 17:20:42 raspberrypi kernel: [157312.351808] sd 2:0:0:0: [sda] Write Protect is off
Mar 26 17:20:42 raspberrypi kernel: [157312.351818] sd 2:0:0:0: [sda] Mode Sense: 28 00 00 00
Mar 26 17:20:42 raspberrypi kernel: [157312.352080] sd 2:0:0:0: [sda] No Caching mode page found
Mar 26 17:20:42 raspberrypi kernel: [157312.352088] sd 2:0:0:0: [sda] Assuming drive cache: write through
Mar 26 17:20:42 raspberrypi kernel: [157312.355577]  sda: sda1
Mar 26 17:20:42 raspberrypi kernel: [157312.357088] sd 2:0:0:0: [sda] Attached SCSI disk
Mar 26 17:29:15 raspberrypi kernel: [157825.855301] usb 1-1.4: USB disconnect, device number 6
Mar 26 17:29:15 raspberrypi kernel: [157825.916778] Buffer I/O error on dev sda1, logical block 14, async page read
Mar 26 17:29:16 raspberrypi kernel: [157826.148741] usb 1-1.4: new high-speed USB device number 7 using dwc_otg
Mar 26 17:29:16 raspberrypi kernel: [157826.269904] usb 1-1.4: New USB device found, idVendor=059b, idProduct=0475
Mar 26 17:29:16 raspberrypi kernel: [157826.269939] usb 1-1.4: New USB device strings: Mfr=10, Product=11, SerialNumber=5
Mar 26 17:29:16 raspberrypi kernel: [157826.269953] usb 1-1.4: Product: USB to ATA/ATAPI bridge
Mar 26 17:29:16 raspberrypi kernel: [157826.269966] usb 1-1.4: Manufacturer: Iomega
Mar 26 17:29:16 raspberrypi kernel: [157826.269978] usb 1-1.4: SerialNumber: 159B820946FF
Mar 26 17:29:16 raspberrypi kernel: [157826.271308] usb-storage 1-1.4:1.0: USB Mass Storage device detected
Mar 26 17:29:16 raspberrypi kernel: [157826.271623] scsi host3: usb-storage 1-1.4:1.0
Mar 26 17:29:17 raspberrypi kernel: [157827.269580] scsi 3:0:0:0: Direct-Access     SAMSUNG  HD103SI               PQ: 0 ANSI: 2 CCS
Mar 26 17:29:17 raspberrypi kernel: [157827.270846] sd 3:0:0:0: Attached scsi generic sg0 type 0
Mar 26 17:29:17 raspberrypi kernel: [157827.271718] sd 3:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
Mar 26 17:29:17 raspberrypi kernel: [157827.272338] sd 3:0:0:0: [sda] Write Protect is off
Mar 26 17:29:17 raspberrypi kernel: [157827.272363] sd 3:0:0:0: [sda] Mode Sense: 28 00 00 00
Mar 26 17:29:17 raspberrypi kernel: [157827.272789] sd 3:0:0:0: [sda] No Caching mode page found
Mar 26 17:29:17 raspberrypi kernel: [157827.272807] sd 3:0:0:0: [sda] Assuming drive cache: write through
Mar 26 17:29:17 raspberrypi kernel: [157827.282012]  sda: sda1
Mar 26 17:29:17 raspberrypi kernel: [157827.284220] sd 3:0:0:0: [sda] Attached SCSI disk
Mar 26 18:44:15 raspberrypi kernel: [162325.152101] [UFW BLOCK] IN=eth0 OUT= MAC=b8:27:eb:70:f8:c6:70:f1:96:84:8b:20:08:00:45:00:00:28:d4:31:00:00:f7

I do not see the error, can you put the complete file in download with a link or other

Pastebin didn’t work as the file was too long. I upload it to this site - https://filetea.me/n3wjeS3pZwAQDyfwNqI2UaRFw

Link :https://filetea.me/n3wjeS3pZwAQDyfwNqI2UaRFw
HTTP ERROR 404

Send me the file to this address instead.
https://seafile.okki.me/u/d/ca8faae1f9/

1 Like

I have uploaded my kern.log

Ok, I’ll watch this

I did not find a crash error, you can send the seafile log to the same address.
/folder-seafile/logs

1 Like

I have uploaded my logs folder :slight_smile:

I have not found the cause of your problem.
I put a link of your log files, if someone else wants to look at your configuration to find your problem.
https://seafile.okki.me/d/d8f294b9d4/

Just a quick idea for your problem. The kern.log shows that your usb-disk is disconnecting and reconnecting 2 times with a “Buffer I/O error on dev sda1”. If you did not disconnect and reconnect the disk without unmounting it, this looks like a problem with your usb-disk/usb-ata bridge or the power supply of it.

1 Like

I also think this is the issue. It could also be a bad usb controller, but I’d check the power first as well.

Thanks for looking guys! Sounds like my external HDD is failing. Taking a long time on my windows pc running a chkdsk.

you are using a windows file system on a linux server box??? :scream: :confounded:

just joking, hop you find the defekt.

Yeah I was! Switched over to a 32gb USB stick now formatted using ext4. So far, it’s running good.

1 Like