AlistGo / AlistGo/alist

Crypt挂载百度网盘路径进行webdav上传时报错

Aperta
#7,742 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Go
Stelle
50.2k
Fork
7.9k
Merge medio
7g 21h
PR unite (30g)
6

Descrizione

### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

- [X] I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。

- [X] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题,而不是其他原因(例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host),`依赖`或`操作`)。

- [X] I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。

### AList Version / AList 版本

v3.41.0

### Driver used / 使用的存储驱动

Crypt

### Describe the bug / 问题描述

使用Crypt驱动,加密后的存储路径是挂载的百度网盘底下的路径。
在使用[cherry-studio](https://github.com/kangfenmao/cherry-studio)软件对数据备份到webdav时报错,上传路径为Crypt驱动路径。
同时用该软件做了以下测试:
上传到百度网盘的路径(未经Crypt加密),可正常上传
上传到Crypt加密的本地存储的路径,可正常上传

只在上传到Crypt加密后的百度网盘路径是报错无法上传

### Reproduction / 复现链接

### Config / 配置

{
"force": false,
"site_url": "",
"cdn": "",
"jwt_secret": "wffpntkKxqHWozbP",
"token_expires_in": 48,
"database": {
"type": "sqlite3",
"host": "",
"port": 0,
"user": "",
"password": "",
"name": "",
"db_file": "C:\\Users\\jglb\\AppData\\Roaming\\ci.nn.alist\\data.db",
"table_prefix": "x_",
"ssl_mode": "",
"dsn": ""
},
"meilisearch": {
"host": "http://localhost:7700",
"api_key": "",
"index_prefix": ""
},
"scheme": {
"address": "0.0.0.0",
"http_port": 5244,
"https_port": -1,
"force_https": false,
"cert_file": "",
"key_file": "",
"unix_file": "",
"unix_file_perm": ""
},
"temp_dir": "C:\\Users\\jglb\\AppData\\Roaming\\ci.nn.alist\\temp",
"bleve_dir": "C:\\Users\\jglb\\AppData\\Roaming\\ci.nn.alist\\bleve",
"dist_dir": "",
"log": {
"enable": true,
"name": "C:\\Users\\jglb\\AppData\\Roaming\\ci.nn.alist\\log\\log.log",
"max_size": 50,
"max_backups": 30,
"max_age": 28,
"compress": false
},
"delayed_start": 0,
"max_connections": 0,
"tls_insecure_skip_verify": true,
"tasks": {
"download": {
"workers": 5,
"max_retry": 1,
"task_persistant": true
},
"transfer": {
"workers": 5,
"max_retry": 2,
"task_persistant": true
},
"upload": {
"workers": 5,
"max_retry": 0,
"task_persistant": false
},
"copy": {
"workers": 5,
"max_retry": 2,
"task_persistant": true
}
},
"cors": {
"allow_origins": [
"*"
],
"allow_methods": [
"*"
],
"allow_headers": [
"*"
]
},
"s3": {
"enable": false,
"port": 5246,
"ssl": false
},
"ftp": {
"enable": false,
"listen": ":5221",
"find_pasv_port_attempts": 50,
"active_transfer_port_non_20": false,
"idle_timeout": 900,
"connection_timeout": 30,
"disable_active_mode": false,
"default_transfer_binary": false,
"enable_active_conn_ip_check": true,
"enable_pasv_conn_ip_check": true
},
"sftp": {
"enable": false,
"listen": ":5222"
}
}

### Logs / 日志

上传到Crypt驱动加密的百度网盘路径报错:
```
[GIN] 2024/12/29 - 20:51:05 | 207 | 1.7610418s | 127.0.0.1 | PROPFIND "/dav/C百度网盘/备份/cherry-studio"
ERRO[2024-12-29 20:51:06] failed put /C百度网盘/备份/cherry-studio: %!w(); CreateTempFile failed, incoming stream actual size= 4506, expect = 47
github.com/alist-org/alist/v3/internal/op.Put
/source/internal/op/fs.go:587
github.com/alist-org/alist/v3/drivers/crypt.(*Crypt).Put
/source/drivers/crypt/driver.go:398
github.com/alist-org/alist/v3/internal/op.Put
/source/internal/op/fs.go:561
github.com/alist-org/alist/v3/internal/fs.putDirectly
/source/internal/fs/put.go:75
github.com/alist-org/alist/v3/internal/fs.PutDirectly
/source/internal/fs/fs.go:97
github.com/alist-org/alist/v3/server/webdav.(*Handler).handlePut
/source/server/webdav/webdav.go:345
github.com/alist-org/alist/v3/server/webdav.(*Handler).ServeHTTP
/source/server/webdav/webdav.go:66
github.com/alist-org/alist/v3/server.ServeWebDAV
/source/server/webdav.go:46
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server.WebDAVAuth
/source/server/webdav.go:113
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
/source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
/usr/local/go/src/net/http/server.go:3210
net/http.(*conn).serve
/usr/local/go/src/net/http/server.go:2092
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1700
github.com/alist-org/alist/v3/internal/op.Put
/source/internal/op/fs.go:587
github.com/alist-org/alist/v3/internal/fs.putDirectly
/source/internal/fs/put.go:75
github.com/alist-org/alist/v3/internal/fs.PutDirectly
/source/internal/fs/fs.go:97
github.com/alist-org/alist/v3/server/webdav.(*Handler).handlePut
/source/server/webdav/webdav.go:345
github.com/alist-org/alist/v3/server/webdav.(*Handler).ServeHTTP
/source/server/webdav/webdav.go:66
github.com/alist-org/alist/v3/server.ServeWebDAV
/source/server/webdav.go:46
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server.WebDAVAuth
/source/server/webdav.go:113
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
/source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
/usr/local/go/src/net/http/server.go:3210
net/http.(*conn).serve
/usr/local/go/src/net/http/server.go:2092
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1700
ERRO[2024-12-29 20:51:06] PUT /dav/C百度网盘/备份/cherry-studio/cherry-studio.backup.zip %!w(); CreateTempFile failed, incoming stream actual size= 4506, expect = 47
github.com/alist-org/alist/v3/internal/op.Put
/source/internal/op/fs.go:587
github.com/alist-org/alist/v3/drivers/crypt.(*Crypt).Put
/source/drivers/crypt/driver.go:398
github.com/alist-org/alist/v3/internal/op.Put
/source/internal/op/fs.go:561
github.com/alist-org/alist/v3/internal/fs.putDirectly
/source/internal/fs/put.go:75
github.com/alist-org/alist/v3/internal/fs.PutDirectly
/source/internal/fs/fs.go:97
github.com/alist-org/alist/v3/server/webdav.(*Handler).handlePut
/source/server/webdav/webdav.go:345
github.com/alist-org/alist/v3/server/webdav.(*Handler).ServeHTTP
/source/server/webdav/webdav.go:66
github.com/alist-org/alist/v3/server.ServeWebDAV
/source/server/webdav.go:46
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server.WebDAVAuth
/source/server/webdav.go:113
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
/source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
/usr/local/go/src/net/http/server.go:3210
net/http.(*conn).serve
/usr/local/go/src/net/http/server.go:2092
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1700
github.com/alist-org/alist/v3/internal/op.Put
/source/internal/op/fs.go:587
github.com/alist-org/alist/v3/internal/fs.putDirectly
/source/internal/fs/put.go:75
github.com/alist-org/alist/v3/internal/fs.PutDirectly
/source/internal/fs/fs.go:97
github.com/alist-org/alist/v3/server/webdav.(*Handler).handlePut
/source/server/webdav/webdav.go:345
github.com/alist-org/alist/v3/server/webdav.(*Handler).ServeHTTP
/source/server/webdav/webdav.go:66
github.com/alist-org/alist/v3/server.ServeWebDAV
/source/server/webdav.go:46
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server.WebDAVAuth
/source/server/webdav.go:113
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
/source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249
github.com/gin-gonic/gin.(*Context).Next
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
/go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
/usr/local/go/src/net/http/server.go:3210
net/http.(*conn).serve
/usr/local/go/src/net/http/server.go:2092
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1700
[GIN] 2024/12/29 - 20:51:06 | 405 | 963.0186ms | 127.0.0.1 | PUT "/dav/C百度网盘/备份/cherry-studio/cherry-studio.backup.zip"
```
其他两个不同存储配置但同软件上传成功:
```
[GIN] 2024/12/29 - 20:53:16 | 207 | 507.4µs | 127.0.0.1 | PROPFIND "/dav/百度网盘/Temp/cherry-studio"
[GIN] 2024/12/29 - 20:53:17 | 201 | 1.0493358s | 127.0.0.1 | PUT "/dav/百度网盘/Temp/cherry-studio/cherry-studio.backup.zip"
```
```
[GIN] 2024/12/29 - 20:56:52 | 207 | 506.2µs | 127.0.0.1 | PROPFIND "/dav/C本地/cherry-studio"
[GIN] 2024/12/29 - 20:56:52 | 201 | 8.4858ms | 127.0.0.1 | PUT "/dav/C本地/cherry-studio/cherry-studio.backup.zip"
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.