[midPoint] Unable to deploy midPoint 4.8 with postgresql using Docker

BHATNAGAR Deshak deshak.bhatnagar at thalesgroup.com
Tue Nov 14 13:45:08 CET 2023


THALES GROUP LIMITED DISTRIBUTION to email recipients

Hello Drew,

Thanks for the swift reply and the possible solution.

I tried the same as explained below but faced another error:

ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server
ROOT cause: org.postgresql.util.PSQLException: ERROR: relation "m_global_metadata" does not exist
  Position: 31

I have attached the complete error below in the error 14 Nov 2023 file.

It would be great if you can share the docker-compose & and any other adjustments or changes you have made to your setup, so I can get a better understanding of it.

Kind regards,
Deshak Bhatnagar
From: Drew Roberts <aroberts at apu.edu>
Sent: Saturday, November 11, 2023 3:50 AM
To: midPoint General Discussion <midpoint at lists.evolveum.com>
Cc: BHATNAGAR Deshak <deshak.bhatnagar at thalesgroup.com>
Subject: Re: [External] Re: [midPoint] Unable to deploy midPoint 4.8 with postgresql using Docker

Hey Deshak,

If you take a look at the Release Notes for midPoint 4.8<https://docs.evolveum.com/midpoint/release/4.8/> and use your browser's Find function with the term "native", a couple results in you'll see:

  *   Generic Repository with PostgreSQL is not supported, if you are using PostgreSQL with generic repository, please migrate to PostgreSQL native repository<https://docs.evolveum.com/midpoint/reference/master/repository/native-postgresql/>.
I believe the issue you're experiencing is due to this change. My environment and setup are slightly different from yours so your mileage may vary but here are my two cents:

  1.  Add a MP_SET_midpoint_repository_type=native environment variable to your midPoint container
  2.  Set things so your midPoint container doesn't boot til after your database is configured
  3.  Recreate this logic somehow on the database container for the first launch (maybe make an init container to run these commands or something?):
sudo su - postgres
psql
CREATE USER midpoint WITH PASSWORD '<PASSWORD>' LOGIN SUPERUSER;
CREATE DATABASE midpointdev WITH OWNER = midpoint ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' CONNECTION LIMIT = -1;
\q

curl https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres.sql --output postgres.sql
curl https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres-audit.sql --output postgres-audit.sql
curl https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres-quartz.sql --output postgres-quartz.sql

psql -h localhost -d midpointdev -U midpoint -f postgres.sql -f postgres-audit.sql -f postgres-quartz.sql

On Fri, Nov 10, 2023 at 8:37 AM BHATNAGAR Deshak via midPoint <midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>> wrote:

THALES GROUP LIMITED DISTRIBUTION to email recipients

Added the docker-compose for reference.

Thanks
From: BHATNAGAR Deshak
Sent: Friday, November 10, 2023 9:43 PM
To: midpoint at lists.evolveum.com<mailto:midpoint at lists.evolveum.com>
Subject: Unable to deploy midPoint 4.8 with postgresql using Docker


THALES GROUP LIMITED DISTRIBUTION to email recipients

Hello midpoint community,
I am deploying the Evolveum midpoint 4.8 with postgresql using Docker but I am facing the below mentioned error:

ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server
ROOT cause: com.evolveum.midpoint.util.exception.SystemException: DB script (/sql/postgresql-4.6-all.sql) couldn't be found

This above error occurs because the system is not able to create required database tables, the log file is attached below (log file (error))

I was previously using the LTS version midpoint 4.4.4 and used the same docker-compose file with changes to midpoint 4.8 image and postgresql-16 image.

I have tried with all the recommended version of both midpoint 4.8 as well as postgresql db.

But the error remains the same in all cases.

Also, a similar error was reported on the Jira of Evolveum regarding the schema validation in which the database tables were not created: https://jira.evolveum.com/projects/MID/issues/MID-9258?filter=doneissues

As per the conclusion drawn after my troubleshooting.
I found out that the config/sql file in midpoint 4.8 repository on Github do not have the above-mentioned file in the error i.e., postgresql-4.6-all.sql (https://github.com/Evolveum/midpoint/tree/v4.8/config/sql/native).

In-comparison, all of the previous versions of midpoint on the Github had the file (postgresql-4.6-all.sql) in their respective repositories, for example: midpoint 4.7.2 had the file postgresql-4.6-all.sql in it on the Github (https://github.com/Evolveum/midpoint/tree/v4.7.2/config/sql/native-new).

So, I suspect that the issue is caused due to the file being missing in the repositories.

Please resolve the above issue or let me know the way that I can resolve this.

docker-compose is also attached for the reference.

Thanks.

Kind regards,
Deshak Bhatnagar
_______________________________________________
midPoint mailing list
midPoint at lists.evolveum.com<mailto:midPoint at lists.evolveum.com>
https://lists.evolveum.com/mailman/listinfo/midpoint


--
Drew Roberts  |  Systems Administrator II
IT Platform Engineering, Azusa Pacific University
apu.edu<https://apu.edu>

[APU logo]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20231114/bd507e5f/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: error file 14 Nov 2023.txt
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20231114/bd507e5f/attachment-0001.txt>


More information about the midPoint mailing list