Unable to install add ons in UPM due to duplicate key value in AO_6384AB_FEATURE_METADATA table
問題
When installing add ons in UPM the operation will fails with a warning to check Confluence logs for more information. Once you check the atlassian-confluence.log the following will appear:
2015-05-08 18:09:48,690 ERROR [localhost-startStop-1] [atlassian.event.internal.AsynchronousAbleEventDispatcher] run There was an exception thrown trying to dispatch event [com.atlassian.config.lifecycle.events.ApplicationStartedEvent@330fd450] from the invoker [SingleParameterMethodListenerInvoker{method=public void com.atlassian.confluence.plugins.featurediscovery.PluginModuleEventListener.onApplicationStart(com.atlassian.config.lifecycle.events.ApplicationStartedEvent), listener=com.atlassian.confluence.plugins.featurediscovery.PluginModuleEventListener@67996024}]
java.lang.RuntimeException: There was a SQL exception thrown by the Active Objects library:
Database:
- name:PostgreSQL
- version:9.1.15
- minor version:1
- major version:9
Driver:
- name:PostgreSQL Native Driver
- version:PostgreSQL 9.2 JDBC4 (build 1002)
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "AO_6384AB_FEATURE_METADATA_AO_pkey"
Detail: Key ("ID")=(16) already exists.
at com.atlassian.event.internal.SingleParameterMethodListenerInvoker.invoke(SingleParameterMethodListenerInvoker.java:54)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher$1$1.run(AsynchronousAbleEventDispatcher.java:48)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:253)
at com.atlassian.event.internal.AsynchronousAbleEventDispatcher.dispatch(AsynchronousAbleEventDispatcher.java:107)
at com.atlassian.event.internal.EventPublisherImpl.invokeListeners(EventPublisherImpl.java:160)
at com.atlassian.event.internal.EventPublisherImpl.publish(EventPublisherImpl.java:79)
at com.atlassian.confluence.event.TimingEventPublisher.publish(TimingEventPublisher.java:73)
at com.atlassian.config.lifecycle.DefaultLifecycleManager.startUp(DefaultLifecycleManager.java:43)
at com.atlassian.config.lifecycle.LifecycleServletContextListener.contextInitialized(LifecycleServletContextListener.java:17)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
原因
For some unknown reason one of the Confluence internal tasks is trying to re add a existing entry on AO_6384AB_FEATURE_METADATA table, as we have a constraint in place that action will not be completed and hence UPM will fail to install the add on.
ソリューション
データベースの変更を行う場合は必ず事前にバックアップを取得してください。可能な場合は、まずステージング サーバーで SQL コマンドの変更、挿入、更新、または削除を行うようにします。
- Confluence を終了します。
Run the below Query against Confluence database:
delete from AO_6384AB_FEATURE_METADATA_AO;
- Confluence を起動します。
During the confluence start up the data will be rebuild on that table and you will be able to install add ons again without problems.