• Community
  • Products
  • Confluence
  • Questions
  • Confluence. Error while uploading attachment. java.lang.RuntimeException: There was a problem evicting or flushing an AttachmentData object

Confluence. Error while uploading attachment. java.lang.RuntimeException: There was a problem evicting or flushing an AttachmentData object

confluence 4.3 + mysql 5.5 + apache 2.2 on windows server 2008 r2

Attachment storage = database

Attachment max size = 20.00 MB

There is a reqular and from time to time reproducible problem (but sometimes it's uploaded correctly) while uploading pdf file about 900kb:


System Error

A system error has occurred — our apologies!

For immediate troubleshooting, consult our knowledge base for a solution.

If you would like to receive support from Atlassian's support team, ask your Confluence administrator to create a support issue on Atlassian's support system with the following information:

a description of your problem and what you were doing at the time it occurred
a copy of the error and system information found below
a copy of the application logs (if possible).

Your Confluence administrator can use the support request form to create a support ticket which will include this information.

We will respond as promptly as possible.
Thank you!

Return to site homepage…
Cause

java.lang.RuntimeException: There was a problem evicting or flushing an AttachmentData object:
at com.atlassian.confluence.pages.persistence.dao.hibernate.HibernateAttachmentDataDao.save(HibernateAttachmentDataDao.java:68)

caused by: net.sf.hibernate.exception.GenericJDBCException: could not insert: [com.atlassian.confluence.pages.AttachmentData#8323583]
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)

caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 47 milliseconds ago. The last packet sent successfully to the server was 47 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor605.newInstance(Unknown Source)

caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)

1 answer

1 accepted

This widget could not be displayed.

Hi Alex,

It is quite difficult to pin point the cause of the issue with only partial stack trace to review. However this particular line:

caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet successfully received from the server was 47 milliseconds ago. The last packet sent successfully to the server was 47 milliseconds ago.
at sun.reflect.GeneratedConstructorAccessor605.newInstance(Unknown Source)

Seems to indicate that Confluence was not able to connect to your database in the process of attaching the attachment due to communication failure. We highly recommend you to review our documentation and see if the provided resolution help stabilize your database.

Hope it help.

Cheers,
Septa Cahyadiputra

Thanks for your reply.

There are lots of suggestions in common on link provided. Could you help to find out the particular reason of the problem, then I'll be able concentrate on it.

I did follow recommendations step 4:

threads from conf\server.xml

maxProcessors="75" enableLookups="false" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"

db connections from cfg.xml

<property name="hibernate.c3p0.max_size">60</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.min_size">0</property>
<property name="hibernate.c3p0.timeout">30</property>

And the problem soon had been reproduced

Again, it would be difficult to pin point without the rest of the data and the mentioned additional information. HOwever for a start you can try to increase the max connection as mentioned on steps 4

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published Jul 30, 2018 in Confluence

How Manon Soubies-Camy uses Confluence + Trello to organize webinar notes and her knitting stash

@Manon Soubies-Camy is an engineer who has been an avid Atlassian user since 2014. She helps companies of all sizes transform the way they work with the Atlassian stack, including Jira and Confl...

857 views 8 13
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you