Cloudreve
Cloudreve copied to clipboard
Backblaze无法上传
Describe the bug Backblaze的s3 无法完成上传,上传队列显示 请求失败: Error: Network Error
- 按向导添加b2为s3存储
- 上传文件即失败
- 手动复制队列的链接到浏览器,显示 :
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>Signature validation failed</Message>
</Error>
版本
___ _ _
/ __\ | ___ _ _ __| |_ __ _____ _____
/ / | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \
/ /___| | (_) | |_| | (_| | | | __/\ V / __/
\____/|_|\___/ \__,_|\__,_|_| \___| \_/ \___|
V3.5.3 Commit #299dda1 Pro=true
到Backblaze后台可见文件路径已经创建,而且文件也创建了,只是大小为0kb.
能否提供下测试站点呢?
能否提供下测试站点呢?
一组B2的API key够吗?
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。
我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个
<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为undefined
导致的
我看B2给的示例是这个格式
<?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUpload>
<Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part>
<Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part>
<Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part>
<Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part>
</CompleteMultipartUpload>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。
我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个
<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为
undefined
导致的 我看B2给的示例是这个格式<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part> <Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part> <Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part> <Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part> </CompleteMultipartUpload>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
完美解决。 多谢多谢。
np,我也去试试
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。
我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个
<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为
undefined
导致的 我看B2给的示例是这个格式<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part> <Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part> <Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part> <Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part> </CompleteMultipartUpload>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
大佬牛逼,完美解决了
再请教下 Private 的 Bucket 还可以用 Cloudflare 反代吗,我这边用 Workers 反代还是会报 SignatureDoesNotMatch 错误
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。
我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个
<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为
undefined
导致的 我看B2给的示例是这个格式<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part> <Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part> <Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part> <Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part> </CompleteMultipartUpload>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
现在好像删除也会有点问题 删除文件的时候右上角会提示 Failed to delete 1 file(s).
版本号3.6.2
Object里面看回显是 {"code":203,"msg":"Failed to delete 1 file(s)."}
https://example.com/api/v3/object DELETE
先感謝上面大佬分享的CORS指令,目前成功設置b2了😆
我的Cloudreve設定長這樣
因為個人有用Cloudflare CDN,且隱藏bucket,我選擇允許公共讀取及主機名優先。在b2建立bucket時,也是選擇public 。
註1:Endpoint 如果按照文檔設置會導致在bucket主目錄下生成以bucket命名的資料夾
註2:即使跨域策略無法透過Cloudreve設置,後續也可以正常使用
可以成功上傳並在bucket內看得到,不過斷點續傳似乎有點問題,不知道是不是因為在設置儲存策略時,跨域策略無法透過Cloudreve設置的原因。
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":[""],"allowedHeaders":[""],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。
我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个
<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为
undefined
导致的 我看B2给的示例是这个格式<Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part>
<Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part>
<Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part>
<Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
大佬牛逼,完美解决了
再请教下 Private 的 Bucket 还可以用 Cloudflare 反代吗,我这边用 Workers 反代还是会报 SignatureDoesNotMatch 错误
https://gist.github.com/lzjluzijie/3f1294f47755972f9bcd68f90ffc0b73看看這是否有幫助
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。
我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个
<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为
undefined
导致的 我看B2给的示例是这个格式<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part> <Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part> <Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part> <Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part> </CompleteMultipartUpload>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
这个CORS命令我在b2-windows上遇到了invalid loads value
的错误(PowerShell或CMD均会报错),但是在Linux环境下该命令一切正常。
如果有人也遇到了这个问题,请改用Linux环境。
我之前也遇到过这个问题,大概是因为用的master application key的原因,后来新建了一个application key就好了。 CORS设置不对也会出现文件创建0kb然后上传失败的情况,需要用B2的CLI工具设置CORS策略,之前allowedOperations里没加s3的权限,折腾了好久才发现是这个问题。
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","x-bz-content-sha1"],"maxAgeSeconds":3600}]' <你的存储筒名>
还有手动复制队列的链接到浏览器报错是肯定的,那个签名是一次性的。 我现在遇到了另一个问题, 上传进度到100%之后提示
无法完成文件上传: One or more of the specified parts could not be found. The part may not have been uploaded, or the specified entity tag may not match the part's entity tag. (InvalidPart)
F12里发现POST请求的payload是这个<CompleteMultipartUpload><Part><PartNumber>1</PartNumber><ETag>undefined</ETag></Part><Part><PartNumber>2</PartNumber><ETag>undefined</ETag></Part></CompleteMultipartUpload>
不知道是不是因为ETag为
undefined
导致的 我看B2给的示例是这个格式<?xml version="1.0" encoding="UTF-8"?> <CompleteMultipartUpload> <Part><PartNumber>1</PartNumber><ETag>"4ee5c4f1b14bbda5333072ee501fbbbb"</ETag></Part> <Part><PartNumber>2</PartNumber><ETag>"2bb626328bc9f6e5318b78311ea7c7c8"</ETag></Part> <Part><PartNumber>3</PartNumber><ETag>"a024268b53f21f3cffe67c84202b6c37"</ETag></Part> <Part><PartNumber>4</PartNumber><ETag>"04da279d88080c80dcdef0fa6c2cb047"</ETag></Part> </CompleteMultipartUpload>
EDIT: 问题解决了, exposeHeaders 加上 etag就好了
这个CORS命令我在b2-windows上遇到了
invalid loads value
的错误(PowerShell或CMD均会报错),但是在Linux环境下该命令一切正常。
如果有人也遇到了这个问题,请改用Linux环境。
用Linux环境成功设置,但是遇到新的问题:无法删除文件,点击删除立刻弹出“一个文件未能成功删除”。请问有什么解决办法吗?
虽然不知道为什么,但是在经过一点小小的修改之后好像解决了无法删除文件的问题? 用的是下面的指令,记录在这里一下
b2 update-bucket --corsRules '[{"corsRuleName":"cloudreveAllowDownloadWithUpload","allowedOrigins":["*"],"allowedHeaders":["*"],"allowedOperations":["b2_download_file_by_id","b2_download_file_by_name","b2_upload_file","b2_upload_part","s3_delete","s3_get","s3_head","s3_post","s3_put"],"exposeHeaders":["authorization","x-bz-file-name","X-Bz-Content-Sha1","X-Bz-Part-Number","etag"],"maxAgeSeconds":3600}]' <存储桶名>
exposeHeaders里的大小写并没有特殊的作用