{"record":{"id":"568c5afa82463646","repo":"yikart/AiToEarn","slug":"id-568c5a","errorCode":null,"errorMessage":"上传封面失败,失败原因:获取上传id失败","messagePattern":"上传封面失败,失败原因:获取上传id失败","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"project/aitoearn-electron/electron/plat/shipinhao/index.ts","lineNumber":825,"sourceCode":"      const uploadIdRes = await this.uploadFile(\n        this.getApplyUploadDfsUrl,\n        Buffer.from(\n          JSON.stringify({\n            BlockPartLength: [fileData.length],\n            BlockSum: 1,\n          }),\n        ),\n        {\n          Authorization: uploadParams.authKey,\n          'Content-Type': 'application/json',\n          'X-Arguments': uploadArgumentsString,\n        },\n        undefined,\n        proxy,\n      );\n\n      if (!uploadIdRes.UploadID) {\n        throw new Error('上传封面失败,失败原因:获取上传id失败');\n      }\n\n      const uploadId = uploadIdRes.UploadID;\n\n      // 开始上传\n      const uploadPartRes = await this.uploadFile(\n        this.uploadpartdfsUrl +\n          `?UploadID=${uploadId}&PartNumber=1&QuickUpload=2`,\n        fileData,\n        {\n          Authorization: uploadParams.authKey,\n          'X-Arguments': uploadArgumentsString,\n          'Content-Type': 'application/octet-stream',\n        },\n        undefined,\n        proxy,\n      );\n","sourceCodeStart":807,"sourceCodeEnd":843,"githubUrl":"https://github.com/yikart/AiToEarn/blob/d3aa8bea5b146a8675607cf0144d891aad3e9683/project/aitoearn-electron/electron/plat/shipinhao/index.ts#L807-L843","documentation":"Mirror of error 364 but for the cover/thumbnail image: uploadCoverFile requests an initial UploadID from the COS endpoint and throws if none is returned. The cover upload never started because the upload session could not be created.","triggerScenarios":"uploadCoverFile → apply-upload response lacks UploadID: invalid upload params, missing/oversized cover file, COS rejecting the request due to bad signature or throttling.","commonSituations":"Cover file path wrong or file unreadable (0 bytes sent), stale upload params, Shipinhao session expiry, or COS rate limiting.","solutions":["Verify the cover image exists locally and is a valid image with expected size.","Re-obtain upload params (fresh traceKey) before retrying the cover upload.","Log the full uploadIdRes response to read the COS error code.","Retry after backoff if the server was throttling."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"import fs from 'fs';\nif (!fs.existsSync(coverPath)) throw new Error('cover file missing');\nif (fs.statSync(coverPath).size === 0) throw new Error('cover file empty');","typeGuard":"function hasUploadId(res: unknown): res is { UploadID: string } {\n  return typeof (res as any)?.UploadID === 'string' && (res as any).UploadID.length > 0;\n}","tryCatchPattern":"try {\n  await service.uploadCoverFile(/*...*/);\n} catch (e) {\n  if (e.message.includes('获取上传id失败')) {\n    // refetch upload params, verify cover file, retry\n  }\n}","preventionTips":["Check the cover file exists and is a valid image before upload","Use upload params fetched in the same session/flow","Log the apply-upload response body for COS error details","Retry with backoff if throttled"],"tags":["upload","cover","shipinhao","cos"],"backgroundTag":"upload-id-missing","analyzedSha":"d3aa8bea5b146a8675607cf0144d891aad3e9683","analyzedAt":"2026-08-31T14:19:24.185Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}