Molunerfinn / PicGo

:rocket:A simple & beautiful tool for pictures uploading built by vue-cli-electron-builder
https://molunerfinn.com/PicGo/
MIT License
24.13k stars 2.24k forks source link

PicGo-2.3.1 arm版本,Mac M1 Monterey 使用腾讯云,上传失败,You do not have permission to get URL #868

Closed youngyangyang04 closed 2 years ago

youngyangyang04 commented 2 years ago

声明:我已经仔细看过 文档FAQ、和搜索过已经关闭的 issues 后依然没有找到答案,所以才发了一个新的 issue。

问题类型

图片上传失败,显示没有权限

PicGo 的相关信息

PicGo-2.3.1-beta.2-arm64 Mac M1 Monterey 使用腾讯云COS

问题重现

错误日志 : -------Error Stack End------- 2022-04-04 14:53:40 [PicGo INFO] Before transform 2022-04-04 14:53:40 [PicGo INFO] Transforming... Current transformer is [path] 2022-04-04 14:53:40 [PicGo INFO] Before upload 2022-04-04 14:53:40 [PicGo INFO] beforeUploadPlugins: renameFn running 2022-04-04 14:53:40 [PicGo INFO] Uploading... Current uploader is [tcyun] 2022-04-04 14:53:40 [PicGo ERROR] ------Error Stack Begin------ StatusCodeError: 403 - "You do not have permission to get URL '/files/v2/1253855093/code-thinking-1253855093/pics/Xnip2022-04-01_20-18-42.jpg' from this server." at new StatusCodeError (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/request-promise-core/lib/errors.js:32:15) at Request.plumbing.callback (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/request-promise-core/lib/plumbing.js:104:33) at Request.RP$callback [as _callback] (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/request-promise-core/lib/plumbing.js:46:31) at Request.self.callback (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/request/request.js:185:22) at Request.emit (node:events:394:28) at Request. (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/request/request.js:1154:10) at Request.emit (node:events:394:28) at IncomingMessage. (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/request/request.js:1076:12) at Object.onceWrapper (node:events:513:28) at IncomingMessage.emit (node:events:406:35) -------Error Stack End------- 2022-04-04 14:53:40 [PicGo WARN] failed 2022-04-04 14:53:40 [PicGo ERROR] ------Error Stack Begin------ Error at Object.handle (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/plugins/uploader/tcyun.js:115:27) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Lifecycle.doUpload (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/core/Lifecycle.js:80:9) at async Lifecycle.start (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/core/Lifecycle.js:26:13) at async PicGo.upload (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/core/PicGo.js:205:32) at async Object.upload (/Applications/PicGo.app/Contents/Resources/app.asar/background.js:2:530747) at async _e (/Applications/PicGo.app/Contents/Resources/app.asar/background.js:2:533208) -------Error Stack End------- 2022-04-04 14:53:40 [PicGo ERROR] ------Error Stack Begin------ Error at Object.handle (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/plugins/uploader/tcyun.js:115:27) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Lifecycle.doUpload (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/core/Lifecycle.js:80:9) at async Lifecycle.start (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/core/Lifecycle.js:26:13) at async PicGo.upload (/Applications/PicGo.app/Contents/Resources/app.asar/node_modules/picgo/dist/src/core/PicGo.js:205:32) at async Object.upload (/Applications/PicGo.app/Contents/Resources/app.asar/background.js:2:530747) at async _e (/Applications/PicGo.app/Contents/Resources/app.asar/background.js:2:533208) -------Error Stack End-------

这个issue 751 我已经看了, 但不清楚是什么权限问题导致的。

我测试填写错误的配置信息,例如随便写一个Sid,报错依然也是这个“You do not have permission to get”错误信息。

如果是权限问题,可以给一个mac上如果操作的建议吗。

我有去安装 intel版本 2.3.0 ,2.2.2,使用腾讯云是一样的报错,使用阿里云倒是可以成功,但切回腾讯云之后,picgo 上传图片依然传到阿里云,可能是intel版本和M1 不兼容之类的bug。

以上可以排除配置填写问题,这个我专门在两天下午,头脑清醒的情况去,去测试的。


已经赞赏 ,picgo 真的极大的提高了我的工作效率,这两天换了新电脑,picgo一直无法使用,被迫使用旧电脑上的picgo,才发现 它对我太重要了。

感谢您的时间,期待反馈。

Molunerfinn commented 2 years ago

403的报错信息就是身份认证没通过。

简单来说,如果你的旧电脑里可以上传picgo,你可以找到旧电脑的picgo的配置文件,然后打开之后,比对配置文件中 picBed 里的字段即可。

一般来说,有不少用户是因为配置项多了前后空格导致的。打开配置文件直接看配置项可能会比较清楚。

除此之外picgo也没法做什么,因为这个确实是配置问题。

至于切换回腾讯云后,上传图片依然是阿里云,这里可以确认一下配置文件中 picBed.currentpicBed.uploader 是否都是 tcyun。如果不是手动修改重启picgo即可。理论上2.2.2的配置2.3.0有些是不认的,所以需要手动切换一次。

另外M1和intel用的是同样的配置文件,两个版本没有逻辑上的区别只有构建内核版本的不同。

Molunerfinn commented 2 years ago

另外如果是MAC,注意如果系统权限里,如果是否没有给picgo授予读写文件权限?比如我记得有桌面文件的读写权限,需要给picgo开启才行

youngyangyang04 commented 2 years ago

十分感谢作者详细的回答, 我对比了配置,没有问题,我是将版本改成为V5,就可以了,如图:

image

上传成功之后,发现picgo,没有返回我url,但日志里有成功的url。

我在issue781,找到解决办法,最后感谢作者的付出🌹