gitroomhq/postiz-app · error · Error

Photo upload failed: ${errorText}

Error message

Photo upload failed: ${errorText}

What it means

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).

Source

Thrown at libraries/nestjs-libraries/src/integrations/social/mewe.provider.ts:229

    const form = new FormData();
    form.append('file', blob, fileName);

    const uploadResponse = await fetch(
      `${this.meweHost}/api/dev/photo/upload`,
      {
        method: 'POST',
        headers: {
          'X-App-Id': process.env.MEWE_APP_ID!,
          'X-Api-Key': process.env.MEWE_API_KEY!,
          Authorization: `Bearer ${accessToken}`,
        },
        body: form,
      }
    );

    if (!uploadResponse.ok) {
      const errorText = await uploadResponse.text();
      throw new Error(`Photo upload failed: ${errorText}`);
    }

    const uploadData = await uploadResponse.json();
    return uploadData.id;
  }

  async post(
    id: string,
    accessToken: string,
    postDetails: PostDetails<MeweDto>[],
    integration: Integration
  ): Promise<PostResponse[]> {
    const [firstPost] = postDetails;
    const postType = firstPost.settings.postType || 'group';
    const groupId = firstPost.settings.group;

    // Upload photos if present (exclude videos)
    const imageMedia =

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Inspect errorText in the thrown message for the exact MeWe reason
  2. Re-authenticate the MeWe integration (session cookies expire)
  3. Reduce image size/format (JPEG/PNG under MeWe limits)
  4. Check for upstream code changes if MeWe altered its private API
Defensive patterns

Strategy: try-catch

Try / catch

catch (e) { if (/^Photo upload failed:/.test((e as Error).message)) { /* parse MeWe reason from text */ } }

Prevention

When it happens

Trigger: Multipart photo upload to MeWe returns non-2xx — expired session, unsupported/corrupt image, size limit, or endpoint change in MeWe's private API.

Common situations: MeWe is an unofficial integration: private API endpoints/headers change without notice; also invalid/expired auth cookies and oversized images.

Related errors


AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27). Data as JSON: /api/errors/78ffbb6db892a86d. Report an issue: GitHub.