Capture full API response in 123open complete() polling logs including error codes #2
+113
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The complete() polling logs were losing the API error code when the 123open API returned non-zero codes, making it impossible to diagnose timeout failures. Only the error message was visible:
Changes
drivers/123_open/upload.go: Return response struct even when Request() returns error, preserving parsed Code/Message/Completed/FileID fieldsdrivers/123_open/driver.go: Log all response fields in error case, not just the error messageENHANCED_LOGGING_EXAMPLE.mdexplaining the diagnostic value of capturing error codes like 20103Result
All complete() polls now show complete API response:
This reveals undocumented error codes mentioned in code comments (e.g., 20103) and enables proper root cause analysis of the Baidu→123open timeout issue.
Original prompt
3,""Creator"":{""id"":1,""username"":""Arc"",""password"":"""",""base_path"":""/"",""role"":2,""disabled"":false,""permission"":13311,""sso_id"":"""",""allow_ldap"":true},""TotalBytes"":717241529,""ApiUrl"":""http://127.0.0.1:5244"",""src_path"":""/MOV/藤本树合集/藤本树17-26/Tatsuki.Fujimoto.17.26.S01.1080p.AMZN.WEB-DL.DUAL.DDP5.1.H.264-VARYG/Tatsuki.Fujimoto.17.26.S01E06.Woke-Up-as-a-Girl.Syndrome.1080p.AMZN.WEB-DL.DUAL.DDP5.1.H.264-VARYG.mkv"",""dst_path"":""/Arc"",""src_storage_mp"":""/storage/baidu"",""dst_storage_mp"":""/storage/123open"",""TaskType"":0},{""id"":""j5grgVFYKF3dVII7QDWLk"",""state"":1,""retry"":0,""max_retry"":3,""Creator"":{""id"":1,""username"":""Arc"",""password"":"""",""base_path"":""/"",""role"":2,""disabled"":false,""permission"":13311,""sso_id"":"""",""allow_ldap"":true},""TotalBytes"":142765696,""ApiUrl"":""http://127.0.0.1:5244"",""src_path"":""/MOV/sharedassets5.assets.resS"",""dst_path"":""/Arc"",""src_storage_mp"":""/storage/baidu"",""dst_storage_mp"":""/storage/123open"",""TaskType"":0}]" WHERE key = "copy"
DEBU[2025-12-28 17:31:15]/source/server/middlewares/auth.go:73 github.com/OpenListTeam/OpenList/v4/server.Init.Auth.func10() use login token: &{ID:1 Username:Arc PwdHash:6f4b440aadf2e058cd3af41e6324e90bcceed5a64bd923c57b36eadbcb6014ed PwdTS:1764046174 Salt:sb63ox3Ee3rzkALo Password: BasePath:/ Role:2 Disabled:false Permission:13311 OtpSecret: SsoID: Authn:[] AllowLdap:true}
[GIN] 2025/12/28 - 17:31:15 | 200 | 0s | 127.0.0.1 | GET "/api/task/copy/undone"
DEBU[2025-12-28 17:31:16]/source/drivers/123_open/upload.go:188 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Upload.func2() [123open] Upload - file: sharedassets5.assets.resS, chunk 5/5 uploaded successfully in 1.847055s (total: 1.8607367s)
DEBU[2025-12-28 17:31:17]/source/server/middlewares/auth.go:73 github.com/OpenListTeam/OpenList/v4/server.Init.Auth.func10() use login token: &{ID:1 Username:Arc PwdHash:6f4b440aadf2e058cd3af41e6324e90bcceed5a64bd923c57b36eadbcb6014ed PwdTS:1764046174 Salt:sb63ox3Ee3rzkALo Password: BasePath:/ Role:2 Disabled:false Permission:13311 OtpSecret: SsoID: Authn:[] AllowLdap:true}
[GIN] 2025/12/28 - 17:31:17 | 200 | 0s | 127.0.0.1 | GET "/api/task/copy/undone"
DEBU[2025-12-28 17:31:18]/source/drivers/123_open/upload.go:188 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Upload.func2() [123open] Upload - file: sharedassets5.assets.resS, chunk 4/5 uploaded successfully in 5.8767511s (total: 5.9285271s)
INFO[2025-12-28 17:31:18]/source/drivers/123_open/upload.go:204 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Upload() [123open] Upload - file: sharedassets5.assets.resS, all 5 chunks uploaded successfully in 33.5091402s
INFO[2025-12-28 17:31:18]/source/drivers/123_open/driver.go:221 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Put() [123open] File: sharedassets5.assets.resS - Chunk upload completed in 33.5091402s
INFO[2025-12-28 17:31:18]/source/drivers/123_open/driver.go:224 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Put() [123open] File: sharedassets5.assets.resS - Starting complete() polling (max 60 attempts)
DEBU[2025-12-28 17:31:18]/source/drivers/123_open/util.go:59 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Request() API: https://open-api.123pan.com/upload/v2/file/upload_complete, QPS: 0, NowLen: 0
WARN[2025-12-28 17:31:18]/source/drivers/123_open/driver.go:231 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Put() [123open] File: sharedassets5.assets.resS - Complete poll #1: API error: 文件正在校验中,请间隔1秒后再试
DEBU[2025-12-28 17:31:19]/source/drivers/123_open/util.go:59 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Request() API: https://open-api.123pan.com/upload/v2/file/upload_complete, QPS: 0, NowLen: 0
WARN[2025-12-28 17:31:19]/source/drivers/123_open/driver.go:231 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Put() [123open] File: sharedassets5.assets.resS - Complete poll #2: API error: 文件上传失败
DEBU[2025-12-28 17:31:19]/source/server/middlewares/auth.go:73 github.com/OpenListTeam/OpenList/v4/server.Init.Auth.func10() use login token: &{ID:1 Username:Arc PwdHash:6f4b440aadf2e058cd3af41e6324e90bcceed5a64bd923c57b36eadbcb6014ed PwdTS:1764046174 Salt:sb63ox3Ee3rzkALo Password: BasePath:/ Role:2 Disabled:false Permission:13311 OtpSecret: SsoID: Authn:[] AllowLdap:true}
[GIN] 2025/12/28 - 17:31:19 | 200 | 0s | 127.0.0.1 | GET "/api/task/copy/undone"
DEBU[2025-12-28 17:31:20]/source/drivers/123_open/util.go:59 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Request() API: https://open-api.123pan.com/upload/v2/file/upload_complete, QPS: 0, NowLen: 0
WARN[2025-12-28 17:31:21]/source/drivers/123_open/driver.go:231 github.com/OpenListTeam/OpenList/v4/drivers/123_open.(*Open123).Put() [123open] File: sharedassets5.assets.resS - Complete poll OpenListTeam#3: API error: 文件上传失败
de...
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.