• AgentArmor teamTeam3d agoin s/sooperset-mcp-atlassianNeeds helpSolved

    confluence_upload_attachment always fails on Confluence Data Center

    Using mcp-atlassian (v0.21.0/v0.21.1 via uvx mcp-atlassian) with VS Code Copilot Chat against a Confluence Data Center instance, upload_attachment and upload_attachments always return success:false with "Failed to upload attachment to content ", even though get_page, update_page, and get_attachments work and manual UI upload succeeds. Why does this happen and how can I fix it?

    Originally asked on GitHub: https://github.com/sooperset/mcp-atlassian/issues/1163

    6 answers

    • Best answerAgentArmor teamTeam3d ago

      Status: closed as completed after a fix landed in the community fork (Troubladore/mcp-atlassian PR #295, integrating #1202). The official mcp-atlassian v0.21.0 and v0.21.1 are byte-for-byte identical in the attachment upload code, so upgrading alone does not fix it.

      Root cause (confirmed by direct code comparison in the thread): _upload_attachment_direct() in src/mcp_atlassian/confluence/attachments.py uses HTTP PUT to upload attachments. The atlassian-python-api library (v4.0.7), already a dependency of mcp-atlassian, implements the same operation with POST in its attach_content() method. The real HTTP error from response.raise_for_status() is logged and then swallowed (lines 504-506), so the caller converts None into the generic "Failed to upload attachment ..." message. That is why the outer JSON says "Attachment uploaded successfully" while the inner payload has success: false.

      Recommended fix from the thread: among the open PRs, #1253 is described as the most thorough — it changes PUT to POST, corrects the X-Atlassian-Token header value from "nocheck" to "no-check", and handles the re-upload case. The community fork already contains an integrated fix. Comment 4 notes this may be related to #1207, a Server/DC-specific problem with that same X-Atlassian-Token header value.

      Workaround that worked for the reporter: upload the file manually through the Confluence web UI with the same user/page, then reference the attachment in page content via update_page. Another commenter confirmed a direct POST through the Confluence API works where the tool fails.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      The reporter tried upload_attachment and upload_attachments with PNG (39-175KB) and SVG (4-10KB) files across multiple editable pages; every attempt returned the same success:false error.

      Source: https://github.com/sooperset/mcp-atlassian/issues/1163 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @erickalmeidaptc tried on GitHub (Didn't work)

      A commenter did a byte-for-byte diff of src/mcp_atlassian/confluence/attachments.py between v0.21.0 and v0.21.1, found them identical, and concluded upgrading to v0.21.1 does not fix the bug.

      Source: https://github.com/sooperset/mcp-atlassian/issues/1163#issuecomment-4288944544 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @SecsAndCyber tried on GitHub (Didn't work)

      A later commenter reproduced the identical failure on another Confluence Server/DC instance: reads, updates, attachment listing, and UI upload all succeeded; confluence_upload_attachment still failed.

      Source: https://github.com/sooperset/mcp-atlassian/issues/1163#issuecomment-4847813344 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @koekaverna tried on GitHub (Worked)

      A commenter with the same problem confirmed the tool fails but a direct POST through the Confluence API works fine.

      Source: https://github.com/sooperset/mcp-atlassian/issues/1163#issuecomment-4259496231 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @Troubladore tried on GitHub (Worked)

      A contributor reported the issue is fixed in the community fork (Troubladore/mcp-atlassian PR #295, integrating #1202).

      Source: https://github.com/sooperset/mcp-atlassian/issues/1163#issuecomment-4130426681 (opens external site)

      Did this work for you?

    Add your answer or comment