Confluence stucks while install or upgrade addons
Asked by michael.klinger:

We are running several confluence intsances in each instance we got the same problem.

I have got several error Messages in each confluence log while i am trying to install or update any addon. I have already successfully installed some addons and it worked fine until now.

I have tried to clean the plugin cache with no success.

I have taken some scrrenshots from the confluence log file below. Maybe you got a hint for me to solve this problem. Kind regards and thank you :)

![Confluence_error.PNG](/t5/image/serverpage/image-id/59866iFDFE4B6B6CE030D9/image-size/large?v=v2&px=999 "Confluence_error.PNG")![Confluence_error_2.PNG](/t5/image/serverpage/image-id/59868i3E1A4DE968EAF2B0/image-size/large?v=v2&px=999 "Confluence_error_2.PNG")

And it stucks like this :

![Confluence_error_3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/59870iB4D851AE03EC3880/image-size/large?v=v2&px=999 "Confluence_error_3.PNG")


Answers:
author: Stephen Sifers
body: Hello Michael and welcome to the Community!

Thank you for providing the steps you've taken this far along with the log output, this helps to understand what is happening with your instance. From the logs, I can see there is an issue with the database connection itself which is causing your problems. Depending on how you've configured your database connection, I would advise reviewing your available JDBC connections to ensure you're not reaching the configured limits. There is an article which discusses your issue at [Unable to start due to net.sf.hibernate.exception.GenericJDBCException Cannot open connection](https://confluence.atlassian.com/confkb/unable-to-start-due-to-net-sf-hibernate-exception-genericjdbcexception-cannot-open-connection-128843899.html) and there is an article on how to address your connection pool at [Confluence slows and times out during periods of high load due to database connection pool](https://confluence.atlassian.com/confkb/confluence-slows-and-times-out-during-periods-of-high-load-due-to-database-connection-pool-146407630.html).

Please review the above articles for your issues and let us know if you're able to make progress.

Regards,  
Stephen Sifers

comments: author: michael.klinger
body: Thanks for your fast reply Stephen :).

So i have checked both articles and i have tried both ways with no success. I have checked my postgres database as well. So all tables are available (for examples confluence user, spaces ....) so there should be a database connection. The database interuption only appears if i try to install a new plugin and i need to restart confluence. The strange think is i have allready installed and bought several addons and it worked fine until now. If i restart confluence and i enter the postgres container i see all tables but no plugintable but there should be one i guess ? .

Strangely if i try to install a new plugin the plugintable appears and i got some error message from the container like the picture below. Maybe there is a porblem with the Universal Plugin Manager ? We are running confluence 6.13.4 and now the Universal plugin Manager version 3.0.3. I have seen the license in confluence.cfg.xml is different to the license in the shared home folder but porbably thats not the problem.

Thank you :)

-The first picture below appears when i am trying to enter the plugindata table in postgres container

![postgres.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/60112i2A0FD92DC471137F/image-dimensions/634x103?v=v2 "postgres.PNG")![postgres2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/60113i83F70552219B827C/image-dimensions/975x41?v=v2 "postgres2.PNG")![posgres3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/60114i9D1E657D86A75DAC/image-size/large?v=v2&px=999 "posgres3.PNG")


author: Stephen Sifers
body: Hello Michael,

To understand a bit more, we want to know what is within your configuration files for your database connection. This will help us to understand what is configured along with helping to recreate the issue.

Please let us know what you have set for the following lines within your confluence.cfg.xml file:

* \<property name="hibernate.c3p0.max_size"\>

Please let us know what your max threads are also set to within your server.xml file:

* maxThreads=" "

This will help to understand your current configuration and to understand what can be adjusted within tested to recreate the issue.

Regards,  
Stephen Sifers


author: michael.klinger
body: redacted


author: Stephen Sifers
body: Hello Michael,

I had to remove your recent screenshot due to secure content being displayed. If you could please sanitize your content prior to publishing as we do not wish you to become a victim of someone exploiting your system due to leaked keys.

Regards,  
Stephen Sifers


author: michael.klinger
body: Damn i havent seen this :D thanks man.

* \<property name="hibernate.c3p0.max_size"\> is **60**

and

* maxThreads=" " is **48**


author: Stephen Sifers
body: Hello Michael,

Thanks for reporting your settings. I would like to make an adjustment to your settings and test the issue again. Please make the following changes:

* \<property name="hibernate.c3p0.max_size"\>
  * Set to 250
* maxThreads=" "
  * Set to 200

Once these have been changes, please stop and start Confluence and retest the UPM to see if the same error is present. Please attempt to test this within your staging instance to avoid disruption to production. More about a staging instance may be found at [Create a staging environment for upgrading Confluence](https://confluence.atlassian.com/doc/create-a-staging-environment-for-upgrading-confluence-866094180.html).

We look forward to hearing back to help resolve your issue with your add-ons.

Regards,  
Stephen Sifers


author: michael.klinger
body: Hey Stephen thanks for your help.

Unfortunetly no success. I have increased the hibernatec3po.max_size to 250.

But i could not change the server.xml. Evertytime i restart confluence, the server.xml maxThread was reset to the old value 48.

Now if i want to install an addon there was a sign for a short time "client must be authenticated to access this resource" and after that confluence links me to the error Page below.

![new.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/60236i808913E7981EEB03/image-size/large?v=v2&px=999 "new.PNG")


author: Stephen Sifers
body: Hello Michael,

We need to figure out why your server.xml is unable to be written to and saved. The limit of 48 could be causing this issue and needs to be adjusted to the value of 200.

Additionally, the screenshot you sent is still referring to a JDBC connection issue. Along with Confluence having an issue while attempting or maintaining a connection to your database. Additional steps to review out be as follows:

1. Check that your database is up and running. If the problem has happened after a period of Confluence usage, check to make sure the database indices are installed correctly.
2. Find out why your Confluence server cannot establish a connection to the database.
3. Check that your username and password for your database is correct and hasn't been changed. This is configured in confluence.cfg.xml.
4. Check your DB connection pool settings. See [Confluence slows and times out during periods of high load due to database connection pool](https://confluence.atlassian.com/confkb/confluence-slows-and-times-out-during-periods-of-high-load-due-to-database-connection-pool-146407630.html).

Source documentation: [Unable to start due to net.sf.hibernate.exception.GenericJDBCException Cannot open connection](https://confluence.atlassian.com/confkb/unable-to-start-due-to-net-sf-hibernate-exception-genericjdbcexception-cannot-open-connection-128843899.html)

Regards,  
Stephen Sifers


author: michael.klinger
body: ++Hey :).++

++Thanks for your support. Quite a long time ago. So it worked for some times. But no i had the same issue again with lucidchart and had to restart our applications. What I have forgotten the say is that we run confluence jira and bitbucket with nginx. Maybe I have to increase the upload size or the client body size?++

++Greets and kind regards++

++Michael++


author: Stephen Sifers
body: Hello Michael,

Thank you for follow up here. I would be interested to know if you're experiencing the same issue within a staging environment as well. This would also help to rule out any interference from nginx which you mentioned. If you've not already setup a staging instance we would suggest doing so to test future updates and upgrades. Please review the article on how to accomplish this (if you've not done so already); [Create a staging environment for upgrading Confluence](https://confluence.atlassian.com/doc/create-a-staging-environment-for-upgrading-confluence-866094180.html).

Regards,  
Stephen Sifers


Tags: confluence-server

server