<div dir="ltr"><div>Hey Deshak,</div><div><br></div><div>That's the error you should get if you only did the first step I gave you. Run the commands I gave you in step 3 on the database, then reboot the midpoint container and your issue should be resolved.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 14, 2023 at 4:45 AM BHATNAGAR Deshak <<a href="mailto:deshak.bhatnagar@thalesgroup.com">deshak.bhatnagar@thalesgroup.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg905441071036602495">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_905441071036602495WordSection1">
<p class="m_905441071036602495msipheadercbcacb55" style="margin:0in"><span style="font-size:10pt;color:green">THALES GROUP LIMITED DISTRIBUTION to email recipients
</span><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Hello Drew,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks for the swift reply and the possible solution.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I tried the same as explained below but faced another error:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server<u></u><u></u></p>
<p class="MsoNormal">ROOT cause: org.postgresql.util.PSQLException: ERROR: relation "m_global_metadata" does not exist<u></u><u></u></p>
<p class="MsoNormal"> Position: 31<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I have attached the complete error below in the error 14 Nov 2023 file.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.
<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span lang="NL" style="color:rgb(31,73,125)">Kind regards,</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Deshak Bhatnagar </span><span style="color:black"><u></u><u></u></span></p>
<div style="border-width:1pt medium medium;border-style:solid none none;border-color:rgb(225,225,225) currentcolor currentcolor;padding:3pt 0in 0in">
<p class="MsoNormal"><b>From:</b> Drew Roberts <<a href="mailto:aroberts@apu.edu" target="_blank">aroberts@apu.edu</a>> <br>
<b>Sent:</b> Saturday, November 11, 2023 3:50 AM<br>
<b>To:</b> midPoint General Discussion <<a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a>><br>
<b>Cc:</b> BHATNAGAR Deshak <<a href="mailto:deshak.bhatnagar@thalesgroup.com" target="_blank">deshak.bhatnagar@thalesgroup.com</a>><br>
<b>Subject:</b> Re: [External] Re: [midPoint] Unable to deploy midPoint 4.8 with postgresql using Docker<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Hey Deshak,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">If you take a look at the <a href="https://docs.evolveum.com/midpoint/release/4.8/" target="_blank">
Release Notes for midPoint 4.8</a> and use your browser's Find function with the term "native", a couple results in you'll see:<u></u><u></u></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<div>
<ul type="disc">
<li class="MsoNormal">
Generic Repository with PostgreSQL is not supported, if you are using PostgreSQL with generic repository, please migrate to
<a href="https://docs.evolveum.com/midpoint/reference/master/repository/native-postgresql/" target="_blank">
PostgreSQL native repository</a>. <u></u><u></u></li></ul>
</div>
</blockquote>
<div>
<p class="MsoNormal">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:<u></u><u></u></p>
</div>
<div>
<ol start="1" type="1">
<li class="MsoNormal">
Add a MP_SET_midpoint_repository_type=native environment variable to your midPoint container<u></u><u></u></li><li class="MsoNormal">
Set things so your midPoint container doesn't boot til after your database is configured<u></u><u></u></li><li class="MsoNormal">
Recreate this logic somehow on the database container for the first launch (maybe make an init container to run these commands or something?):<u></u><u></u></li></ol>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-left:0.5in">
sudo su - postgres<br>
psql<br>
CREATE USER midpoint WITH PASSWORD '<PASSWORD>' LOGIN SUPERUSER; <br>
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;<br>
\q<br>
<br>
curl <a href="https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres.sql" target="_blank">
https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres.sql</a> --output postgres.sql<br>
curl <a href="https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres-audit.sql" target="_blank">
https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres-audit.sql</a> --output postgres-audit.sql<br>
curl <a href="https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres-quartz.sql" target="_blank">
https://raw.githubusercontent.com/Evolveum/midpoint/support-4.8/config/sql/native/postgres-quartz.sql</a> --output postgres-quartz.sql<br>
<br>
psql -h localhost -d midpointdev -U midpoint -f postgres.sql -f postgres-audit.sql -f postgres-quartz.sql<u></u><u></u></p>
</blockquote>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Fri, Nov 10, 2023 at 8:37 AM BHATNAGAR Deshak via midPoint <<a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-width:medium medium medium 1pt;border-style:none none none solid;border-color:currentcolor currentcolor currentcolor rgb(204,204,204);padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<div>
<div>
<div>
<p class="m_905441071036602495m-6881871265031390861msipheadercbcacb55" style="margin:0in"><span style="font-size:10pt;color:green">THALES GROUP LIMITED DISTRIBUTION to email recipients
</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Added the docker-compose for reference.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<div>
<div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0in 0in;border-color:currentcolor">
<p class="MsoNormal"><b>From:</b> BHATNAGAR Deshak
<br>
<b>Sent:</b> Friday, November 10, 2023 9:43 PM<br>
<b>To:</b> <a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a><br>
<b>Subject:</b> Unable to deploy midPoint 4.8 with postgresql using Docker<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="m_905441071036602495m-6881871265031390861msipheadercbcacb55" style="margin:0in"><span style="font-size:10pt;color:green">THALES GROUP LIMITED DISTRIBUTION to email recipients
</span><u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Hello midpoint community,<u></u><u></u></p>
<p class="MsoNormal">I am deploying the Evolveum midpoint 4.8 with postgresql using Docker but I am facing the below mentioned error:<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server<u></u><u></u></p>
<p class="MsoNormal">ROOT cause: com.evolveum.midpoint.util.exception.SystemException: DB script (/sql/postgresql-4.6-all.sql) couldn't be found<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">This above error occurs because the system is not able to create required database tables, the log file is attached below (log file (error))<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I have tried with all the recommended version of both midpoint 4.8 as well as postgresql db.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">But the error remains the same in all cases.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Also, a similar error was reported on the Jira of Evolveum regarding the schema validation in which the database tables were not created:
<a href="https://jira.evolveum.com/projects/MID/issues/MID-9258?filter=doneissues" target="_blank">
https://jira.evolveum.com/projects/MID/issues/MID-9258?filter=doneissues</a> <u></u>
<u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">As per the conclusion drawn after my troubleshooting.
<u></u><u></u></p>
<p class="MsoNormal">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 (<a href="https://github.com/Evolveum/midpoint/tree/v4.8/config/sql/native" target="_blank">https://github.com/Evolveum/midpoint/tree/v4.8/config/sql/native</a>).
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">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 (<a href="https://github.com/Evolveum/midpoint/tree/v4.7.2/config/sql/native-new" target="_blank">https://github.com/Evolveum/midpoint/tree/v4.7.2/config/sql/native-new</a>).
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">So, I suspect that the issue is caused due to the file being missing in the repositories.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Please resolve the above issue or let me know the way that I can resolve this.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">docker-compose is also attached for the reference.<u></u><u></u></p>
<p class="MsoNormal"><span lang="NL" style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="NL" style="color:rgb(31,73,125)">Thanks.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="NL" style="color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="NL" style="color:rgb(31,73,125)">Kind regards,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:rgb(31,73,125)">Deshak Bhatnagar</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
midPoint mailing list<br>
<a href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a><br>
<a href="https://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">https://lists.evolveum.com/mailman/listinfo/midpoint</a><u></u><u></u></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<br>
<span class="m_905441071036602495gmailsignatureprefix">-- </span><u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal" style="line-height:18pt"><b><span style="font-size:9pt;font-family:"Arial",sans-serif">Drew Roberts</span></b><span style="font-size:9pt;font-family:"Arial",sans-serif"> |
<b>Systems Administrator II</b><br>
IT Platform Engineering, Azusa Pacific University<br>
<a href="https://apu.edu" target="_blank">apu.edu</a> <br>
<br>
</span><span style="font-size:9pt;font-family:"Arial",sans-serif"><img border="0" width="920" height="225" style="width: 9.5833in; height: 2.3416in;" id="m_905441071036602495_x0000_i1025" src="https://www.apu.edu/static/src/sites/strategic-communication-engagement/images/apu_125_logo.png" alt="APU logo"></span><span style="font-size:9pt;font-family:"Arial",sans-serif"><u></u><u></u></span></p>
</div>
</div>
</div>
</div>
</div>
</div></blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="font-family:sans-serif;font-size:12px;line-height:1.5em"><span style="font-weight:bold">Drew Roberts</span> | <span style="font-weight:bold">Systems Administrator II</span><br>IT Platform Engineering, Azusa Pacific University<br><a href="https://apu.edu" target="_blank">apu.edu</a> <br><br><img style="width: 210px;" src="https://www.apu.edu/static/src/sites/strategic-communication-engagement/images/apu_125_logo.png" alt="APU logo"></div></div></div>