Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some S3 providers are not available #14053

Closed
88250 opened this issue Feb 11, 2025 · 20 comments
Closed

Some S3 providers are not available #14053

88250 opened this issue Feb 11, 2025 · 20 comments
Assignees
Milestone

Comments

@88250
Copy link
Member

88250 commented Feb 11, 2025

某些 S3 提供商无法使用

upload lock sync failed: operation error S3: PutObject, https response error StatusCode: 400, RequestID: 67AAF92CD4BE203039C9E353, HostID: sunhy-host.oss-cn-beijing.aliyuncs.com, api error InvalidArgument: aws-chunked encoding is not supported with the specified x-amz-content-sha256 value.

AWS SDK 在 v1.33.0 中升级的 checksum 模块 v1.5.0 中引入的一个特性导致了该问题 https://github.com/aws/aws-sdk-go-v2/blob/main/service/internal/checksum/CHANGELOG.md aws/aws-sdk-go-v2#2960

解决方案是禁用校验:

as3.NewFromConfig(cfg, func(o *as3.Options) {
	o.RequestChecksumCalculation = aws.RequestChecksumCalculationWhenRequired
	o.ResponseChecksumValidation = aws.ResponseChecksumValidationWhenRequired
}
@88250 88250 self-assigned this Feb 11, 2025
@88250 88250 changed the title 某些 S3 提供商无法使用问题 某些 S3 提供商无法使用 Feb 11, 2025
@emptylight370
Copy link
Contributor

在14051提到的帖子中,我已经上传了今天的日志,直接引用链滴的文件链接了:siyuan.zip,我整不动了,辛苦D大看看,云服务商是腾讯云。

@88250
Copy link
Member Author

88250 commented Feb 11, 2025

先用上个版本顶顶

@emptylight370
Copy link
Contributor

emptylight370 commented Feb 11, 2025 via email

@shuojie819
Copy link

聊天记录 👇(直接截图感觉不太好就复制上来了)
已知,腾讯云COS、阿里云OSS、缤纷云在HTTPS下无法正常同步,七牛云一切正常

  • https时使用了aws-chunked编码,http时没有使用。
  • 可以解释得通了:Why are S3 trailing checksums only supported over TLS? aws/aws-sdk-go-v2#1667
  • 你们使用思源的快速修复就是改成http协议(而不是https)
  • 看起来不是一个疏漏,是有意为之。
  • 需要继续调研。但它用这种方法可能会让很多S3兼容对象存储都不支持。
  • 我稍微有点怀疑,七牛云并没有识别这个header,算是歪打正着
  • 不过oss不支持,说明对于很多对象存储服务商来说,这种严格的上传是不一定有必要的。

@88250 88250 changed the title 某些 S3 提供商无法使用 Some S3 providers are not available Feb 12, 2025
@88250 88250 added this to the 3.1.22 milestone Feb 12, 2025
88250 added a commit to siyuan-note/dejavu that referenced this issue Feb 12, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
88250 added a commit that referenced this issue Feb 12, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@88250 88250 closed this as completed Feb 12, 2025
@emptylight370
Copy link
Contributor

所以下一个dev版有修复吗

@88250
Copy link
Member Author

88250 commented Feb 12, 2025

对,下午发个 dev 版

@ethan-bitiful
Copy link

缤纷云更新:

  • 缤纷云当前(20250212)已经实施了更为完整的 chunked checksum 校验 以支持部分新的 S3 SDK 的默认行为。
  • siyuan-note 当前版本 https 状态下的同步行为已测试可以正常执行。

聊天记录 👇(直接截图感觉不太好就复制上来了)
已知,腾讯云COS、阿里云OSS、缤纷云在HTTPS下无法正常同步,七牛云一切正常

  • https时使用了aws-chunked编码,http时没有使用。
  • 可以解释得通了:Why are S3 trailing checksums only supported over TLS? aws/aws-sdk-go-v2#1667
  • 你们使用思源的快速修复就是改成http协议(而不是https)
  • 看起来不是一个疏漏,是有意为之。
  • 需要继续调研。但它用这种方法可能会让很多S3兼容对象存储都不支持。
  • 我稍微有点怀疑,七牛云并没有识别这个header,算是歪打正着
  • 不过oss不支持,说明对于很多对象存储服务商来说,这种严格的上传是不一定有必要的。

@emptylight370
Copy link
Contributor

emptylight370 commented Feb 12, 2025

现在腾讯云使用HTTPS和TLS Verify在大部分情况下能够同步成功,但是仍有提示magic number mismatch情况。这个提示发生在我修改内容之后上传。此时重试一遍同步又提示索引完成,后续就是同步完成。是否还存在潜在的问题?


备注:目前的测试中,于电脑端dev1(自动同步)上传正常,可于手机端20(手动同步)下载,但是手机端修改后上传首次会提示magic错误,随后为同步成功。之后于电脑端同步,首次提示magic,随后提示同步成功。但是手机端修改内容未同步。随后手机端下载发现修改被撤回。接下来尝试重建手机数据仓库。

@emptylight370
Copy link
Contributor

emptylight370 commented Feb 12, 2025

目前在手机(20)新工作空间下载云端仓库,在下载一遍之后会重新开始下载,比前一次少几个文件。通过查看手机端日志未发现错误,可能第二次下载还是一遍同步的一部分?不过第一次都下载了将近6k数据文件,第二次只是少下几个,并且data为空,可能存在问题。


刚才的监控数据图表出来了,我看好像只下行了15MB?这个似乎不太正常?但是本地的文件数应该是对的。

@88250
Copy link
Member Author

88250 commented Feb 12, 2025

@emptylight370 请清空云端目录后再帮忙测试看看,多谢。

@emptylight370
Copy link
Contributor

emptylight370 commented Feb 13, 2025

@88250 dev1在重建本地和云端之后上传仍然需要走两次条,第一次为5k9,第二次为5k8,第二次的文件数和初始化数据仓库时候显示的数量一致。第二次进度条走完之后显示同步完成。
随后启用自动同步,显示索引校验完成。手动点击同步按钮后可以正常显示同步完成。
因为之前手机上的20也会提示magic number mismatch,今天上午的测试先排除这个。在电脑端dev1修改内容,手动点击同步,可以提示同步完成。
如果所有设备都能升级到22并且重建仓库的话应该可以修复问题(仅猜测,需实际测试,不保证结果可复制)。


目前要解决的问题应该就是为什么会走两次条。

@88250
Copy link
Member Author

88250 commented Feb 13, 2025

两次条指的是?能否录屏或者截图看看,谢谢。

@emptylight370
Copy link
Contributor

第一次:

Image

Image

第二次:

Image

Image

@88250
Copy link
Member Author

88250 commented Feb 13, 2025

这是正常的,一个是上传数据分块,一个是上传数据文件。

@TCOTC
Copy link
Contributor

TCOTC commented Feb 13, 2025

话说这两个的区别是什么?分块不是文件吗

@88250
Copy link
Member Author

88250 commented Feb 13, 2025

文件 https://github.com/siyuan-note/dejavu/blob/main/entity/file.go
分块 https://github.com/siyuan-note/dejavu/blob/main/entity/chunk.go

@emptylight370
Copy link
Contributor

emptylight370 commented Feb 13, 2025

@88250 感谢D大,了解了。那么两个设备可以同时进入同步中是操作问题还是bug?
我前天测试时候关闭电脑上的思源,进入自动同步状态,又回退到全量上传。那时我在关闭电脑思源之后就打开手机思源,之后我发现手机也进入全量上传模式,抬头一看两个设备都在上传,只能紧急停止一个。这个是操作问题还是bug?

补充:电脑是自动同步,手机是启动关闭同步,两边的同步都是在启动和关闭状态下自动进行的。

@TCOTC TCOTC mentioned this issue Feb 13, 2025
3 tasks
@88250
Copy link
Member Author

88250 commented Feb 13, 2025

虽然加了锁,但是还是有一定概率锁不住的……

@emptylight370
Copy link
Contributor

我目前在手机(20版)上测试了一下同步,可以和电脑的dev1版同步,大概算解决了,希望不要遇到其他问题。云端数据仓库应该是因为我最后一次重建云端是在21版导致出现问题(没印象了),重建云端数据仓库和本地数据仓库之后就是前面的回复。
我对电脑和手机进行的操作总结到前面提到的链滴帖子的解决方案中了。希望这个问题可以就此解决,我不想再折腾了。

@88250
Copy link
Member Author

88250 commented Feb 13, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants