Confluence had problems starting up
Asked by Paul-Louis:

Bonjour

Notre instance confluence fonctionnait a perfection jusqu'? hier 31.5 depuis une erreur appara?t sur la page d'acceuil.

DescriptionTimeLevelException

|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------|-------|---|
| Non Clustered Confluence: Database is being updated by another Confluence instance. Please see <http://confluence.atlassian.com/x/mwiyCg> for more details. | 2018-05-31 10:18:32 | fatal |   |

Dans le log atlassian-confluence:

2018-05-31 10:18:32,555 ERROR \[Caesium-1-3\] \[engine.jdbc.spi.SqlExceptionHelper\] logExceptions Duplicate entry '3211421' for key 'PRIMARY'  
2018-05-31 10:18:32,555 ERROR \[Caesium-1-3\] \[org.hibernate.internal.ExceptionMapperStandardImpl\] mapManagedFlushFailure HHH000346: Error during managed flush \[org.hibernate.exception.ConstraintViolationException: could not execute statement\]  
2018-05-31 10:18:32,556 WARN \[Caesium-1-3\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doCommit Commit failed. Rolling back. Error: Hibernate operation: could not execute statement; sql=n/a; SQL \[\]; Duplicate entry '3211421' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '3211421' for key 'PRIMARY'  
2018-05-31 10:18:32,556 WARN \[Caesium-1-3\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions:  
-\>\[com.atlassian.confluence.impl.schedule.caesium.SchedulerRunDetailsDao.addRunDetails\]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #692722503)  
2018-05-31 10:18:32,557 ERROR \[Caesium-1-3\] \[scheduler.caesium.impl.SchedulerQueueWorker\] executeJob Unhandled exception thrown by job QueuedJob\[jobId=ClusterSafetyJob,deadline=1527754712314\]  
org.springframework.dao.DataIntegrityViolationException: Hibernate operation: could not execute statement; sql=n/a; SQL \[\]; Duplicate entry '3211421' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '3211421' for key 'PRIMARY'

Dans le log synchrony:

2018-05-31 10:15:36,089 DEBUG \[161:StdOutHandler \[/opt/atlassian/confluence/jre/bin/java\]\] {"synchrony":{"request":{"remote-addr":"127.0.0.1","uri":"/synchrony/heartbeat","request-method":"get","query-string":null},"response":{"status":200},"ns":"synchrony.middleware.logging","level":"info","message":"synchrony.middleware.logging \[info\] null"}}  
2018-05-31 10:16:06,234 DEBUG \[161:StdOutHandler \[/opt/atlassian/confluence/jre/bin/java\]\] {"synchrony":{"request":{"remote-addr":"127.0.0.1","uri":"/synchrony/heartbeat","request-method":"get","query-string":null},"response":{"status":200},"ns":"synchrony.middleware.logging","level":"info","message":"synchrony.middleware.logging \[info\] null"}}  
2018-05-31 10:16:36,102 DEBUG \[161:StdOutHandler \[/opt/atlassian/confluence/jre/bin/java\]\] {"synchrony":{"request":{"remote-addr":"127.0.0.1","uri":"/synchrony/heartbeat","request-method":"get","query-string":null},"response":{"status":200},"ns":"synchrony.middleware.logging","level":"info","message":"synchrony.middleware.logging \[info\] null"}}  
2018-05-31 10:17:06,088 DEBUG \[161:StdOutHandler \[/opt/atlassian/confluence/jre/bin/java\]\] {"synchrony":{"request":{"remote-addr":"127.0.0.1","uri":"/synchrony/heartbeat","request-method":"get","query-string":null},"response":{"status":200},"ns":"synchrony.middleware.logging","level":"info","message":"synchrony.middleware.logging \[info\] null"}}  
2018-05-31 10:17:36,088 DEBUG \[161:StdOutHandler \[/opt/atlassian/confluence/jre/bin/java\]\] {"synchrony":{"request":{"remote-addr":"127.0.0.1","uri":"/synchrony/heartbeat","request-method":"get","query-string":null},"response":{"status":200},"ns":"synchrony.middleware.logging","level":"info","message":"synchrony.middleware.logging \[info\] null"}}  
2018-05-31 10:18:06,089 DEBUG \[161:StdOutHandler \[/opt/atlassian/confluence/jre/bin/java\]\] {"synchrony":{"request":{"remote-addr":"127.0.0.1","uri":"/synchrony/heartbeat","request-method":"get","query-string":null},"response":{"status":200},"ns":"synchrony.middleware.logging","level":"info","message":"synchrony.middleware.logging \[info\] null"}}


Answers:
author: Danyal Iqbal
body: could not execute statement; sql=n/a; SQL \[\]; Duplicate entry '3211421' for key 'PRIMARY'; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '3211421' for key 'PRIMARY'

There is a duplicate entry in the table which is forbidden by the schema. Restore the database to a working backup and retry or contact atlassian support. You have managed to corrupt the db-kudos- you need support.

comments: author: Paul-Louis
body: Hello

Yes is what i do and now confluence restarted

Best regards


author: Shannon S
body: Good morning, Paul-Louis,

The error leads you to this article, which tells you how to fix the problem:

* [Confluence will not start due to fatal error in Confluence cluster](https://confluence.atlassian.com/confkb/confluence-will-not-start-due-to-fatal-error-in-confluence-cluster-179439771.html)

Can you have a look at that and let us know if you have any trouble?

Regards,

Shannon

comments: author: Paul-Louis
body: Hello Shannon

I have read this article but i dont find any condition no Deadlock no OutOfMemory no duplicate confluence process finally i have stopped and restarted multiple time and now the service is restarted.

The service run on a VM with this standard config

1 CPU 1050MHz

2048 MB Ram

Is it enouth or maybe in case of race condition this VM can be overloaded.

The confluence instance is small 10 users and not big data.

Best regards.


author: Shannon S
body: Paul-Louis,

Can you confirm if your instance is a clustered environment, or a non-clustered environment? Are you using Data Center or a single node?

Lastly, what type of database are you running on?

Shannon


author: Paul-Louis
body: Shannon,

Yes i confirm that is a non cluster environment and single node.

Database is MySql 5.7.21

Best


Tags: confluence-server

server