Confluence Won't start after Upgrade to 5.0.1 from 4.3.3
Asked by Nathan Palmer:

We just ran through the upgrade process following all the recommended steps for Ubuntu linux.   

The upgrade process completed without any problems but when we try to access our Confluence instance we're getting the following error:

Type: Upgrade

Description:  
"Upgrade failed. Please consult the system logs for details. You will need to fix these problems, restore your database and confluence home directory to the pre upgrade state. Then retry the upgrade."

Exception: \[None\]

Level: error

<br />

Here is the atlassian-confluence.log file readout:

2013-03-07 15:40:18,946 INFO \[main\] \[com.atlassian.confluence.lifecycle\] contextInitialized Starting Confluence 5.0.1 \[build 4107 based on commit hash 2dc2223027d89dca2a608ee3f1c532937863ead6\]

2013-03-07 15:40:21,942 INFO \[main\] \[springframework.web.context.ContextLoader\] initWebApplicationContext Root WebApplicationContext: initialization started

2013-03-07 15:40:26,256 INFO \[main\] \[com.atlassian.confluence.lifecycle\] \<init\> Loading EhCache cache manager

2013-03-07 15:40:37,685 WARN \[main\] \[org.springframework.beans.TypeConverterDelegate\] findDefaultEditor PropertyEditor \[com.sun.beans.editors.EnumEditor\] found through deprecated global PropertyEditorManager fallback - consider using a more isolated form of registration, e.g. on the BeanWrapper/BeanFactory!

2013-03-07 15:40:43,274 INFO \[main\] \[springframework.web.context.ContextLoader\] initWebApplicationContext Root WebApplicationContext: initialization completed in 21331 ms

2013-03-07 15:40:48,974 ERROR \[main\] \[hibernate.tool.hbm2ddl.SchemaUpdate\] execute Unsuccessful: alter table LIKES add constraint FK4514B9C8DD41734 foreign key (CONTENTID) references CONTENT

2013-03-07 15:40:48,975 ERROR \[main\] \[hibernate.tool.hbm2ddl.SchemaUpdate\] execute ERROR: insert or update on table "likes" violates foreign key constraint "fk4514b9c8dd41734"

Detail: Key (contentid)=(0) is not present in table "content".

2013-03-07 15:40:48,976 ERROR \[main\] \[hibernate.tool.hbm2ddl.SchemaUpdate\] execute could not complete schema update

org.postgresql.util.PSQLException: ERROR: insert or update on table "likes" violates foreign key constraint "fk4514b9c8dd41734"

Detail: Key (contentid)=(0) is not present in table "content".

at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)

at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)

at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:64)

at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:167)

at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:161)

at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:134)

at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:127)

at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:45)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

2013-03-07 15:40:48,996 ERROR \[main\] \[atlassian.confluence.upgrade.UpgradeLauncherServletContextListener\] contextInitialized Upgrade failed, application will not start: com.atlassian.config.ConfigurationException: Cannot update schema

com.atlassian.confluence.upgrade.UpgradeException: com.atlassian.config.ConfigurationException: Cannot update schema

at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:147)

at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:45)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Caused by: com.atlassian.config.ConfigurationException: Cannot update schema

at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:165)

at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:134)

at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:127)

... 16 more

Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "likes" violates foreign key constraint "fk4514b9c8dd41734"

Detail: Key (contentid)=(0) is not present in table "content".

at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)

at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)

at com.mchange.v2.c3p0.impl.NewProxyStatement.executeUpdate(NewProxyStatement.java:64)

at net.sf.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:167)

at bucket.core.persistence.hibernate.schema.SchemaHelper.updateSchemaIfNeeded(SchemaHelper.java:161)

... 18 more

2013-03-07 15:40:49,018 ERROR \[main\] \[atlassian.confluence.upgrade.UpgradeLauncherServletContextListener\] contextInitialized 1 errors were encountered during upgrade:

2013-03-07 15:40:49,019 ERROR \[main\] \[atlassian.confluence.upgrade.UpgradeLauncherServletContextListener\] contextInitialized 1: Cannot update schema

2013-03-07 15:40:49,019 WARN \[main\] \[atlassian.confluence.plugin.PluginFrameworkContextListener\] contextInitialized Not starting full plugin system due to upgrade or licensing errors

2013-03-07 15:40:49,142 WARN \[main\] \[confluence.setup.bandana.ConfluenceDaoBandanaPersister\] getObjectFromValue Configuration could not be loaded because class could not be found (context: _GLOBAL, key: atlassian.confluence.smtp.mail.accounts).

com.thoughtworks.xstream.converters.ConversionException: No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

---- Debugging information ----

message : No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

line number : 16

path : /linked-hash-map/entry/com.atlassian.confluence.jmx.JmxSMTPMailServer/com.atlassian.mail.server.impl.SMTPMailServerImpl/default/debug

cause-message : No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

class : java.util.LinkedHashMap

cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException

required-type : com.atlassian.confluence.jmx.JmxSMTPMailServer

-------------------------------

com.thoughtworks.xstream.converters.ConversionException: No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

---- Debugging information ----

message : No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

line number : 16

path : /linked-hash-map/entry/com.atlassian.confluence.jmx.JmxSMTPMailServer/com.atlassian.mail.server.impl.SMTPMailServerImpl/default/debug

cause-message : No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

class : java.util.LinkedHashMap

cause-exception : com.thoughtworks.xstream.converters.reflection.ObjectAccessException

required-type : com.atlassian.confluence.jmx.JmxSMTPMailServer

-------------------------------

at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:45)

at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)

at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:82)

at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:72)

at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:59)

at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)

at com.thoughtworks.xstream.core.ReferenceByXPathUnmarshaller.convertAnother(ReferenceByXPathUnmarshaller.java:39)

at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:99)

at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12)

at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:549)

at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:537)

at com.thoughtworks.xstream.XStream.fromXML(XStream.java:505)

at com.atlassian.confluence.setup.bandana.XStreamBandanaSerializer.deserialize(XStreamBandanaSerializer.java:27)

at com.atlassian.confluence.setup.bandana.ConfluenceDaoBandanaPersister.getObjectFromValue(ConfluenceDaoBandanaPersister.java:107)

at com.atlassian.confluence.setup.bandana.ConfluenceDaoBandanaPersister.retrieve(ConfluenceDaoBandanaPersister.java:29)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

at sun.proxy.$Proxy5.retrieve(Unknown Source)

at com.atlassian.confluence.setup.bandana.ConfluenceCachingBandanaPersister.retrieve(ConfluenceCachingBandanaPersister.java:65)

at com.atlassian.bandana.DefaultBandanaManager.getValue(DefaultBandanaManager.java:32)

at com.atlassian.bandana.DefaultBandanaManager.getValue(DefaultBandanaManager.java:24)

at com.atlassian.confluence.mail.ConfluenceMailServerManager.getMailServerMap(ConfluenceMailServerManager.java:69)

at com.atlassian.confluence.mail.ConfluenceMailServerManager.getServerNames(ConfluenceMailServerManager.java:46)

at com.atlassian.confluence.jmx.JmxFilter.doMailServer(JmxFilter.java:72)

at com.atlassian.confluence.jmx.JmxFilter.registerBeans(JmxFilter.java:62)

at com.atlassian.confluence.jmx.JmxFilter.init(JmxFilter.java:41)

at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)

at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)

at org.apache.catalina.core.ApplicationFilterConfig.\<init\>(ApplicationFilterConfig.java:115)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: No such field com.atlassian.confluence.jmx.JmxSMTPMailServer.debug

at com.thoughtworks.xstream.converters.reflection.FieldDictionary.field(FieldDictionary.java:27)

at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.getFieldType(PureJavaReflectionProvider.java:131)

at com.thoughtworks.xstream.converters.reflection.SerializableConverter$2.defaultReadObject(SerializableConverter.java:327)

at com.thoughtworks.xstream.converters.reflection.SerializableConverter.unmarshal(SerializableConverter.java:363)

at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:38)

... 51 more

2013-03-07 15:40:50,218 INFO \[main\] \[com.atlassian.confluence.lifecycle\] init Confluence is ready to serve


Answers:
author: Septa Cahyadiputra
body: Hi Nathan,

Seems like there might be a database inconsistency on your end. You might want to check if the following SQL query return any result:

SELECT \* FROM likes WHERE CONTENTID = 0;

If there are any result, please create a database backup and delete it from your database. Roll back from pre-upgrade state and try again.

Hope it helps.

Cheers,  
Septa Cahyadiputra


author: hsuhailah
body: Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "likes" violates foreign key constraint "fk4514b9c8dd41734"

Detail: Key (contentid)=(0) is not present in table "content".

The above seems to be related to this [CONF-21697](https://jira.atlassian.com/browse/CONF-21697) however your issue is referring to "likes" table. You might want to try and check out the workaround mentioned in the report and adjust it according to your particular DB. Please make all of the neccesary backup before performing any changes as precuation measure/test this out on the test server first.


Tags: error

upgrade