{"record":{"id":"6cc8f6fc3ef44a28","repo":"can1357/oh-my-pi","slug":"imageshack-rejected-the-upload","errorCode":null,"errorMessage":"imageshack rejected the upload","messagePattern":"imageshack rejected the upload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts","lineNumber":129,"sourceCode":"\nfunction createImageShackUploader(config: DestinationRuntimeConfig): BlobUploader {\n\tconst apiKey = requireCredential(config, \"apiKey\");\n\tconst authToken = requireCredential(config, \"authToken\");\n\tconst isPublic = optionBoolean(config, \"public\", false) ?? false;\n\n\treturn {\n\t\tdestination: \"imageshack\",\n\t\tasync upload(request) {\n\t\t\tconst response = await fetchFor(config)(IMAGESHACK_UPLOAD_URL, {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: multipartFile(request, \"file\", {\n\t\t\t\t\tapi_key: apiKey,\n\t\t\t\t\tauth_token: authToken,\n\t\t\t\t\tpublic: isPublic ? \"y\" : \"n\",\n\t\t\t\t}),\n\t\t\t});\n\t\t\tconst payload = await jsonResponse(response, \"imageshack\");\n\t\t\tif (payload.success !== true) throw new Error(\"imageshack rejected the upload\");\n\t\t\tconst result = nestedRecord(payload, \"result\", \"imageshack\");\n\t\t\tif (!Array.isArray(result.images) || result.images.length === 0) {\n\t\t\t\tthrow new Error(\"imageshack response did not include an image\");\n\t\t\t}\n\t\t\tconst image = responseRecord(result.images[0], \"imageshack\");\n\t\t\tconst server = image.server;\n\t\t\tconst bucket = image.bucket;\n\t\t\tconst filename = image.filename;\n\t\t\tif (\n\t\t\t\t(typeof server !== \"string\" && typeof server !== \"number\") ||\n\t\t\t\t(typeof bucket !== \"string\" && typeof bucket !== \"number\") ||\n\t\t\t\ttypeof filename !== \"string\" ||\n\t\t\t\t!filename\n\t\t\t) {\n\t\t\t\tthrow new Error(\"imageshack response did not include direct image coordinates\");\n\t\t\t}\n\t\t\tconst url = directUrl(`https://imagizer.imageshack.com/a/img${server}/${bucket}/${filename}`, \"imageshack\");\n\t\t\treturn publication(\"imageshack\", request, url, {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts#L111-L147","documentation":"The ImageShack uploader requires the parsed response payload to have `success === true`. Any other value (false, undefined, a string) means ImageShack did not accept the upload, so this error is thrown. It is the explicit rejection branch after JSON parsing succeeds.","triggerScenarios":"ImageShack responds with success:false or omits `success` — e.g. invalid/expired API key, auth_token rejected, quota exceeded, or the file fails the host's content rules.","commonSituations":"Expired or wrong api_key; missing auth_token for private uploads; exceeding the host's upload limits; uploading a disallowed file type.","solutions":["Verify the imageshack api_key and auth_token are valid and unexpired","Log the full payload — ImageShack usually includes an error message alongside success:false","Check quota/plan limits on the ImageShack account","Retry with another image host via fallback"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const payload = await response.clone().json();\nif (payload?.success !== true) {\n  throw new Error(\"imageshack upload will fail: \" + JSON.stringify(payload?.error ?? payload));\n}","typeGuard":null,"tryCatchPattern":"try {\n  const pub = await broker.publish(request);\n} catch (err) {\n  if (err.message === \"imageshack rejected the upload\") {\n    logger.warn(\"imageshack upload rejected\", { payload });\n    return fallbackUploader.publish(request);\n  }\n  throw err;\n}","preventionTips":["Keep ImageShack api_key/auth_token valid and rotated before expiry","Check upload quota and file-type restrictions before uploading","Log the error payload ImageShack returns alongside success:false","Configure a fallback image host for rejected uploads"],"tags":["api-error","imageshack","auth","upload-rejected"],"backgroundTag":"upload-rejected-by-host","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}