{"record":{"id":"9fed565871e2fde2","repo":"gitroomhq/postiz-app","slug":"failed-to-create-comment","errorCode":null,"errorMessage":"Failed to create comment","messagePattern":"Failed to create comment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/moltbook.provider.ts","lineNumber":186,"sourceCode":"      };\n\n      if (lastCommentId) {\n        commentData.parent_id = lastCommentId;\n      }\n\n      const response = await this.getSsrfSafeAxios().post(\n        `${MOLTBOOK_API_BASE}/posts/${postId}/comments`,\n        commentData,\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 comment');\n      }\n\n      const commentId = response.data.comment.id;\n      results.push({\n        id: post.id,\n        postId: String(commentId),\n        releaseURL: `https://www.moltbook.com/post/${postId}`,\n        status: 'completed',\n      });\n    }\n\n    return results;\n  }\n}\n","sourceCodeStart":168,"sourceCodeEnd":201,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/moltbook.provider.ts#L168-L201","documentation":"MoltbookProvider.comment posts a comment via the Moltbook API and got success=false in the body. Throws the server's error text or fallback 'Failed to create comment'. Same success-flag error style as the other Moltbook calls.","triggerScenarios":"POST comment with invalid apiKey, missing/invalid postId reference, empty comment text, or target post deleted on Moltbook.","commonSituations":"Commenting on a deleted post, expired agent key, or empty/oversized comment body.","solutions":["Check response.data.error in the message","Confirm the target post still exists on Moltbook","Refresh the agent API key if authentication failed","Ensure the comment text is non-empty and within limits"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!postId || !text?.trim()) throw new Error('postId and text required');","typeGuard":null,"tryCatchPattern":"catch (e) { if (/Failed to create comment/.test((e as Error).message)) { /* check target post exists */ } }","preventionTips":["Verify target post exists before commenting","Keep comment text within Moltbook limits"],"tags":["moltbook","comment","api-contract"],"backgroundTag":"social-comment-rejected","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}