Attachment upload failed with 'Communications link failure during commit()' error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

  1. Using MySQL

  2. Attachments are stored in the database

The following appears in the atlassian-confluence.log:

1 2 3 4 2011-07-21 10:59:34,649 ERROR [TP-Processor36] [webwork.dispatcher.multipart.MultiPartRequest] <init> org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly -- url: /confluence/pages/doattachfile.action | userName: admin | referer: http://confluence url/pages/doattachfile.action?pageId=888888 org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:367)

Which was followed by:

1 2 3 4 5 6 2011-07-21 10:59:34,663 WARN [TP-Processor36] [v2.c3p0.impl.C3P0PooledConnectionPool] doMarkPoolStatus A ConnectionTest has failed, reporting that all previously acquired Connections are likely invalid. The pool will be reset. -- url: /confluence/pages/doattachfile.action | page: 888888 | userName: admin | referer: http://confluence url/pages/doattachfile.action?pageId=888888 | action: doattachfile 2011-07-21 10:59:34,665 ERROR [TP-Processor36] [sf.hibernate.transaction.JDBCTransaction] commit Commit failed -- url: /confluence/pages/doattachfile.action | page: 888888 | userName: admin | referer: http://confluence url/pages/doattachfile.action?pageId=888888 | action: doattachfile com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during commit(). Transaction resolution unknown. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Cause

MySQL discovered that the SQL Query was taking too long to execute as Confluence was trying to save the attachment into the database and terminated the query. This is usually because the interactive_timeout was set too low.

Resolution

  1. Execute the following to find out how long the MySQL system timeout variables are set

    1 show variables like "%timeout%";

    ℹ️ The default value for interactive_timeout is 28800 seconds.

  2. If lower than default, set it back to 28800 seconds with this (also change the value in your my.ini or my.cnf file):

    1 set global interactive_timeout=28800;
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.