<div dir="ltr"><div>Hey Huttm & Deshak,</div><div>After reviewing this further I realized I missed a few things that were in my config and are essential to make this work. I really hope there is a simpler way to do a native postgresql database because the way I got it working is ridiculous for the new recommended default option. Anyways, here's a more complete guide to my maniac method:</div><div>
<div><ol><li>Add these variables to your midPoint container:</li><ol><li>MP_SET_midpoint_repository_type=native</li><li>
MP_SET_midpoint_repository_jdbcUrl=jdbc:postgresql://db.at.your.address:5432/midpoint</li><li>
MP_SET_midpoint_repository_jdbcUsername=midpoint</li><li>
MP_SET_midpoint_repository_jdbcPassword_FILE=/run/secrets/mp_database_password.txt</li><li>
MP_SET_midpoint_keystore_keyStorePassword_FILE=/run/secrets/mp_keystore_password.txt</li></ol><li>Make sure your midPoint container does NOT have these variables:</li><ol><li>- REPO_DATABASE_TYPE=postgresql </li><li>- REPO_HOST=midpoint_data </li><li>- REPO_DATABASE=midpoint_db </li><li>- REPO_USER=midpoint </li><li>- REPO_PASSWORD_FILE=/run/secrets/mp_database_password.txt</li><li>- MP_KEYSTORE_PASSWORD_FILE=/run/secrets/mp_keystore_password.txt</li></ol><li>Create a config.xml file and put it in /opt/midpoint/var on your midPoint container (you could probably fill in these variables instead of using the MP_SET stuff above if you want. I prefer to use environment variables when I can):<span style="white-space:pre">
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(128,128,128)"><?</span><span style="color:rgb(86,156,214)">xml</span><span style="color:rgb(156,220,254)"> version</span><span style="color:rgb(204,204,204)">=</span><span style="color:rgb(206,145,120)">"1.0"</span><span style="color:rgb(128,128,128)">?></span>
<div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(106,153,85)"><!--</span></div><div><span style="color:rgb(106,153,85)"> ~ Copyright (C) 2010-2021 Evolveum and contributors</span></div><div><span style="color:rgb(106,153,85)"> ~</span></div><div><span style="color:rgb(106,153,85)"> ~ This work is dual-licensed under the Apache License 2.0</span></div><div><span style="color:rgb(106,153,85)"> ~ and European Union Public License. See LICENSE file for details.</span></div><div><span style="color:rgb(106,153,85)"> --></span></div><br><div><span style="color:rgb(106,153,85)"><!--</span></div><div><span style="color:rgb(106,153,85)">Example config.xml for Native PG repository.</span></div><div><span style="color:rgb(106,153,85)">To use it:</span></div><div><span style="color:rgb(106,153,85)">1. Copy it to $MIDPOINT_HOME, e.g. under midpoint.../var directory in the extracted archive.</span></div><div><span style="color:rgb(106,153,85)">2. Rename the copied file in $MIDPOINT_HOME to config.xml.</span></div><div><span style="color:rgb(106,153,85)">3. Check DB connection parameters and change them as needed.</span></div><div><span style="color:rgb(106,153,85)">4. Start midPoint (bin/start.sh) and observe the success in $MIDPOINT_HOME/log/midpoint.log.</span></div><br><div><span style="color:rgb(106,153,85)">For more info see:</span></div><br><div><span style="color:rgb(106,153,85)">* midPoint home:</span></div><div><span style="color:rgb(106,153,85)"><a href="https://docs.evolveum.com/midpoint/reference/deployment/midpoint-home-directory/">https://docs.evolveum.com/midpoint/reference/deployment/midpoint-home-directory/</a></span></div><br><div><span style="color:rgb(106,153,85)">* Overriding config.xml parameters from command line:</span></div><div><span style="color:rgb(106,153,85)"><a href="https://docs.evolveum.com/midpoint/reference/deployment/midpoint-home-directory/overriding-config-xml-parameters/">https://docs.evolveum.com/midpoint/reference/deployment/midpoint-home-directory/overriding-config-xml-parameters/</a></span></div><br><div><span style="color:rgb(106,153,85)">* Repository configuration:</span></div><div><span style="color:rgb(106,153,85)"><a href="https://docs.evolveum.com/midpoint/reference/repository/configuration/">https://docs.evolveum.com/midpoint/reference/repository/configuration/</a></span></div><br><div><span style="color:rgb(106,153,85)">* Canonical config.xml auto-created if not present in $MIDPOINT_HOME (master branch):</span></div><div><span style="color:rgb(106,153,85)"><a href="https://github.com/Evolveum/midpoint/blob/master/repo/system-init/src/main/resources/config.xml">https://github.com/Evolveum/midpoint/blob/master/repo/system-init/src/main/resources/config.xml</a></span></div><div><span style="color:rgb(106,153,85)">--></span></div></div></div></div><<span style="color:rgb(86,156,214)">configuration</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">midpoint</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">webApplication</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">importFolder</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">${midpoint.home}/import</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">importFolder</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">webApplication</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">repository</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">type</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">native</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">type</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">jdbcUrl</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">jdbc:postgresql://localhost:5432/midpoint</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">jdbcUrl</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">jdbcUsername</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">midpoint</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">jdbcUsername</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">jdbcPassword</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">password</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">jdbcPassword</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">repository</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">audit</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">auditService</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">auditServiceFactoryClass</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">com.evolveum.midpoint.audit.impl.LoggerAuditServiceFactory</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">auditServiceFactoryClass</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">auditService</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">auditService</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">auditServiceFactoryClass</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">com.evolveum.midpoint.repo.sqale.audit.SqaleAuditServiceFactory</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">auditServiceFactoryClass</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">auditService</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">audit</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">icf</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">scanClasspath</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">true</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">scanClasspath</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">scanDirectory</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">${midpoint.home}/icf-connectors</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">scanDirectory</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">icf</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">keystore</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">keyStorePath</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">${midpoint.home}/keystore.jceks</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">keyStorePath</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">keyStorePassword</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">changeit</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">keyStorePassword</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"><</span><span style="color:rgb(86,156,214)">encryptionKeyAlias</span><span style="color:rgb(128,128,128)">></span><span style="color:rgb(204,204,204)">default</span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">encryptionKeyAlias</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">keystore</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">midpoint</span><span style="color:rgb(128,128,128)">></span></div><div><span style="color:rgb(128,128,128)"></</span><span style="color:rgb(86,156,214)">configuration</span><span style="color:rgb(128,128,128)">></span></div></div>
</blockquote></li><li>Set things so your midPoint container doesn't boot til after your database is configured<br></li><li>Recreate
this logic somehow on the database container for the first launch
(maybe make an init container to run these commands or something?):<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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</blockquote></li></ol><div><br></div><div>I hope this time I've included everything you need to get it going. Apologies for the incomplete information before.<br></div></div>
</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 21, 2023 at 9:37 PM lazy tech <<a href="mailto:huutm@lazytech.biz.vn">huutm@lazytech.biz.vn</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"><u></u><div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt"><div>Hello Drew,<br></div><div><span style="font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-wrap;text-decoration-style:initial;text-decoration-color:initial;float:none;color:rgb(15,15,15);display:inline"><span style="font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;white-space:pre-wrap;text-decoration-style:initial;text-decoration-color:initial;float:none;color:rgb(15,15,15);display:inline">I followed the same steps as outlined in your guide, but I am still encountering an error. Could you provide further assistance?</span></span><br></div><div><br></div><div>2023-11-22 12:05:30 ... 94 common frames omitted <br></div><div>2023-11-22 12:05:30 Caused by: com.evolveum.midpoint.util.exception.SystemException: AuditServiceFactory implementation class com.evolveum.midpoint.repo.sql.SqlAuditServiceFactory failed to initialize: Couldn't find AuditServiceFactory for class com.evolveum.midpoint.repo.sql.SqlAuditServiceFactory<br></div><div>2023-11-22 12:05:30 at com.evolveum.midpoint.init.AuditFactory.init(AuditFactory.java:84)<br></div><div>2023-11-22 12:05:30 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br></div><div>2023-11-22 12:05:30 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)<br></div><div>2023-11-22 12:05:30 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br></div><div>2023-11-22 12:05:30 at java.base/java.lang.reflect.Method.invoke(Method.java:568)<br></div><div>2023-11-22 12:05:30 at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMethod.invoke(InitDestroyAnnotationBeanPostProcessor.java:457)<br></div><div>2023-11-22 12:05:30 at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:401)<br></div><div>2023-11-22 12:05:30 at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:219)<br></div><div>2023-11-22 12:05:30 ... 115 common frames omitted<br></div><div>2023-11-22 12:05:30 Caused by: com.evolveum.midpoint.util.exception.SystemException: Couldn't find AuditServiceFactory for class com.evolveum.midpoint.repo.sql.SqlAuditServiceFactory<br></div><div>2023-11-22 12:05:30 at com.evolveum.midpoint.init.AuditFactory.getFactory(AuditFactory.java:97)<br></div><div>2023-11-22 12:05:30 at com.evolveum.midpoint.init.AuditFactory.init(AuditFactory.java:75)<br></div><div>2023-11-22 12:05:30 ... 122 common frames omitted<br></div><div>2023-11-22 12:05:30 ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server<br></div><div>2023-11-22 12:05:30 ROOT cause: com.evolveum.midpoint.util.exception.SystemException: Couldn't find AuditServiceFactory for class com.evolveum.midpoint.repo.sql.SqlAuditServiceFactory<br></div><div>2023-11-22 12:05:30 See midpoint.log for more details.<br></div><div><br></div><div><br></div><div>Thanks,<br></div><div>Huutm</div><div><br></div><div style="border-top:1px solid rgb(204,204,204);height:0px;margin-top:10px;margin-bottom:10px;line-height:0px"><br></div><div><div><br></div><div id="m_-4560778357358216661Zm-_Id_-Sgn1">---- Trên Tue, 14 Nov 2023 23:42:18 +0700 <b>Drew Roberts via midPoint <<a href="mailto:midpoint@lists.evolveum.com" target="_blank">midpoint@lists.evolveum.com</a>></b> đã viết ---<br></div><div><br></div><blockquote id="m_-4560778357358216661blockquote_zmail" style="margin:0px"><div><div dir="ltr"><div>Hey Deshak,<br></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><div dir="ltr">On Tue, Nov 14, 2023 at 4:45 AM BHATNAGAR Deshak <<a href="mailto:deshak.bhatnagar@thalesgroup.com" target="_blank">deshak.bhatnagar@thalesgroup.com</a>> wrote:<br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div><p style="margin:0in"><span style="color:green"><span style="font-size:10pt">THALES GROUP LIMITED DISTRIBUTION to email recipients </span></span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px">Hello Drew,<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px">Thanks for the swift reply and the possible solution.<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px">I tried the same as explained below but faced another error:<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px">ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">ROOT cause: org.postgresql.util.PSQLException: ERROR: relation "m_global_metadata" does not exist<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> Position: 31<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px">I have attached the complete error below in the error 14 Nov 2023 file.<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px">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><br></p><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)">Kind regards,</span><span style="color:black"><u></u><u></u></span><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)">Deshak Bhatnagar </span><span style="color:black"><u></u><u></u></span><br></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 style="margin-top:0px;margin-bottom:0px"><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 style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><div><div><p style="margin-top:0px;margin-bottom:0px">Hey Deshak,<u></u><u></u><br></p></div><div><p style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p></div><div><p style="margin-top:0px;margin-bottom:0px">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><br></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><li>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><br></li></ul></div></blockquote><div><p style="margin-top:0px;margin-bottom:0px">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><br></p></div><div><ol start="1" type="1"><li>Add a MP_SET_midpoint_repository_type=native environment variable to your midPoint container<u></u><u></u><br></li><li>Set things so your midPoint container doesn't boot til after your database is configured<u></u><u></u><br></li><li>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><br></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 style="margin-left:0.5in;margin-top:0px;margin-bottom:0px">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 style="margin-top:0px;margin-bottom:0px"><u></u> <u></u><br></p><div><div><p style="margin-top:0px;margin-bottom:0px">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><br></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 style="margin:0in"><span style="color:green"><span style="font-size:10pt">THALES GROUP LIMITED DISTRIBUTION to email recipients </span></span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">Added the docker-compose for reference.<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">Thanks<u></u><u></u><br></p><div><div style="border-width:1pt medium medium;border-style:solid none none;padding:3pt 0in 0in;border-color:currentcolor"><p style="margin-top:0px;margin-bottom:0px"><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 style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin:0in"><span style="color:green"><span style="font-size:10pt">THALES GROUP LIMITED DISTRIBUTION to email recipients </span></span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">Hello midpoint community,<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">I am deploying the Evolveum midpoint 4.8 with postgresql using Docker but I am facing the below mentioned error:<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">ERROR initializing midPoint: org.springframework.context.ApplicationContextException: Unable to start web server<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">ROOT cause: com.evolveum.midpoint.util.exception.SystemException: DB script (/sql/postgresql-4.6-all.sql) couldn't be found<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">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><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">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><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">I have tried with all the recommended version of both midpoint 4.8 as well as postgresql db.<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">But the error remains the same in all cases.<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">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><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">As per the conclusion drawn after my troubleshooting. <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">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><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">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><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">So, I suspect that the issue is caused due to the file being missing in the repositories. <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">Please resolve the above issue or let me know the way that I can resolve this. <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"> <u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px">docker-compose is also attached for the reference.<u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)"> </span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)">Thanks.</span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)"> </span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)">Kind regards,</span><u></u><u></u><br></p><p style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(31,73,125)">Deshak Bhatnagar</span><u></u><u></u><br></p></div></div><p style="margin-top:0px;margin-bottom:0px">_______________________________________________<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 style="margin-top:0px;margin-bottom:0px"><br><br><span>-- </span><u></u><u></u></p><div><div><div><p style="line-height:18pt;margin-top:0px;margin-bottom:0px"><b><span style="font-family:Arial,sans-serif"><span style="font-size:9pt">Drew Roberts</span></span></b><span style="font-family:Arial,sans-serif"><span style="font-size:9pt"> | <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><span style="font-family:Arial,sans-serif"><span style="font-size:9pt"><img border="0" width="9.5833in" height="2.3416in" style="width: 9.5833in; height: 2.3416in;" id="m_-45607783573582166611699980167687100001_imgsrc_url_0" alt="APU logo"></span></span><span style="font-family:Arial,sans-serif"><span style="font-size:9pt"><u></u><u></u></span></span></p></div></div></div></div></div></div></blockquote></div><br><br><span>-- </span><br><div dir="ltr"><div dir="ltr"><div style="font-family:sans-serif;font-size:12px;line-height:1.5em"><b>Drew Roberts</b> | <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><img style="width: 210px;" id="m_-45607783573582166611699980167687100001_imgsrc_url_1" alt="APU logo" width="210"></div></div></div>_______________________________________________<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><br></div></blockquote></div><div><br></div></div><br></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>