can1357/oh-my-pi · error

imageshack rejected the upload

Error message

imageshack rejected the upload

What it means

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.

Source

Thrown at packages/coding-agent/src/blob-broker/uploaders-image-hosts.ts:129

function createImageShackUploader(config: DestinationRuntimeConfig): BlobUploader {
	const apiKey = requireCredential(config, "apiKey");
	const authToken = requireCredential(config, "authToken");
	const isPublic = optionBoolean(config, "public", false) ?? false;

	return {
		destination: "imageshack",
		async upload(request) {
			const response = await fetchFor(config)(IMAGESHACK_UPLOAD_URL, {
				method: "POST",
				body: multipartFile(request, "file", {
					api_key: apiKey,
					auth_token: authToken,
					public: isPublic ? "y" : "n",
				}),
			});
			const payload = await jsonResponse(response, "imageshack");
			if (payload.success !== true) throw new Error("imageshack rejected the upload");
			const result = nestedRecord(payload, "result", "imageshack");
			if (!Array.isArray(result.images) || result.images.length === 0) {
				throw new Error("imageshack response did not include an image");
			}
			const image = responseRecord(result.images[0], "imageshack");
			const server = image.server;
			const bucket = image.bucket;
			const filename = image.filename;
			if (
				(typeof server !== "string" && typeof server !== "number") ||
				(typeof bucket !== "string" && typeof bucket !== "number") ||
				typeof filename !== "string" ||
				!filename
			) {
				throw new Error("imageshack response did not include direct image coordinates");
			}
			const url = directUrl(`https://imagizer.imageshack.com/a/img${server}/${bucket}/${filename}`, "imageshack");
			return publication("imageshack", request, url, {

View on GitHub (pinned to 9690622007)

Solutions

  1. Verify the imageshack api_key and auth_token are valid and unexpired
  2. Log the full payload — ImageShack usually includes an error message alongside success:false
  3. Check quota/plan limits on the ImageShack account
  4. Retry with another image host via fallback
Defensive patterns

Strategy: try-catch

Validate before calling

const payload = await response.clone().json();
if (payload?.success !== true) {
  throw new Error("imageshack upload will fail: " + JSON.stringify(payload?.error ?? payload));
}

Try / catch

try {
  const pub = await broker.publish(request);
} catch (err) {
  if (err.message === "imageshack rejected the upload") {
    logger.warn("imageshack upload rejected", { payload });
    return fallbackUploader.publish(request);
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: Expired or wrong api_key; missing auth_token for private uploads; exceeding the host's upload limits; uploading a disallowed file type.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/6cc8f6fc3ef44a28. Report an issue: GitHub.