{"record":{"id":"78ffbb6db892a86d","repo":"gitroomhq/postiz-app","slug":"photo-upload-failed-errortext","errorCode":null,"errorMessage":"Photo upload failed: ${errorText}","messagePattern":"Photo upload failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts","lineNumber":229,"sourceCode":"    const form = new FormData();\n    form.append('file', blob, fileName);\n\n    const uploadResponse = await fetch(\n      `${this.meweHost}/api/dev/photo/upload`,\n      {\n        method: 'POST',\n        headers: {\n          'X-App-Id': process.env.MEWE_APP_ID!,\n          'X-Api-Key': process.env.MEWE_API_KEY!,\n          Authorization: `Bearer ${accessToken}`,\n        },\n        body: form,\n      }\n    );\n\n    if (!uploadResponse.ok) {\n      const errorText = await uploadResponse.text();\n      throw new Error(`Photo upload failed: ${errorText}`);\n    }\n\n    const uploadData = await uploadResponse.json();\n    return uploadData.id;\n  }\n\n  async post(\n    id: string,\n    accessToken: string,\n    postDetails: PostDetails<MeweDto>[],\n    integration: Integration\n  ): Promise<PostResponse[]> {\n    const [firstPost] = postDetails;\n    const postType = firstPost.settings.postType || 'group';\n    const groupId = firstPost.settings.group;\n\n    // Upload photos if present (exclude videos)\n    const imageMedia =","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts#L211-L247","documentation":"MeWeProvider.uploadPhoto posts the multipart form to MeWe's photo upload endpoint and the response was not ok. The thrown Error includes MeWe's raw error response text (errorText), which usually carries the actual reason (auth, quota, file type).","triggerScenarios":"Multipart photo upload to MeWe returns non-2xx — expired session, unsupported/corrupt image, size limit, or endpoint change in MeWe's private API.","commonSituations":"MeWe is an unofficial integration: private API endpoints/headers change without notice; also invalid/expired auth cookies and oversized images.","solutions":["Inspect errorText in the thrown message for the exact MeWe reason","Re-authenticate the MeWe integration (session cookies expire)","Reduce image size/format (JPEG/PNG under MeWe limits)","Check for upstream code changes if MeWe altered its private API"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (/^Photo upload failed:/.test((e as Error).message)) { /* parse MeWe reason from text */ } }","preventionTips":["Validate image type/size before upload","Re-authenticate MeWe sessions proactively; unofficial API changes often"],"tags":["mewe","photo-upload","unofficial-api"],"backgroundTag":"media-upload-failed","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}