{"record":{"id":"37157fb0b294b00d","repo":"zylon-ai/private-gpt","slug":"image-size-image-size-exceeds-maximum-allowed-si","errorCode":null,"errorMessage":"Image size {image_size} exceeds maximum allowed size of {settings().chat.maximum_blob_size} bytes.","messagePattern":"Image size (.+?) exceeds maximum allowed size of (.+?) bytes\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/chat/input_models.py","lineNumber":904,"sourceCode":"        if isinstance(content, str):\n            blocks.append(LITextBlock(text=content))\n            content_blocks: Sequence[ContentBlockType] = []\n        elif isinstance(content, BaseContentBlock):\n            content_blocks = [cast(ContentBlockType, content)]\n        else:\n            content_blocks = content or []\n\n        for block in content_blocks:\n            if isinstance(block, TextBlock):\n                blocks.append(LITextBlock(text=block.text))\n            elif isinstance(block, MidConvSystemBlock):\n                text = \"\\n\".join(b.text for b in block.content)\n                blocks.append(LITextBlock(text=text))\n            elif isinstance(block, ImageBlock):\n                image_bytes = load_file_from_uri(block.source.get_data())\n                image_size = len(image_bytes.read())\n                if image_size > settings().chat.maximum_blob_size:\n                    raise ValueError(\n                        f\"Image size {image_size} exceeds maximum \"\n                        f\"allowed size of {settings().chat.maximum_blob_size} bytes.\"\n                    )\n\n                image_bytes.seek(0)\n                blocks.append(\n                    LIImageBlock(\n                        image=image_bytes.read(),\n                        image_mimetype=block.source.get_media_type(),\n                    )\n                )\n            elif isinstance(block, AudioBlock):\n                audio_bytes = load_file_from_uri(block.source.get_data())\n                audio_size = len(audio_bytes.read())\n                if audio_size > settings().chat.maximum_blob_size:\n                    raise ValueError(\n                        f\"Audio size {audio_size} exceeds maximum \"\n                        f\"allowed size of {settings().chat.maximum_blob_size} bytes.\"","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/chat/input_models.py#L886-L922","documentation":"Raised by POST /skills/{skill_id}/versions when the skill exists but is readonly. Readonly skills accept no new versions through the public API; the route returns 403 before processing the multipart uploads.","triggerScenarios":"Uploading a new version for a builtin/admin-managed skill flagged readonly; automation iterating over all skills and attempting version bumps.","commonSituations":"Bulk version scripts that don't filter on the readonly flag; product change marking stock skills readonly after upgrade.","solutions":["Filter out readonly skills before version operations.","For customized content, clone the readonly skill under a new id and version that clone.","Surface the readonly flag in the UI to disable the upload form."],"exampleFix":"// before\nfor (const s of allSkills) await skillsApi.createVersion(s.id, col, files);\n\n// after\nfor (const s of allSkills) {\n  if (!s.readonly) await skillsApi.createVersion(s.id, col, files);\n}","handlingStrategy":"type-guard","validationCode":"const skill = await skillsApi.get(id, collection);\nif (!skill || skill.readonly) { throw new Error('cannot version this skill'); }","typeGuard":"const isVersionable = (s) => s != null && !s.readonly;","tryCatchPattern":"try { await skillsApi.createVersion(id, collection, files); }\ncatch (e) {\n  if (e.status === 403 && /readonly/.test(e.detail)) return null; // skip\n  throw e;\n}","preventionTips":["Exclude readonly skills from bulk version scripts","Clone readonly skills to a writable id when customization is needed","Disable version-upload UI for readonly entries"],"tags":["fastapi","http-403","skills","readonly","versioning"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}