CMDBuild Forum

Latest CMDBuild with READY2USE Docker - cannot create new entries

Hi. I’m trying to test out CMDBuild with READY2USE using the docker images from here: Docker.

The 2 containers build fine, I can log in and edit entries in the demo dump. However, using both demo.dump.xz and empty.dump.xz I cannot create a new entry. For example, if I try to create a new customer, I get the following error:

org.cmdbuild.dao.DaoException: error executing insert for entry = CardImpl{id=null, code=TEST, type=Customer}, caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; ERROR: null value in column "Description" violates not-null constraint
Detail: Failing row contains (100277, "Customer", TEST, null, null, null, 2023-12-01 22:39:12.744406+00, null, null, null, null, Tester, null, null, null, null, null, null, null, null, null).; nested exception is org.postgresql.util.PSQLException: ERROR: null value in column "Description" violates not-null constraint
Detail: Failing row contains (100277, "Customer", TEST, null, null, null, 2023-12-01 22:39:12.744406+00, null, null, null, null, Tester, null, null, null, null, null, null, null, null, null)., caused by: org.postgresql.util.PSQLException: ERROR: null value in column "Description" violates not-null constraint
Detail: Failing row contains (100277, "Customer", TEST, null, null, null, 2023-12-01 22:39:12.744406+00, null, null, null, null, Tester, null, null, null, null, null, null, null, null, null).

The logs on the DB container show:

2023-12-01 22:39:12.744 UTC [105] ERROR:  null value in column "Description" violates not-null constraint
2023-12-01 22:39:12.744 UTC [105] DETAIL:  Failing row contains (100277, "Customer", TEST, null, null, null, 2023-12-01 22:39:12.744406+00, null, null, null, null, Tester, null, null, null, null, null, null, null, null, null).
2023-12-01 22:39:12.744 UTC [105] STATEMENT:  INSERT INTO "Customer" ("Code", "Description", "CompanyTitle", "Address", "Postcode", "City", "Region", "Country", "Phone", "Fax", "Email", "Website", "IdTenant") VALUES ('TEST', NULL, 'Tester', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) RETURNING "Id"

It looks like I need to add a value for “Description”, but that is not visible in the UI.

Are you able to assist? Many thanks in advance.

Are you saying there is no field representation for the value ‘Description’ when creating a new customer? If so you would most likely need to open the administration module and inspect the customer class attributes tab and make sure “show in grid” and “active” are selected as well as ensuring the ‘Mode’ is not set to ‘Hidden’ for the ‘Description’ attribute.

OK, I think I worked it out. I was still able to use the “official” build from itmicus/cmdbuild, but instead of using itmicus/cmdbuild:db-3.0 for the cmdbuild_db container, I used postgis/postgis:12-3.3-alpine. So my run command for cmdbuild_db was:

docker run -d --name cmdbuild_db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -v cmdbuild_db:/var/lib/postgresql --restart unless-stopped postgis/postgis:12-3.3-alpine

By keeping the postgres username and password the same, The itmicus/cmdbuild:r2u-2.3-3.4.1-d container was able to create the database. So the run command for the app was the same:

docker run --name cmdbuild_app --restart unless-stopped -e CMDBUILD_DUMP="empty.dump.xz" --link cmdbuild_db -p 8090:8080 -d itmicus/cmdbuild:r2u-2.3-3.4.1-d

(in my case I didn’t want the demo data)

I would still be curious to know what the difference is between itmicus/cmdbuild and afcarvalho1991/cmdbuild is. Is the afcarvalho1991 account a non-official one?

Cheers again.

Thanks so much for your fast reply! You’re right. That worked, but unfortunately prompted the next error:

org.cmdbuild.dao.DaoException: error executing insert for entry = CardImpl{id=null, code=KAPT, type=Customer}, caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; ERROR: null value in column “CurrentId” violates not-null constraint

This seems to be the same as the one on github /itmicus/cmdbuild_docker/issues/38 (sorry, can’t post links). However, the solution seems to involve pulling an image from afcarvalho1991/cmdbuild:om-2.3-3.4.1-d rather than what I thought was the official account itmicus/cmdbuild. To be honest, I’m a little confused as to why it doesn’t just work out of the box…

I would still be curious to know what the difference is between itmicus/cmdbuild and afcarvalho1991/cmdbuild is. Is the afcarvalho1991 account a non-official one?

Itmicus is a Russian company, their docker images don’t seem official to me. CmdBuild developed by Tecnoteca in Italy. In the official docs only bare metal installation documented, nothing about docker.

You can inspect the images on docker hub, you can see that the two images are mostly the same, both of them just pull the same war from SourceForge and set up Tomcat:

This seems to be the same as the one on github /itmicus/cmdbuild_docker/issues/38 (sorry, can’t post links). However, the solution seems to involve pulling an image from afcarvalho1991/cmdbuild:om-2.3-3.4.1-d rather than what I thought was the official account itmicus/cmdbuild.

The issue comment you mention was written by me. I used afcarvalho1991’s image, because at the time of writing that was the only available 3.4 image. Itmicus 3.4 version was released only in August, afcarvalho1991 in February, I commented in May. I’m interested in OpenMaint, that’s why I used that in the example compose, but it should work with any vertical, as you figured it out.

The itmicus/cmdbuild:db-3.0 image is really old, it uses Postgres 10, while CmdBuild 3.4 requires Postgres 12, so it’s expected to fail. If you don’t need postgis support, you can use postgres:12-alpine image as db.

If you are interested I built docker images straight from source, not from the prebuilt wars: infeeeee / cmdbuild-community · GitLab

1 Like

It says on the itmicus/cmdbuild git: “This is the unofficial repository with all the versions of cmdbuild.” afcarvalho1991 is a contributor on the update adding CMDBuild 3.4.1. As to why it does not work out of the box, my best guess would be the version in this docker is configured for a specific use case and not with the CMDBuild source configuration.