Docker starter site error key is not present in table "structure"

27 views
Skip to first unread message

Ivan

unread,
Jul 6, 2022, 4:50:44 PMJul 6
to dotCMS User Group
I am testing a Docker setup for dotCMS. I am able to get the demo site up and running. Also, without specifying a starter site I am able to get a blank instance of dotCMS up and running. My next step in my test is to make some changes on the site and generate a new starter zip file and use it as a starter file when I restart docker. This is where I run into the following error (see the log output below.) Even if I don't make any changes to the demo site and just go and Download Starter ZIP File and use that file as the starter file I get the error. Any suggestions?

Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "workflow_scheme_x_structure" violates foreign key constraint "workflow_scheme_x_structure_structure_id_fkey"
docker-dotcms-1         |   Detail: Key (structure_id)=(c938b15f-bcb6-49ef-8651-14d455a97045) is not present in table "structure".
docker-dotcms-1         |     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2497) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2233) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:149) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:138) ~[postgresql-42.2.8.jar:42.2.8]
docker-dotcms-1         |     at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-3.4.2.jar:?]
docker-dotcms-1         |     at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.2.jar:?]
docker-dotcms-1         |     at com.dotmarketing.common.db.DotConnect.executeQuery(DotConnect.java:619) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.common.db.DotConnect.executeQuery(DotConnect.java:532) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.common.db.DotConnect.loadResult(DotConnect.java:271) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport_aroundBody0(WorkflowImportExportUtil.java:197) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil$AjcClosure1.run(WorkflowImportExportUtil.java:1) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.LocalTransaction.wrapReturnWithListeners(LocalTransaction.java:119) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.interceptors.WrapInTransactionMethodInterceptor.invoke(WrapInTransactionMethodInterceptor.java:30) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.WrapInTransactionAspect.invoke(WrapInTransactionAspect.java:41) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport(WorkflowImportExportUtil.java:130) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport(WorkflowImportExportUtil.java:120) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport(WorkflowImportExportUtil.java:96) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.util.ImportStarterUtil.doImport_aroundBody0(ImportStarterUtil.java:348) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.util.ImportStarterUtil$AjcClosure1.run(ImportStarterUtil.java:1) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.LocalTransaction.wrapReturnWithListeners(LocalTransaction.java:119) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.interceptors.WrapInTransactionMethodInterceptor.invoke(WrapInTransactionMethodInterceptor.java:30) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.WrapInTransactionAspect.invoke(WrapInTransactionAspect.java:41) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.util.ImportStarterUtil.doImport(ImportStarterUtil.java:160) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb.loadStarterSiteData_aroundBody4(DotCMSInitDb.java:78) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb$AjcClosure5.run(DotCMSInitDb.java:1) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.LocalTransaction.wrapReturnWithListeners(LocalTransaction.java:119) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.interceptors.WrapInTransactionMethodInterceptor.invoke(WrapInTransactionMethodInterceptor.java:30) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.WrapInTransactionAspect.invoke(WrapInTransactionAspect.java:41) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb.loadStarterSiteData(DotCMSInitDb.java:55) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb.loadStarterSite_aroundBody6(DotCMSInitDb.java:84) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb$AjcClosure7.run(DotCMSInitDb.java:1) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) ~[aspectjrt-1.9.2.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.interceptors.CloseDBIfOpenedMethodInterceptor.invoke(CloseDBIfOpenedMethodInterceptor.java:29) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.CloseDBIfOpenedAspect.invoke(CloseDBIfOpenedAspect.java:41) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb.loadStarterSite(DotCMSInitDb.java:82) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at com.dotmarketing.db.DotCMSInitDb.lambda$0(DotCMSInitDb.java:45) ~[dotcms_22.03.1_999999.jar:?]
docker-dotcms-1         |     at io.vavr.control.Try.run(Try.java:118) ~[vavr-0.10.3.jar:?]
docker-dotcms-1         |     ... 60 more
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil$AjcClosure1.run(WorkflowImportExportUtil.java:1)
docker-dotcms-1         |     at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.AspectJDelegateMethodInvocation.proceed(AspectJDelegateMethodInvocation.java:42)
docker-dotcms-1         |     at com.dotmarketing.db.LocalTransaction.wrapReturnWithListeners(LocalTransaction.java:119)
docker-dotcms-1         |     at com.dotcms.aspects.interceptors.WrapInTransactionMethodInterceptor.invoke(WrapInTransactionMethodInterceptor.java:30)
docker-dotcms-1         |     at com.dotcms.aspects.aspectj.WrapInTransactionAspect.invoke(WrapInTransactionAspect.java:41)
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport(WorkflowImportExportUtil.java:130)
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport(WorkflowImportExportUtil.java:120)
docker-dotcms-1         |     at com.dotmarketing.portlets.workflows.util.WorkflowImportExportUtil.importWorkflowExport(WorkflowImportExportUtil.java:96)
docker-dotcms-1         |     at com.dotmarketing.util.ImportStarterUtil.doImport_aroundBody0(ImportStarterUtil.java:348)
docker-dotcms-1         |     ... 84 more


Nollymar Longa

unread,
Jul 7, 2022, 11:14:25 AMJul 7
to dotCMS User Group
Hi Ivan, 

It seems like you are re-using the database volume in the docker instance. As it contains old data, it is trying to add data that is already there. I suggest to prune your docker volumes before installing a new instance with your custom starter (https://docs.docker.com/engine/reference/commandline/volume_prune/).

Nolly!

Ivan

unread,
Jul 7, 2022, 12:27:56 PMJul 7
to dotCMS User Group
Nolly,
I run the prune command before running docker-compose up, still getting the same error. To give you more details, I ran another test, I downloaded the https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/20211201/starter-20211201.zip starter file and used it in the volumes section "volumes:  - /app/dotcms/starter-20211201.zip:/srv/dotserver/tomcat-9.0.60/webapps/ROOT/starter.zip" and I was able to start it up and it created the site. BUT, if I go into the Download Starter ZIP File and generate the starter file and use that file as the started file, I get that exception again. So, it looks like the problem is with the generated starter files. 

--Ivan

Nollymar Longa

unread,
Jul 8, 2022, 11:44:05 AMJul 8
to dotCMS User Group
Ivan, 

are you using the option Download Data/Assets to generate the zip? 

Nolly

Ivan

unread,
Jul 8, 2022, 12:09:56 PMJul 8
to dotCMS User Group
Yes, I am using the Download Data/Assets option. I also tried the Download Data Only option with the same error. 

--Ivan

Nollymar Longa

unread,
Jul 11, 2022, 10:19:44 AMJul 11
to dotCMS User Group
Ivan,

when we generate a new starter we make sure we have an enterprise license set before. If you are not using one, it might affect the way the .zip file is generated.

Nolly!

Ivan

unread,
Jul 11, 2022, 10:40:06 AMJul 11
to dotCMS User Group
Nolly,
I use a community version. Is the Download Data/Assets option pretty much useless unless you have an Enterprise license? 

--Ivan 

Nollymar Longa

unread,
Jul 11, 2022, 6:22:59 PMJul 11
to dot...@googlegroups.com
Ivan,

I don't recommend it because your starter will contain limited content types/workflows.

Nolly!

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to a topic in the Google Groups "dotCMS User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dotcms/Muj630U1VPY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/87c1da54-09af-49f5-8b1a-2f23a4004ef4n%40googlegroups.com.

Ivan

unread,
Jul 11, 2022, 7:23:10 PMJul 11
to dotCMS User Group
Should the Download Starter ZIP File option be removed from the Community version then, or at least grayed out? For years I backed up my dotCMS by running the Download Starter ZIP File option. I never had to restore it, thankfully, but this seems very misleading to have the option available in the Export dotCMS Content if it only works for the Enterprise license. 

--Ivan

Reply all
Reply to author
Forward
0 new messages