{"record":{"id":"b3c9e01d372ab45c","repo":"can1357/oh-my-pi","slug":"vgyme-rejected-the-upload","errorCode":null,"errorMessage":"vgyme rejected the upload","messagePattern":"vgyme rejected the upload","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts","lineNumber":348,"sourceCode":"\t\t\tconst remoteId = typeof image.id === \"string\" ? image.id : undefined;\n\t\t\treturn publication(\"chevereto\", request, url, { remoteId });\n\t\t},\n\t};\n}\n\nfunction createVgymeUploader(config: DestinationRuntimeConfig): BlobUploader {\n\tconst userKey = credentialString(config, \"userKey\");\n\n\treturn {\n\t\tdestination: \"vgyme\",\n\t\tasync upload(request) {\n\t\t\tconst response = await fetchFor(config)(VGYME_UPLOAD_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: multipartFile(request, \"file\", userKey ? { userkey: userKey } : {}),\n\t\t\t});\n\t\t\tconst payload = await jsonResponse(response, \"vgyme\");\n\t\t\tif (payload.error !== false && payload.error !== undefined && payload.error !== null) {\n\t\t\t\tthrow new Error(\"vgyme rejected the upload\");\n\t\t\t}\n\t\t\tconst url = directUrl(requiredString(payload, \"image\", \"vgyme\"), \"vgyme\");\n\t\t\tconst deletionUrl =\n\t\t\t\ttypeof payload.delete === \"string\" && payload.delete ? directUrl(payload.delete, \"vgyme\") : undefined;\n\t\t\treturn publication(\"vgyme\", request, url, {\n\t\t\t\tdelete: deletionUrl ? { method: \"DELETE\", url: deletionUrl } : undefined,\n\t\t\t\tremoteId: typeof payload.filename === \"string\" ? payload.filename : undefined,\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Create a built-in image-host uploader, or `null` for another destination family. */\nexport function createImageHostUploader(\n\tdestination: BlobDestinationId,\n\tconfig: DestinationRuntimeConfig,\n): BlobUploader | null {\n\tswitch (destination) {","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts#L330-L366","documentation":"The vgy.me upload API returns a JSON payload with an 'error' field; this error is thrown when error is present and not false/null, meaning vgy.me rejected the upload (bad userkey, invalid file, quota, etc.). The message is generic because vgy.me's payload shape does not reliably carry a reason here.","triggerScenarios":"POSTing the multipart upload to VGYME_UPLOAD_URL and receiving a payload where payload.error is a truthy value — e.g. invalid userkey, unsupported file type, or server-side rejection.","commonSituations":"Expired or wrong vgy.me user key in config, uploading a file type vgy.me disallows, or vgy.me service degradation.","solutions":["Check the vgy.me userkey option in the destination config is correct and current","Inspect the response payload's error value for the actual reason","Try uploading without the userkey (anonymous upload) to isolate the key issue","Retry later or check vgy.me service status if the payload error is transient"],"exampleFix":"// before\nif (payload.error !== false && payload.error !== undefined && payload.error !== null) {\n\tthrow new Error(\"vgyme rejected the upload\");\n}\n// after\nif (payload.error !== false && payload.error !== undefined && payload.error !== null) {\n\tthrow new Error(`vgyme rejected the upload: ${String(payload.error)}`);\n}","handlingStrategy":"try-catch","validationCode":"if (!userKey) console.warn(\"vgyme: uploading anonymously; provide a valid userkey to avoid quota rejections\");\nif (!file.type.startsWith(\"image/\")) throw new Error(\"vgyme only accepts images\");","typeGuard":"function isVgymeSuccess(payload: Record<string, unknown>): boolean {\n\treturn payload.error === false || payload.error === undefined || payload.error === null;\n}","tryCatchPattern":"try {\n\tconst url = uploadToVgyme(request);\n} catch (err) {\n\tif (err instanceof Error && err.message === \"vgyme rejected the upload\") {\n\t\t// verify userkey, retry anonymously, or fall back to another host\n\t}\n\tthrow err;\n}","preventionTips":["Keep the vgy.me userkey current in destination config","Only upload supported image formats/types","Fall back to an alternate image host on rejection","Log the payload.error value for the underlying reason"],"tags":["vgyme","upload","api-rejection"],"backgroundTag":"upload-rejected","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}