Unable to communicate with server. Saving is not possible at the moment.
Asked by andreas.vennemann:

Hi everyone,

after we uploaded our Database to a new MYSQL Server we get the error

"Unable to communicate with server. Saving is not possible at the moment." When we try to save a page.

* **Confluence Version 6.1.3**
* **MySQL Version 5.7.22-1debian9**

**Logs from atlassian-confluence.log**

```
2018-05-29 08:31:55,187 WARN [http-nio-8090-exec-9] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
  ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1896333977)
 -- url: /rest/mywork/1/notification | traceId: 289f5d20a211209d | userName: firstname.lastname
2018-05-29 08:31:55,188 ERROR [http-nio-8090-exec-9] [mywork.host.rest.ExceptionLogger] toResponse Exception thrown from REST resource
 -- url: /rest/mywork/1/notification | traceId: 289f5d20a211209d | userName: firstname.lastname
com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
Database:
    - name:MySQL
    - version:5.7.22
    - minor version:7
    - major version:5
Driver:
    - name:MySQL Connector Java
    - version:mysql-connector-java-5.1.40 ( Revision: 402933ef52cad9aa82624e80acbea46e3a701ce6 )

java.sql.SQLException: Field 'ID' doesn't have a default value
    at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:94)
    at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.create(TenantAwareActiveObjects.java:266)
    at sun.reflect.GeneratedMethodAccessor2592.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
    at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
    at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy1672.create(Unknown Source)
    at com.atlassian.mywork.host.dao.ao.AONotificationDao.create(AONotificationDao.java:63)
    at com.atlassian.mywork.host.dao.ao.AONotificationDao.create(AONotificationDao.java:58)
    at sun.reflect.GeneratedMethodAccessor2599.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:60)
    ...
Caused by: java.sql.SQLException: Field 'ID' doesn't have a default value
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
    at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
    at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5098)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
    at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:410)
    at net.java.ao.DatabaseProvider.executeInsertReturningKey(DatabaseProvider.java:1947)
    at net.java.ao.DatabaseProvider.insertReturningKey(DatabaseProvider.java:1861)
    at net.java.ao.EntityManager.create(EntityManager.java:366)
    at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:92)
    ... 386 more
2018-05-29 08:31:55,194 INFO [http-nio-8090-exec-9] [atlassian.confluence.status.SystemErrorInformationLogger] writeToLog 
Request Unique ID : 2fdce04f-bd80-472b-9180-cd2a09034ba6
--------------------------
JVM Stats
--------------------------
usedMemory = 770375128
usedMemoryInMegabytes = 734
availableHeap = 303366696
freeMemoryInMegabytes = 289
allocatedHeap = 1073741824
freeAllocatedHeap = 303366696
totalMemory = 1073741824
totalMemoryInMegabytes = 1024
availablePermGen = 0
maxPermGen = -1
maxHeap = 1073741824
usedHeap = 770375128
freeMemory = 303366696
usedPermGen = -1
--------------------------
Request Information
--------------------------
URL: https://wiki.ourpage.de/500page.jsp
Scheme: https
Server: wiki.ourpage.de
Port: 443
URI: /500page.jsp
Context Path: 
Servlet Path: /500page.jsp
Path Info: null
Query String: xoauth_requestor_id=firstname.lastname
--------------------------
Attributes
--------------------------
javax.servlet.forward.request_uri: /rest/mywork/1/notification
javax.servlet.forward.context_path: 
javax.servlet.forward.servlet_path: /rest
javax.servlet.forward.path_info: /mywork/1/notification
javax.servlet.forward.query_string: xoauth_requestor_id=firstname.lastname
com.atlassian.oath.consumer-key: jira:5ce813e2-dd41-4c08-a3be-61d5a43067ff
os_authstatus: success
javax.servlet.error.status_code: 500
com.atlassian.confluence.impl.profiling.DecoratorTimings: com.atlassian.confluence.impl.profiling.DecoratorTimings@58215098
com.opensymphony.sitemesh.APPLIED_ONCE: true
__cleanup_recursion_counter: 0
javax.servlet.error.message: Internal Server Error
javax.servlet.error.servlet_name: noop
com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter_already_filtered: true
atlassian.core.seraph.original.url: /500page.jsp?xoauth_requestor_id=firstname.lastname
com.atlassian.gzipfilter.GzipFilter_already_filtered: true
B3-TraceId: 2e4defc6151808
loginfilter.already.filtered: true
javax.servlet.error.request_uri: /rest/mywork/1/notification
com.atlassian.core.filters.HeaderSanitisingFilter_already_filtered: true
com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter: true
com.atlassian.oath.request-flag: true
os_securityfilter_already_filtered: true
com.atlassian.seraph.auth.LoginReason: OK
com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter: true


```

Can Someone point us to the right direction?


Answers:
author: AnnWorley
body: If you used mysqldump with the --skip-opt flag it could cause the an issue like the one described in: [Unable to create a decision with the Decision Blueprint](https://confluence.atlassian.com/confkb/unable-to-create-a-decision-with-the-decision-blueprint-429920570.html)

The article recommends altering a table in the database - please back up your database before running any SQL against it:

```
ALTER TABLE AO_9412A1_AONOTIFICATION MODIFY COLUMN ID BIGINT auto_increment;
```

comments: author: andreas.vennemann
body: thank you for your replay. The auto_increment modifier was missing but sadly that didn't worked.

I still cannot change a page or create a new page. The same Error is displayed.

Strangly the changes to a page can be saved as a draft.

In the Logs atlassian-confluence.log we get new errors

```
2018-05-30 07:12:26,047 WARN [ContentViewedListener:thread-43] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
? ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #321824633)
?-- url: /display/INFRASTRUK/Infrastruktur | page: 1312186 | traceId: ab37ed52f575a579 | userName: firstname.lastname | referer: https://wiki.ourpage.de/index.action | action: viewpage
2018-05-30 07:12:32,605 WARN [ContentViewedListener:thread-43] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
? ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1387757240)
?-- url: /display/INFRASTRUK/IT-Planung | page: 12812961 | traceId: 02ad57549b464748 | userName: firstname.lastname | referer: https://wiki.ourpage.de/display/INFRASTRUK/Infrastruktur | action: viewpage
2018-05-30 07:12:52,074 WARN [ContentViewedListener:thread-43] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
? ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #122641440)
?-- url: /display/INFRASTRUK/IT-Planung | page: 12812961 | traceId: cc8001adce3cec0f | userName: firstname.lastname | referer: https://wiki.ourpage.de/display/INFRASTRUK/IT-Planung | action: viewpage
2018-05-30 07:13:06,502 WARN [ContentViewedListener:thread-43] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
? ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1301339521)
?-- url: /display/INFRASTRUK/Infrastruktur | page: 1312186 | traceId: 60bc06a83b137a86 | userName: firstname.lastname | referer: https://wiki.ourpage.de/ | action: viewpage
2018-05-30 07:13:08,296 WARN [ContentViewedListener:thread-43] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
? ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #384497965)
?-- url: /display/INFRASTRUK/IT-Planung | page: 12812961 | traceId: 2c8afeb29d57e2bc | userName: firstname.lastname | referer: https://wiki.ourpage.de/display/INFRASTRUK/Infrastruktur | action: viewpage
2018-05-30 07:13:18,761 ERROR [http-nio-8090-exec-6] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Field 'entry_id' doesn't have a default value
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
2018-05-30 07:13:18,761 ERROR [http-nio-8090-exec-6] [core.persistence.hibernate.HibernateObjectDao] reIndex Unable to reIndex object: page: IT-Planung v.9 (18579514) -- Failed to add entry to queue
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
com.atlassian.confluence.api.service.exceptions.ServiceException: Failed to add entry to queue
?? ?at com.atlassian.confluence.impl.journal.DefaultJournalService.enqueue(DefaultJournalService.java:34)
...

Caused by: org.springframework.orm.hibernate5.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [n/a]; SQL state [HY000]; error code [1364]; could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
...

2018-05-30 07:13:18,764 ERROR [http-nio-8090-exec-6] [engine.jdbc.spi.SqlExceptionHelper] logExceptions Field 'entry_id' doesn't have a default value
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
2018-05-30 07:13:18,765 ERROR [http-nio-8090-exec-6] [core.persistence.hibernate.HibernateObjectDao] reIndex Unable to reIndex object: page: IT-Planung v.10 (12812961) -- Failed to add entry to queue
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
com.atlassian.confluence.api.service.exceptions.ServiceException: Failed to add entry to queue
?? ?at com.atlassian.confluence.impl.journal.DefaultJournalService.enqueue(DefaultJournalService.java:34)
?? ?at com.atlassian.confluence.search.queue.AbstractJournalIndexTaskQueue.lambda$enqueue$0(AbstractJournalIndexTaskQueue.java:89)
?? ?at java.util.Optional.ifPresent(Optional.java:159)
...

2018-05-30 07:13:18,771 ERROR [http-nio-8090-exec-6] [org.hibernate.AssertionFailure] <init> HHH000099: an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: null id in com.atlassian.confluence.impl.journal.JournalEntry entry (don't flush the Session afterQuery an exception occurs)
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
2018-05-30 07:13:18,772 WARN [http-nio-8090-exec-6] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
? ->[com.atlassian.confluence.api.impl.service.content.draft.ContentDraftServiceImpl.publishEditDraft]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1967198575)
??????? [null]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT,readOnly (Session #36401371)
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
2018-05-30 07:13:19,155 ERROR [http-nio-8090-exec-6] [rest.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error : 
?-- referer: https://wiki.ourpage.de/pages/resumedraft.action?draftId=12812962&draftShareId=02309e06-c238-4990-b015-5ff3b573bff1 | url: /rest/api/content/12812961 | traceId: 0523694d32873460 | userName: firstname.lastname
org.hibernate.AssertionFailure: null id in com.atlassian.confluence.impl.journal.JournalEntry entry (don't flush the Session afterQuery an exception occurs)
?? ?at org.hibernate.event.internal.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:60)
?? ?at org.hibernate.event.internal.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:175)
```

Any Ideas?


author: AnnWorley
body: Just to double check, was the instance restarted after the database was altered?


author: andreas.vennemann
body: Yes we did.

We exported the old database again. This time not with phpmyadmin but with mysqldump via ssh and import also via ssh.

And now it is working again. Thank you for your time


author: Vickey Palzor Lepcha
body: Have you checked/updated your jdbc driver ?


Tags: confluence-server

server