Skip to content

Conversation

Copy link

Copilot AI commented Dec 28, 2025

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:

WARN[2025-12-28 17:31:19] [123open] File: test.zip - Complete poll #2: API error: 文件上传失败

Changes

  • drivers/123_open/upload.go: Return response struct even when Request() returns error, preserving parsed Code/Message/Completed/FileID fields
  • drivers/123_open/driver.go: Log all response fields in error case, not just the error message
  • Documentation: Added ENHANCED_LOGGING_EXAMPLE.md explaining the diagnostic value of capturing error codes like 20103

Result

All complete() polls now show complete API response:

WARN[2025-12-28 17:31:19] [123open] File: test.zip - Complete poll #2: Code=20103, Message=文件上传失败, Completed=false, FileID=0 (API Error: 文件上传失败)

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.

Copilot AI and others added 3 commits December 28, 2025 09:51
Co-authored-by: ARC-HXT <246875732+ARC-HXT@users.noreply.github.com>
Co-authored-by: ARC-HXT <246875732+ARC-HXT@users.noreply.github.com>
Co-authored-by: ARC-HXT <246875732+ARC-HXT@users.noreply.github.com>
Copilot AI changed the title [WIP] Add file transfer functionality from Baidu to local storage Capture full API response in 123open complete() polling logs including error codes Dec 28, 2025
Copilot AI requested a review from ARC-HXT December 28, 2025 09:59
@Ironboxplus
Copy link

@copilot 你干了点啥?

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

Successfully merging this pull request may close these issues.

3 participants