FSCK - Fail to read block

When I run the fsck commands, I have several issues:

[01/12/17 08:49:43] fsck.c(586): Running fsck for repo 3b877768-8352-4754-9c8f-4c5fb5cbe4df.
[01/12/17 08:49:43] fsck.c(413): Checking file system integrity of repo SEC101(3b877768)…
[01/12/17 08:50:28] …/…/common/block-mgr.c(241): Failed to read block 3b877768-8352-4754-9c8f-4c5fb5cbe4df:96a6fd5f.
[01/12/17 08:50:28] fsck.c(650): Fsck finished for repo 3b87776

How can I repair my library ? Furthermore, I can no longer download the library.

I am using the server community edition 6.0.3. Let me know if you need more information.

Sincerely,

Can you check if you can access / or find the block in the library folder on the server? And check if the permissons are correct. You could also run fsck with repair command but then you may lose data if you have no backup on the clients for example. For further information please have a look at: https://manual.seafile.com/maintain/seafile_fsck.html

I do not see anything particular with the permissions. Everything is set on root user:
drwxr-xr-x. 1 root root 1,0K 31 déc. 00:09 3b877768-8352-4754-9c8f-4c5fb5cbe4df

I am running the seafile server with docker. It seems I have some corrupted files in the library.

I am getting scared to loose a lot of data :(.

You don’t need to worry. Run the repair command will restore the library to its latest usable state. Then you can re-sync with the latest files on your client. If you have some new files change in your client, they’ll be merged into the library. And this will fix your corrupted data if you have a good copy on your client.

I cant not run the repair. I have the same error :(.

root@a19611283d19:/opt/seafile/seafile-server-latest# ./seaf-fsck.sh --repair 88ac2159-ffeb-4deb-b74d-6467552ee4d8

Starting seaf-fsck, please wait …

[01/13/17 06:59:05] fsck.c(586): Running fsck for repo 88ac2159-ffeb-4deb-b74d-6467552ee4d8.
[01/13/17 06:59:05] fsck.c(413): Checking file system integrity of repo ISO(88ac2159)…
[01/13/17 06:59:07] …/…/common/block-mgr.c(241): Failed to read block 88ac2159-ffeb-4deb-b74d-6467552ee4d8:f20da87e.
[01/13/17 06:59:07] fsck.c(650): Fsck finished for repo 88ac2159.

seaf-fsck run done

Well it seems the corresponding blocks are corrupted. I am using brtfs for my filesystem and the raid1 (on 2 different disks):

sudo btrfs scrub status /mnt

scrub status for 89f6f57e-90d9-46ac-1132-144e6ac150e4
scrub started at Sat Jan 14 17:09:36 2017 and finished after 2207 seconds
total bytes scrubbed: 598.03GiB with 114 errors
error details: csum=114
corrected errors: 0, uncorrectable errors: 114, unverified errors: 0

if I look, at the dmesg log:

[ 2057.848187] BTRFS: bdev /dev/sde1 errs: wr 0, rd 0, flush 0, corrupt 74, gen 0
[ 2057.856969] BTRFS: unable to fixup (regular) error at logical 419868372992 on dev /dev/sde1
[ 2107.629521] BTRFS: checksum error at logical 437165137920 on dev /dev/sdd1, sector 495225168, root 5, inode 960374, offset 172032, length 4096, links 1 (path: seafile-data/storage/blocks/bd71e3e1-95bd-40fc-b6db-55c4ea9467c1/9c/ea16371a5b96b8bd93740363ee1ac24b70b736)

And if I try to access the file I get an input / output error.

It seems I can not recover any of the data, because the blocks are corrupted on both on my disk. So the question is why ? And how this could happen ?

Maybe you had a power outage or the server crashed? btrfs is currently not the most stable file system because it’s very new and may can contain bugs. You want to have a look at: Manpage/btrfs-check - btrfs Wiki

Raid does not help you if the filesystem is corrupted in most cases because the raid controller just writes the corrupted blocks onto the second hdd. Remember: raid is not a backup.

Btw: Is it Software or Hardware Raid?

It is hardware raid. Here is my Raid1 configuration:

sudo btrfs fi df /mnt

Data, RAID1: total=299.00GiB, used=298.15GiB
Data, single: total=8.00MiB, used=0.00B
System, RAID1: total=8.00MiB, used=64.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, RAID1: total=2.00GiB, used=887.55MiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=304.00MiB, used=0.00B

sudo btrfs fi us /mnt

Overall:
Device size: 5.46TiB
Device allocated: 602.04GiB
Device unallocated: 4.87TiB
Device missing: 0.00B
Used: 598.04GiB
Free (estimated): 2.44TiB (min: 2.44TiB)
Data ratio: 2.00
Metadata ratio: 2.00
Global reserve: 304.00MiB (used: 0.00B)

Data,single: Size:8.00MiB, Used:0.00B
/dev/sdd1 8.00MiB

Data,RAID1: Size:299.00GiB, Used:298.15GiB
/dev/sdd1 299.00GiB
/dev/sde1 299.00GiB

Metadata,single: Size:8.00MiB, Used:0.00B
/dev/sdd1 8.00MiB

Metadata,RAID1: Size:2.00GiB, Used:887.55MiB
/dev/sdd1 2.00GiB
/dev/sde1 2.00GiB

System,single: Size:4.00MiB, Used:0.00B
/dev/sdd1 4.00MiB

System,RAID1: Size:8.00MiB, Used:64.00KiB
/dev/sdd1 8.00MiB
/dev/sde1 8.00MiB

Unallocated:
/dev/sdd1 2.43TiB
/dev/sde1 2.43TiB