Rin icon indicating copy to clipboard operation
Rin copied to clipboard

文件上傳失敗 已按照教程部署但R2無訊息

Open qyjoy opened this issue 5 months ago • 9 comments

Bug 描述

文件上傳失敗 已按照教程部署但R2無訊息 安全規則中已確認放行R2URL和終結點URL

复现步骤 ###在發文處: 複製貼上任意圖片左上角點擊圖片上傳按鈕,發現雖然有上傳動畫但實際上未觀察到網路上傳流量 3MB文件長時間未上傳完成

且在設定頁面修改設定再刷新後發現修改未生效

CF可觀察到R2內無資訊和任何資料夾

Image Image Image Image

期望行为

成功上傳文件/圖片 截图

环境变量

S3 end point : https://30f95ced9e5a54aca838e5c15b6f338c.r2.cloudflarestorage.com R2 : r2.qyjoy.vip main fronted url : ra2.qyjoy.vip back end : ra2back.qyjoy.vip

qyjoy avatar Jul 13 '25 13:07 qyjoy

请为 Worker 启用日志记录 Image

查看 /storage 请求的日志

OXeu avatar Jul 13 '25 13:07 OXeu

请为 Worker 启用日志记录 Image

查看 /storage 请求的日志

由於worker log啟用一段時間後自動關閉,使用log stream抓取資訊如下

{ "wallTime": 343, "cpuTime": 29, "truncated": false, "executionModel": "stateless", "outcome": "ok", "scriptVersion": { "id": "7c0021e6-d1f4-4cb0-b9c7-1e64956fe127" }, "scriptName": "rin-server", "diagnosticsChannelEvents": [], "exceptions": [], "logs": [ { "message": [ "Unauthorized" ], "level": "error", "timestamp": 1752413373616 } ], "eventTimestamp": 1752413373294, "event": { "request": { "url": "https://ra2back.qyjoy.vip/storage", "method": "POST", "headers": { "accept": "/", "accept-encoding": "gzip, br", "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7", "authorization": "REDACTED", "cf-cert-presented": "false", "cf-cert-revoked": "false", "cf-cert-verified": "false", "cf-connecting-ip": "2001:f40:98c:7833:e4d3:d295:75f2:7c21", "cf-ipcity": "Putrajaya", "cf-ipcontinent": "AS", "cf-ipcountry": "MY", "cf-iplatitude": "2.93527", "cf-iplongitude": "101.69112", "cf-postal-code": "62522", "cf-pseudo-ipv4": "254.97.212.37", "cf-ray": "95e9213efe7b5f53", "cf-region": "Putrajaya", "cf-region-code": "16", "cf-timezone": "Asia/Kuala_Lumpur", "cf-visitor": "{"scheme":"https"}", "connection": "Keep-Alive", "content-length": "34823", "content-type": "multipart/form-data; boundary=----WebKitFormBoundaryOe6cP9v9ThIx8Iw6", "host": "ra2back.qyjoy.vip", "origin": "https://ra2.qyjoy.vip", "priority": "u=1, i", "referer": "https://ra2.qyjoy.vip/", "sec-ch-ua": ""Not)A;Brand";v="8", "Chromium";v="138", "Google Chrome";v="138"", "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": ""Windows"", "sec-fetch-dest": "empty", "sec-fetch-mode": "cors", "sec-fetch-site": "same-site", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36", "x-forwarded-proto": "https", "x-real-ip": "2001:f40:98c:7833:e4d3:d295:75f2:7c21" }, "cf": { "requestHeaderNames": {}, "httpProtocol": "HTTP/3", "tlsCipher": "AEAD-AES128-GCM-SHA256", "continent": "AS", "asn": 9930, "clientAcceptEncoding": "gzip, deflate, br, zstd", "verifiedBotCategory": "", "country": "MY", "isEUCountry": false, "region": "Putrajaya", "tlsClientCiphersSha1": "", "tlsClientAuth": { "certIssuerDNLegacy": "", "certIssuerSKI": "", "certSubjectDNRFC2253": "", "certSubjectDNLegacy": "", "certFingerprintSHA256": "", "certNotBefore": "", "certSKI": "", "certSerial": "", "certIssuerDN": "", "certVerified": "NONE", "certNotAfter": "", "certSubjectDN": "", "certPresented": "0", "certRevoked": "0", "certIssuerSerial": "", "certIssuerDNRFC2253": "", "certFingerprintSHA1": "" }, "tlsClientRandom": "mm5eRmitXWWbYm1MrBpMo2/FIB4qk432zsu92yOTNvE=", "tlsClientHelloLength": "1744", "colo": "SIN", "timezone": "Asia/Kuala_Lumpur", "longitude": "101.69112", "latitude": "2.93527", "edgeRequestKeepAliveStatus": 1, "requestPriority": "", "postalCode": "62522", "city": "Putrajaya", "tlsVersion": "TLSv1.3", "regionCode": "16", "asOrganization": "TT DOTCOM SDN BHD", "tlsClientExtensionsSha1Le": "", "tlsClientExtensionsSha1": "e7dr29A6Fubj1mfbvxDAmMESGUE=", "botManagement": { "corporateProxy": false, "verifiedBot": false, "jsDetection": { "passed": false }, "staticResource": false, "detectionIds": {}, "score": 99 } } }, "response": { "status": 400 } }, "id": 0 }

{ "wallTime": 51, "cpuTime": 51, "truncated": false, "executionModel": "stateless", "outcome": "ok", "scriptVersion": { "id": "7c0021e6-d1f4-4cb0-b9c7-1e64956fe127" }, "scriptName": "rin-server", "diagnosticsChannelEvents": [], "exceptions": [], "logs": [], "eventTimestamp": 1752413442655, "event": { "request": { "url": "https://ra2back.qyjoy.vip/storage", "method": "GET", "headers": { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7", "accept-encoding": "gzip, br", "cf-cert-presented": "false", "cf-cert-revoked": "false", "cf-cert-verified": "false", "cf-connecting-ip": "54.70.53.60", "cf-ipcity": "Boardman", "cf-ipcontinent": "NA", "cf-ipcountry": "US", "cf-iplatitude": "45.83986", "cf-iplongitude": "-119.70058", "cf-postal-code": "97818", "cf-ray": "95e922f06ba18e6c", "cf-region": "Oregon", "cf-region-code": "OR", "cf-timezone": "America/Los_Angeles", "cf-visitor": "{"scheme":"https"}", "connection": "Keep-Alive", "host": "ra2back.qyjoy.vip", "priority": "u=0, i", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "none", "sec-fetch-user": "?1", "upgrade-insecure-requests": "1", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36", "x-forwarded-proto": "https", "x-real-ip": "54.70.53.60" }, "cf": { "clientTcpRtt": 7, "requestHeaderNames": {}, "httpProtocol": "HTTP/2", "tlsCipher": "AEAD-AES128-GCM-SHA256", "continent": "NA", "asn": 16509, "clientAcceptEncoding": "gzip, deflate, br, zstd", "verifiedBotCategory": "", "country": "US", "isEUCountry": false, "region": "Oregon", "tlsClientCiphersSha1": "lfngDnNByKm4t39f07Exsb7L5Ys=", "tlsClientAuth": { "certIssuerDNLegacy": "", "certIssuerSKI": "", "certSubjectDNRFC2253": "", "certSubjectDNLegacy": "", "certFingerprintSHA256": "", "certNotBefore": "", "certSKI": "", "certSerial": "", "certIssuerDN": "", "certVerified": "NONE", "certNotAfter": "", "certSubjectDN": "", "certPresented": "0", "certRevoked": "0", "certIssuerSerial": "", "certIssuerDNRFC2253": "", "certFingerprintSHA1": "" }, "tlsClientRandom": "szi3u7LN3VyO+iDW3WNEh91Xh/88kbKz/d0/a6CSZC4=", "tlsExportedAuthenticator": { "clientFinished": "eb0ac67dadc4fc20628fafed0da592d725295f5f58f5941a9da4ae45ed0b6b41", "clientHandshake": "416fbfb772ca9d13c9b824e0d0ccd3738b9cde03a003ce84cd03c49fc53397b6", "serverHandshake": "72e1a882c855684546c99927d5a5f8cf3324596087ce4fe693d6f5d84a726e65", "serverFinished": "d04eeda204b2bea6d5c69bcc26cc744c480e767ef78edebeb9c4fbb95c3d163f" }, "tlsClientHelloLength": "1718", "colo": "PDX", "timezone": "America/Los_Angeles", "longitude": "-119.70058", "latitude": "45.83986", "edgeRequestKeepAliveStatus": 1, "requestPriority": "weight=256;exclusive=1", "postalCode": "97818", "city": "Boardman", "tlsVersion": "TLSv1.3", "regionCode": "OR", "asOrganization": "Amazon Technologies Inc.", "tlsClientExtensionsSha1Le": "m/F32wZHRi7mWZ7cpLyMSe7CtbE=", "tlsClientExtensionsSha1": "zzz0RL1xl3ZBduJRWymQS7efXQ8=", "botManagement": { "corporateProxy": false, "verifiedBot": false, "jsDetection": { "passed": false }, "staticResource": false, "detectionIds": {}, "score": 99 } } }, "response": { "status": 404 } }, "id": 16 }

qyjoy avatar Jul 13 '25 13:07 qyjoy

Image Image Image Image

qyjoy avatar Jul 13 '25 13:07 qyjoy

没有什么十分有用的信息,配置内容也基本上正确,唯一需要检查的是 S3_ACCESS_KEY_ID 和 S3_SECRET_ACCESS_KEY 是否填反或填错;同时检查其权限是否为 Object Read and Write

OXeu avatar Jul 13 '25 14:07 OXeu

没有什么十分有用的信息,配置内容也基本上正确,唯一需要检查的是 S3_ACCESS_KEY_ID 和 S3_SECRET_ACCESS_KEY 是否填反或填错;同时检查其权限是否为 Object Read and Write

刪除全部重新依照教學部署,action直接部署失敗,猜測wrangler版本過老導致未能讀取變數和機密

qyjoy avatar Jul 14 '25 04:07 qyjoy

没有什么十分有用的信息,配置内容也基本上正确,唯一需要检查的是 S3_ACCESS_KEY_ID 和 S3_SECRET_ACCESS_KEY 是否填反或填错;同时检查其权限是否为 Object Read and Write

刪除全部重新依照教學部署,action直接部署失敗,猜測wrangler版本過老導致未能讀取變數和機密

与版本无关,检查 Cloudflare API Key 是否授予了 D1 的读写权限

Image

OXeu avatar Jul 14 '25 04:07 OXeu

没有什么十分有用的信息,配置内容也基本上正确,唯一需要检查的是 S3_ACCESS_KEY_ID 和 S3_SECRET_ACCESS_KEY 是否填反或填错;同时检查其权限是否为 Object Read and Write

刪除全部重新依照教學部署,action直接部署失敗,猜測wrangler版本過老導致未能讀取變數和機密

与版本无关,检查 Cloudflare API Key 是否授予了 D1 的读写权限

Image

權限都是edit,確認過沒有任何低級錯誤的

qyjoy avatar Jul 14 '25 15:07 qyjoy

如果 R2 不可用的话可以尝试其他 S3 服务提供商

OXeu avatar Jul 14 '25 15:07 OXeu

如果 R2 不可用的话可以尝试其他 S3 服务提供商

之前因為發現默認fork是dev,所以刻意使用的Main近期是否有成功搭建的用戶案例,用戶使用的何種分支

qyjoy avatar Jul 14 '25 18:07 qyjoy