I have a new installation of Seafile 12 (docker) installed and configured, then I want to switch to multiple storage backends, however it seems like seafile doesn’t like my storage classes configuration:
conf/seafile_storage_classes.json:
[{
"storage_id": "local_zfs",
"name": "Local ZFS Storage",
"is_default": true,
"fs": {
"backend": "fs",
"dir": "/shared/seafile/seafile-data"
},
"commits": {
"backend": "fs",
"dir": "/shared/seafile/seafile-data"
},
"blocks": {
"backend": "fs",
"dir": "/shared/seafile/seafile-data"
}
}]
seafile.conf
:
[storage]
enable_storage_classes = true
storage_classes_file = /shared/conf/seafile_storage_classes.json
… then seafile refuses to start:
[2025-05-06 03:29:36] [WARNING] ../common/seaf-utils.c(758): Failed to load json file: /shared/conf/seafile_storage_classes.json
[2025-05-06 03:29:36] [WARNING] seafile-session.c(208): Commits, fs and blocks should use different buckets or pools. Refuse to start server.
[2025-05-06 03:29:36] [WARNING] seaf-server.c(2045): Failed to create seafile session.
I think the documentation was confusing me.
Documentation gave storage_classes_file = /shared/conf/seafile_storage_classes.json
as example, however it should be /shared/seafile/conf/seafile_storage_classes.json
in docker:
root@60e84b7e2045:/opt/seafile# ls -alh /shared
total 10K
drwxr-xr-x 5 root root 5 May 5 01:40 .
drwxr-xr-x 1 root root 138 May 6 03:52 ..
drwxr-xr-x 3 root root 3 May 4 18:55 logs
drwxr-xr-x 3 root root 3 May 4 18:55 nginx
drwxr-xr-x 8 root root 9 May 4 20:59 seafile
root@60e84b7e2045:/opt/seafile# ls -alh /shared/seafile
total 41K
drwxr-xr-x 8 root root 9 May 4 20:59 .
drwxr-xr-x 5 root root 5 May 5 01:40 ..
drwx------ 2 root root 2 May 4 18:55 ccnet
drwx------ 3 root root 9 May 6 03:55 conf
drwxr-xr-x 3 root root 22 May 6 00:07 logs
drwx------ 2 root root 2 May 4 18:55 pro-data
drwx------ 7 root root 8 May 4 19:54 seafile-data
-rwxr-xr-x 1 root root 1.3K May 4 21:01 seafile-license.txt
drwxr-xr-x 5 root root 5 May 4 20:05 seahub-data
root@60e84b7e2045:/opt/seafile# ls -alh /shared/seafile/conf
total 45K
drwx------ 3 root root 9 May 6 03:55 .
drwxr-xr-x 8 root root 9 May 4 20:59 ..
-rw-r--r-- 1 root root 299 May 4 18:55 gunicorn.conf.py
drwxr-xr-x 2 root root 4 May 6 03:52 __pycache__
-rw-r--r-- 1 root root 59 May 4 19:54 seafdav.conf
-rw-r--r-- 1 root root 1011 May 6 02:48 seafevents.conf
-rw-r--r-- 1 root root 822 May 6 03:52 seafile.conf
-rw-r--r-- 1 root root 309 May 6 03:20 seafile_storage_classes.json
-rwx------ 1 root root 2.0K May 6 03:52 seahub_settings.py
Commits, fs and blocks should use different buckets
Hi.
You are using the same dir for the three different buckets. You need three different dirs, one for each.
The documentation suggests otherwise:
If you use file system as storage for fs, commits or blocks, you must explicitly provide the path for the seafile-data directory. The objects will be stored in storage/commits, storage/fs, storage/blocks under this path.
Oh, my apologies.
I was answering by memory, but what I said was for S3, not local file system.
Concerning the path of the file, are you using docker on binary installation?
It’s Docker, and I’ve already figured out the issues. I was giving the wrong path to .json because the documentation was confusing