I am currently in the process of setting up seafile. I first tried it without an external disk, this worked perfectly. Next I tried to use an external hard drive as storage but I could not get this to work.
My config looks like this:
services.seafile = {
...
dataDir = "/datadisk/seafile";
...
};
systemd.tmpfiles.rules = [
"d /datadisk/seafile 0777 seafile seafile"
];
fileSystems."/datadisk" = {
device = "/dev/disk/by-label/datadisk";
options = [ "nofail" ];
};
Trying to rebuild gives an error:
warning: the following units failed: seaf-server.service
× seaf-server.service - Seafile server
Loaded: loaded (/etc/systemd/system/seaf-server.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Sun 2024-12-01 21:56:54 CET; 432ms ago
Duration: 145ms
Invocation: 3f93bb69c949416f8e7e8f51285c6797
Process: 12058 ExecStartPre=/nix/store/ywk2ksfvw0yzv42mr087jyr5r175567i-unit-script-seaf-server-pre-start/bin/seaf-server-pre-start (code=exited, status=0/SUCCESS)
Process: 12098 ExecStart=/nix/store/wzv6g40sc1r7pypcw7753znm1wc7a7d2-seafile-server-11.0.12/bin/seaf-server --foreground -F /etc/seafile -c /var/lib/seafile/ccnet -d /datadisk/seafile -l /var/log/seafile/server.log -P /run/seafile/server.pid -p /run/seafile (code=exited, status=1/FAILURE)
Main PID: 12098 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
IO: 0B read, 0B written
Mem peak: 2.6M
CPU: 265ms
Dec 01 21:56:53 nixospi systemd[1]: Starting Seafile server...
Dec 01 21:56:54 nixospi systemd[1]: seaf-server.service: multiple trigger source candidates for exit status propagation (seaf-gc.service, seaf-gc.service), skipping.
Dec 01 21:56:54 nixospi systemd[1]: Started Seafile server.
Dec 01 21:56:54 nixospi systemd[1]: seaf-server.service: Main process exited, code=exited, status=1/FAILURE
Dec 01 21:56:54 nixospi systemd[1]: seaf-server.service: Failed with result 'exit-code'.
warning: error(s) occurred while switching to the new configuration
Looking at the seafile server log:
$ tail -4 /var/log/seafile/server.log
2024-12-01 21:45:57 seafile-session.c(134): Config dir /datadisk/seafile does not exist and is unable to create
2024-12-01 21:45:57 seaf-server.c(1335): Failed to create seafile session.
2024-12-01 21:56:54 seafile-session.c(134): Config dir /datadisk/seafile does not exist and is unable to create
2024-12-01 21:56:54 seaf-server.c(1335): Failed to create seafile session.
This is an odd error as the directory /datadisk/seafile does exist.
$ ls -l /datadisk
total 4
drwxrwxrwx 2 seafile seafile 4096 Dec 1 21:45 seafile
Changing the path to a random home directory seems to have the same result.
Anybody have an idea what is happening here? Help would be greatly appreciated.