juicedata / juicefs

JuiceFS is a distributed POSIX file system built on top of Redis and S3.
https://juicefs.com
Apache License 2.0
10.9k stars 964 forks source link

Cannot read data in Windows 10 (I/O error) in 1.2.1 #5220

Closed happyc0ding closed 1 month ago

happyc0ding commented 1 month ago

What happened: Writing data to the drive works without problems, reading data always gives an I/O error. Accessing the data via Linux works. After downgrading to juicefs version 1.1.4+2024-08-30.fc080fd everything works as expected.

What you expected to happen: Reading data also works with Windows 10.

How to reproduce it (as minimally and precisely as possible):

juicefs.exe format --storage s3 --bucket http://1.2.3.4:9000/jfs --access-key test --secret-key testtest "mysql://root:foobar@(1.2.3.4:3306)/jfs" stuff
2024/10/10 12:02:46.699462 juicefs[6524] <INFO>: Meta address: mysql://root:****@(1.2.3.4:3306)/jfs [interface.go:504]
2024/10/10 12:02:46.706120 juicefs[6524] <INFO>: Data use s3://jfs/stuff/ [format.go:484]
2024/10/10 12:02:46.776058 juicefs[6524] <INFO>: Volume is formatted as {
  "Name": "stuff",
  "UUID": "e65bd6f5-2977-4241-9ce5-56cecf52de4d",
  "Storage": "s3",
  "Bucket": "http://1.2.3.4:9000/jfs",
  "AccessKey": "test",
  "SecretKey": "removed",
  "BlockSize": 4096,
  "Compression": "none",
  "EncryptAlgo": "aes256gcm-rsa",
  "KeyEncrypted": true,
  "TrashDays": 1,
  "MetaVersion": 1,
  "MinClientVersion": "1.1.0-A",
  "DirStats": true,
  "EnableACL": false
} [format.go:521]
juicefs.exe mount --debug "mysql://root:foobar@(1.2.3.4:3306)/jfs" F:
2024/10/10 12:04:35.515866 juicefs[8600] <DEBUG>: maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined [maxprocs.go:47]
2024/10/10 12:04:35.516402 juicefs[8600] <DEBUG>: Debug agent listening on 127.0.0.1:6060 [main.go:321]
2024/10/10 12:04:35.516402 juicefs[8600] <INFO>: Meta address: mysql://root:****@(1.2.3.4:3306)/jfs [interface.go:504]
[xorm] [info]  2024/10/10 12:04:35.518516 PING DATABASE mysql
2024/10/10 12:04:35.524335 juicefs[8600] <DEBUG>: Creating s3 storage at endpoint http://1.2.3.4:9000/jfs [object_storage.go:167]
2024/10/10 12:04:35.524878 juicefs[8600] <INFO>: Data use s3://jfs/stuff/ [mount.go:629]
2024/10/10 12:04:35.524878 juicefs[8600] <INFO>: JuiceFS version 1.2.1+2024-08-30.cd871d1 [mount.go:659]
2024/10/10 12:04:35.525949 juicefs[8600] <INFO>: Disk cache (C:\Users\xxx\.juicefs\cache\e65bd6f5-2977-4241-9ce5-56cecf52de4d\): capacity (100 GiB), free ratio 10%, used ratio - [space 64.7%, inode 0%], max pending pages 15 [disk_cache.go:144]
2024/10/10 12:04:35.526483 juicefs[8600] <DEBUG>: Scan C:\Users\xxx\.juicefs\cache\e65bd6f5-2977-4241-9ce5-56cecf52de4d\raw to find cached blocks [disk_cache.go:865]
2024/10/10 12:04:35.526483 juicefs[8600] <DEBUG>: Scan C:\Users\xxx\.juicefs\cache\e65bd6f5-2977-4241-9ce5-56cecf52de4d\rawstaging to find staging blocks [disk_cache.go:912]
2024/10/10 12:04:35.536075 juicefs[8600] <DEBUG>: Found 3201 cached blocks (8.9 GiB) in C:\Users\xxx\.juicefs\cache\e65bd6f5-2977-4241-9ce5-56cecf52de4d\ with 9.5918ms [disk_cache.go:897]
2024/10/10 12:04:35.548552 juicefs[8600] <INFO>: Create session 5 OK with version: 1.2.1+2024-08-30.cd871d1 [base.go:398]
2024/10/10 12:04:35.554464 juicefs[8600] <INFO>: Prometheus metrics listening on 127.0.0.1:9567 [mount.go:135]
2024/10/10 12:04:35.555000 juicefs[8600] <DEBUG>: mount point: F:, options: volname=stuff,ExactFileSystemName=JuiceFS,create_umask=022,ThreadCount=16,DirInfoTimeout=1000,VolumeInfoTimeout=1000,KeepFileCache,FileInfoTimeout=100,VolumePrefix=/juicefs/stuff [winfs.go:600]
The service juicefs has been started.

(no further debug output here while trying to read the file)

PS E:\> type .\test.txt
some content
PS E:\> cp .\test.txt f:
PS E:\> f:
PS f:\> type .\test.txt
type : The request could not be performed because of an I/O device error.
At line:1 char:1
+ type .\test.txt
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : ReadError: (f:\test.txt:String) [Get-Content], IOException
    + FullyQualifiedErrorId : GetContentReaderIOError,Microsoft.PowerShell.Commands.GetContentCommand

(Trying to copy the file via explorer or opening it with an editor also results in I/O errors)

Environment:

zhijian-pro commented 1 month ago

@happyc0ding It has been fixed by #5126, but it is not yet released. You need to manually compile the main branch to use it