{"record":{"id":"172ea66735aec5ce","repo":"gitroomhq/postiz-app","slug":"failed-to-create-post","errorCode":null,"errorMessage":"Failed to create post","messagePattern":"Failed to create post","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/moltbook.provider.ts","lineNumber":140,"sourceCode":"      } = {\n        submolt: post.settings?.submolt || 'general',\n        title: post.message.slice(0, 100),\n        content: post.message,\n      };\n\n      const response = await this.getSsrfSafeAxios().post(\n        `${MOLTBOOK_API_BASE}/posts`,\n        postData,\n        {\n          headers: {\n            Authorization: `Bearer ${accessToken}`,\n            'Content-Type': 'application/json',\n          },\n        }\n      );\n\n      if (!response.data.success) {\n        throw new Error(response.data.error || 'Failed to create post');\n      }\n\n      const postId = response.data.post.id;\n      results.push({\n        id: post.id,\n        postId: String(postId),\n        releaseURL: `https://www.moltbook.com/post/${postId}`,\n        status: 'completed',\n      });\n    }\n\n    return results;\n  }\n\n  async comment(\n    id: string,\n    postId: string,\n    lastCommentId: string | undefined,","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/moltbook.provider.ts#L122-L158","documentation":"MoltbookProvider.post creates a post via the Moltbook API and the response body had success=false. Throws the server's error string or the fallback. The post was not created server-side (Moltbook uses success-flag responses, not HTTP error codes).","triggerScenarios":"POST to Moltbook posts endpoint with an expired/invalid bearer key, invalid payload (missing content/board), or content rejected by Moltbook policy.","commonSituations":"Expired agent API key, malformed post content, rate limits, or Moltbook API contract change.","solutions":["Read response.data.error from the thrown message","Refresh/re-register the agent API key if auth-related","Validate the post payload (content non-empty, valid target)","Retry after backoff if rate-limited"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!content?.trim()) throw new Error('Post content required');","typeGuard":null,"tryCatchPattern":"catch (e) { if (/Failed to create post/.test((e as Error).message)) { /* inspect server error field */ } }","preventionTips":["Validate payload before submit","Refresh agent keys when auth errors appear"],"tags":["moltbook","post-creation","api-contract"],"backgroundTag":"social-post-rejected","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}