NOTE: This bug report is for Confluence Server. Using Confluence Cloud? See the corresponding bug report.

      Confluence CLI is being used, but it doesn't do much other than call the addAttachment Remote API service. The documentation says:

      Note that this uses a lot of memory - about 4 times the size of the attachment.

      Can attach files around 3 MBs, but problems when larger files. 13 MBs fails (see https://studio.plugins.atlassian.com/browse/CSOAP-114). I attempted 23 MBs with a 4GB java heap size. Same file can be attached via UI fine.

      java.lang.OutOfMemoryError: Java heap space; nested exception is: 
      	java.lang.OutOfMemoryError: Java heap space
      	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
      	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
      	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2938)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
      	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
      	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
      	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
      	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
      	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
      	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
      	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
      	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
      	at org.apache.axis.client.Call.invoke(Call.java:2767)
      	at org.apache.axis.client.Call.invoke(Call.java:2443)
      	at org.apache.axis.client.Call.invoke(Call.java:2366)
      	at org.apache.axis.client.Call.invoke(Call.java:1812)
      	at org.swift.common.soap.confluence.ConfluenceserviceV2SoapBindingStub.addAttachment(ConfluenceserviceV2SoapBindingStub.java:4857)
      	at org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1707)
      	at org.swift.confluence.cli.ConfluenceClient.addAttachment(ConfluenceClient.java:1646)
      	at org.swift.confluence.cli.ConfluenceClient.handleRequest(ConfluenceClient.java:471)
      	at org.swift.common.cli.AbstractRemoteClient.process(AbstractRemoteClient.java:119)
      	at org.swift.common.cli.CliClient.doWork(CliClient.java:225)
      	at org.swift.confluence.cli.ConfluenceClient.main(ConfluenceClient.java:115)
      

      Workaround

      • Attach the file through Confluence interface
      • Use "doattachfile.action" controller using a tool like curl, so your command line would look like:
      curl -F file_0=@<path to file> -F pageId=<confluence page id> -u <username>:<password> "http://Confluence-URL/pages/doattachfile.action"
      

      or,

            [CONFSERVER-23645] OutOfMemoryError with Remote API addAttachment service

            Atlassian Update - 11 April 2025

            Hi,

            At Atlassian, our goal is to ensure we’re providing the best experience for our customers. With our new Data Center strategy, Atlassian's focus is on security, compliance, and performance and is a key driver in prioritizing bugs. Closing the bugs that do not fall into those categories will allow us to focus on the ones in the most current versions of our products.

            This bug is being closed due to a lack of engagement in the last four years, including no new watchers, votes, or comments; this inactivity suggests a low impact.

            Please note the comments on this thread are not being monitored.

            You can read more about our bug fix policy here and how we prioritize bugs.

            To learn more about our recent investments in Confluence Data Center, please check our public roadmap and dashboards containing recently resolved issues, current work, and future plans.

            Kind regards,
            Confluence Data Center

            George Varghese added a comment - Atlassian Update - 11 April 2025 Hi, At Atlassian, our goal is to ensure we’re providing the best experience for our customers. With our new Data Center strategy, Atlassian's focus is on security, compliance, and performance and is a key driver in prioritizing bugs. Closing the bugs that do not fall into those categories will allow us to focus on the ones in the most current versions of our products. This bug is being closed due to a lack of engagement in the last four years , including no new watchers, votes, or comments; this inactivity suggests a low impact. Please note the comments on this thread are not being monitored. You can read more about our bug fix policy here and how we prioritize bugs. To learn more about our recent investments in Confluence Data Center, please check our public roadmap and dashboards containing recently resolved issues , current work, and future plans . Kind regards, Confluence Data Center

            Alexan Sedrakyan added a comment - - edited

            Any update on this issue? I'm not able to upload 63mb zip file to the Confluence Cloud.

            This solution works only for the local Confluence, not for cloud: https://confluence.atlassian.com/display/DISC/Upload+attachment+via+Python+XML-RPC

            For the Cloud I'm getting this error message:
            Traceback (most recent call last):
            File "upload-attachment.py", line 30, in <module>
            server.confluence2.addAttachment(token, page['id'], attachment, xmlrpclib.Binary(data));
            File "/usr/lib/python2.7/xmlrpclib.py", line 1240, in _call_
            return self._send(self._name, args)
            File "/usr/lib/python2.7/xmlrpclib.py", line 1599, in __request
            verbose=self.__verbose
            File "/usr/lib/python2.7/xmlrpclib.py", line 1280, in request
            return self.single_request(host, handler, request_body, verbose)
            File "/usr/lib/python2.7/xmlrpclib.py", line 1328, in single_request
            response.msg,
            xmlrpclib.ProtocolError: <ProtocolError for <....some URL...>/wiki/rpc/xmlrpc: 504 Gateway Time-out>

            Same error message with python3.4

            Also I'm not able to use mentioned workarounds.

            Alexan Sedrakyan added a comment - - edited Any update on this issue? I'm not able to upload 63mb zip file to the Confluence Cloud. This solution works only for the local Confluence, not for cloud: https://confluence.atlassian.com/display/DISC/Upload+attachment+via+Python+XML-RPC For the Cloud I'm getting this error message: Traceback (most recent call last): File "upload-attachment.py", line 30, in <module> server.confluence2.addAttachment(token, page ['id'] , attachment, xmlrpclib.Binary(data)); File "/usr/lib/python2.7/xmlrpclib.py", line 1240, in _ call _ return self._ send(self. _name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1599, in __request verbose=self.__verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1280, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1328, in single_request response.msg, xmlrpclib.ProtocolError: <ProtocolError for <....some URL...>/wiki/rpc/xmlrpc: 504 Gateway Time-out> Same error message with python3.4 Also I'm not able to use mentioned workarounds.

            Martin Cleaver added a comment - - edited

            Can someone please verify that the doattachfile.action workaround still works for them? It fails silently for me.
            Thanks, M.

            Martin Cleaver added a comment - - edited Can someone please verify that the doattachfile.action workaround still works for them? It fails silently for me. Thanks, M.

            I note that WebDAV is deprecated in new versions of Confluence. Is this bug going to get addressed?

            Martin Cleaver added a comment - I note that WebDAV is deprecated in new versions of Confluence. Is this bug going to get addressed?

            Daniel Varela Santoalla added a comment - Info here btw https://confluence.atlassian.com/display/DOC/Configuring+a+WebDAV+client+for+Confluence

            I am referring to the usual WebDAV access to Confluence that you can enable via the admin interface. In this case the size of the file it shouldn't matter too much from the client side as the process is exactly the same.

            Dashboard > Administration > WebDAV Configuration

            Daniel Varela Santoalla added a comment - I am referring to the usual WebDAV access to Confluence that you can enable via the admin interface. In this case the size of the file it shouldn't matter too much from the client side as the process is exactly the same. Dashboard > Administration > WebDAV Configuration

            HuseinA added a comment -

            Thought this could be useful as a workaround. Quoting fakraemer's suggestion to one of our users:

            The simplest solution might be to just use the "doattachfile.action" controller. I'd suggest using a tool like curl, so your command line would look like:

            curl -F file_0=@<path to file> -F pageId=<confluence page id> -u <username>:<password> "http://Confluence-URL/pages/doattachfile.action"
            

            HuseinA added a comment - Thought this could be useful as a workaround. Quoting fakraemer 's suggestion to one of our users: The simplest solution might be to just use the "doattachfile.action" controller. I'd suggest using a tool like curl , so your command line would look like: curl -F file_0=@<path to file> -F pageId=<confluence page id> -u <username>:<password> "http://Confluence-URL/pages/doattachfile.action"

            MattS added a comment -

            I think he's referring to storing a file in the OnDemand webdav area, as documented at https://confluence.atlassian.com/display/AOD/Uploading+Data+via+WebDAV
            I didn't know you could make the files there readable to non-authenticated users. Perhaps its some other webdav he's referring to?

            MattS added a comment - I think he's referring to storing a file in the OnDemand webdav area, as documented at https://confluence.atlassian.com/display/AOD/Uploading+Data+via+WebDAV I didn't know you could make the files there readable to non-authenticated users. Perhaps its some other webdav he's referring to?

            Hello Daniel,

            Are there good URL's providing instruction on the use of WebDAV to upload large files? At this point, better to have a "plan B" until this bug is addressed.

            Thanks for your feedback...

            Bill Cowden added a comment - Hello Daniel, Are there good URL's providing instruction on the use of WebDAV to upload large files? At this point, better to have a "plan B" until this bug is addressed. Thanks for your feedback...

            This is indeed a nasty bug but if it is any help for Bill I can tell you that we are using WebDAV to upload these large files without any problem.

            I know that it is not ideal to have to use both the CLI and WebDAV depending on the feature, but that works for us.

            Daniel Varela Santoalla added a comment - This is indeed a nasty bug but if it is any help for Bill I can tell you that we are using WebDAV to upload these large files without any problem. I know that it is not ideal to have to use both the CLI and WebDAV depending on the feature, but that works for us.

              Unassigned Unassigned
              bob.swift@charter.net Bob Swift
              Affected customers:
              10 This affects my team
              Watchers:
              18 Start watching this issue

                Created:
                Updated:
                Resolved: