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

rclone 在 s3 源的判断上有缺陷,望适配 #8

Open
CornWorld opened this issue Oct 11, 2023 · 3 comments
Open

rclone 在 s3 源的判断上有缺陷,望适配 #8

CornWorld opened this issue Oct 11, 2023 · 3 comments

Comments

@CornWorld
Copy link

CornWorld commented Oct 11, 2023

rclone/rclone#5119

简单来说,rclone 在 sync / copy 操作时不会主动检查 bucket 是否存在,而是在 PUT 请求中始终添加 CreateBucket 标签,很容易因为 Token 权限不足而触发 403 返回。

@CornWorld
Copy link
Author

CornWorld commented Oct 11, 2023

目前我对 execFilefunc 添加 --s3-no-check-bucke 参数来解决问题。

下面是对编译后代码进行修改后的结果。

        var up = utils_1.execFilefunc("rclone", ['sync', '-P', rcloneLocalURI, rcloneRemoteDir, '--s3-no-check-bucket']);
        ListExec.push(up);
        if (userConfig.localPostion) {
            var lo = utils_1.execFilefunc("rclone", ['sync', '-P', rcloneLocalURI, rcloneLocalPosition]);
            ListExec.push(lo);
        }
        if (userConfig.backupName1) {
            var up1 = utils_1.execFilefunc("rclone", ['sync', '-P', rcloneLocalURI, rcloneBackupDir1, '--s3-no-check-bucket']);
            ListExec.push(up1);
        }
        if (userConfig.backupName2) {
            var up2 = utils_1.execFilefunc("rclone", ['sync', '-P', rcloneLocalURI, rcloneBackupDir2, '--s3-no-check-bucket']);
            ListExec.push(up2);
        }
        if (userConfig.backupName3) {
            var up3 = utils_1.execFilefunc("rclone", ['sync', '-P', rcloneLocalURI, rcloneBackupDir3, '--s3-no-check-bucket']);
            ListExec.push(up3);
        }

@yabostone
Copy link
Owner

您好,这个属于rclone的最佳实践和feature的问题,默认在使用rclone的插件的时候,需要提前在命令行中检查,创建对应的可用的存储库,并判断自己的token可以进行文件的增删改查。

@CornWorld
Copy link
Author

你好!
虽然如此,但出现此问题时,排查花费了很多时间。
可以添加更多利于排查此错误的错误输出,或者添加一些相关提醒吗?

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

No branches or pull requests

2 participants