Failed to add commit, rename fail

When I upload a file, the sync fails. The error information is shown in fileserver.log:

but downloading files works properly.

I’m currently running seaf-fsck.sh --repair, but I’m not sure if it will fix the problem.

seafile version :13.0.18

The error “Failed to add commit, rename fail” in fileserver.log typically indicates that the Seafile fileserver is unable to move a temporary commit file to its final destination in the storage backend. Since downloading works, your read access is functional, but write/rename operations are failing.

Running seaf-fsck.sh --repair is a good practice to ensure repository integrity, but it may not solve this specific error if it is caused by system-level issues.

Please check the following on your server:

  1. Disk Space and Inodes: Ensure the partition where your seafile-data is stored is not full.
    • Check space: df -h
    • Check inodes: df -i
  2. Permissions: Verify that the user running the Seafile process has full write and ownership permissions for the seafile-data directory and all its subdirectories.
    • A common fix is: chown -R seafile:seafile /path/to/seafile-data (replace seafile:seafile with your actual user and group).
  3. Filesystem Status: Check if the filesystem has been remounted as read-only due to an error. You can check this by running mount or looking at dmesg output.
  4. Storage Backend: Are you using local storage, or is your seafile-data on a network share (NFS, SMB) or object storage (S3, Ceph)? If it’s a network share, there might be a latency or locking issue.

I’m using a NAS storage system.

and I executed seaf-fsck.sh --repair, the NAS mount point became unresponsive. for example: running the ls command inside the mounted directory would just hang.

after I reboot system, the NAS mount point returned to normal.

I’m now trying to run the seaf-fsck.sh --repair command for the second time.

Why does this happen?

The behavior you’re seeing (the NAS mount point hanging) is likely caused by the extreme I/O intensity of the seaf-fsck.sh process. When running against network-attached storage, the script’s attempt to read and verify every block and commit file can saturate the network or overwhelm the NAS’s I/O capabilities, leading to high I/O wait times and an unresponsive mount.

Regarding your original “Failed to add commit, rename fail” error and the current FSCK issues, please check the following:

  1. NFS Export Permissions: If you are using NFS, ensure that your NAS export configuration includes the no_root_squash option. Without this, Seafile (which often performs operations as root or a specific user) may be remapped to an unprivileged account like nobody, which lacks the permissions to perform the rename/write operations required for commits.
  2. Stop Seafile First: Ensure that the Seafile server is completely stopped before you start seaf-fsck.sh. Running them simultaneously on a NAS will cause severe performance degradation and potential lock-ups.
  3. Run FSCK on Individual Libraries: Instead of running a full repair on the entire data directory, try running it on one library at a time to reduce the I/O load. You can do this by passing the Library ID (Repo ID) as an argument:
    ./seaf-fsck.sh --repair [Library-ID]
  4. Check System Logs: While the mount is hanging, check dmesg or /var/log/syslog on the Seafile server for messages like NFS: server X not responding, still trying. This confirms the network/storage bottleneck.

How much space is left on the filesystem on which your data are stored?