<!DOCTYPE html><html><head><title></title><style type="text/css">#qt P{margin-top:0px;margin-bottom:0px;}

#qt p.qt-x_MsoNormal{margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;}

p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Try setting MAPSERVER_CONFIG_FILE to point to a mapserver.conf in your own Dockerfile and setting MS_MAP_PATTERN in this config file. <br></div><div><br></div><div>Without seeing your custom Dockerfile it is hard to know what could be removing an environment variable - it is simpler to control things with a config file.<br></div><div><br></div><div>If you check the /tmp/init_env file you should see the variables that are passed to the Apache environment (which is different from the system environment). If you override the default CMD ["/usr/local/bin/start-server"] then these env variables won't be set. <br></div><div><br></div><div id="sig62266145"><div class="signature">--<br></div><div class="signature">web:<a href="https://geographika.net">https://geographika.net</a> & <a href="https://mapserverstudio.net">https://mapserverstudio.net</a><br></div><div class="signature">twitter: @geographika<br></div></div><div><br></div><div>On Wed, Jun 5, 2024, at 9:21 PM, Rob Dennett wrote:<br></div><blockquote type="cite" id="qt" style=""><div class="qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">Not sure how uncommenting something in the conf from camptocamp would help when we're actually setting MS_MAP_PATTERN in our Dockerfile which relies on the camptocamp one as a base image.  I created a github issue for this as well and they advised running <br></div><div class="qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">Docker run <image> env | grep MS_<br></div><div class="qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">And I see MS_MAP_PATTERN defined there along with MS_MAPFILE set to what I am expecting.  Wouldn't this prove that the environment variables are set correctly?<br></div><div id="qt-appendonsend"><br></div><div><hr style="display:inline-block;width:98%;"><br></div><div id="qt-divRplyFwdMsg" dir="ltr"><div><span class="font" style="font-family:Calibri, sans-serif;"><span class="color" style="color:rgb(0, 0, 0);"><b>From:</b> Seth G <sethg@geographika.co.uk><br> <b>Sent:</b> Tuesday, June 4, 2024 4:32 PM<br> <b>To:</b> Rob Dennett <Rob.Dennett@twdb.texas.gov>; MapServer Users <mapserver-users@lists.osgeo.org><br> <b>Cc:</b> Chris Repka <Chris.Repka@twdb.texas.gov><br> <b>Subject:</b> Re: [MapServer-users] Getting msCGILoadMap(): Web application error. Required configuration value MS_MAP_PATTERN not set.</span></span></div><div> <br></div></div><div><div style="background-color:rgb(255, 255, 255);border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(244, 58, 19);border-right-color:rgb(244, 58, 19);border-bottom-color:rgb(244, 58, 19);border-left-color:rgb(244, 58, 19);border-top-width:2pt;border-right-width:2pt;border-bottom-width:2pt;border-left-width:2pt;font-size:10pt;line-height:12pt;font-family:"Calibri";color:red;"><p class="qt-x_MsoNormal" align="center" style="text-align:center;background-color:rgb(255, 255, 255);background-position-x:0%;background-position-y:0%;background-repeat:repeat;background-attachment:scroll;background-image:none;background-size:auto;background-origin:padding-box;background-clip:border-box;"><span style="color:red;"><b><span class="size" style="font-size:12pt;">External: Beware of links/attachments.</span></b></span><br></p></div><div><br></div><div><br></div><div><div>Hi Rob,<br></div><div><br></div><div>You could try uncommenting the MS_MAP_PATTERN in the mapserver.conf [1] file on your Docker image to see if that has an effect.<br></div><div><br></div><div>You should also see a log file named /tmp/init_env that lists all the environment variables used by Apache (including MS_MAP_PATTERN), similar to below:<br></div><div><br></div><div>export "MAPSERVER_CONFIG_FILE=/etc/mapserver/mapfiles/mapserver.conf"<br></div><div>export "MAPSERVER_CATCH_SEGV=1"<br></div><div>export "HOSTNAME=mapserver"<br></div><div>export "APACHE_CONFDIR=/etc/apache2"<br></div><div>export "BUSY_TIMEOUT=300"<br></div><div>export "MS_ERRORFILE=mapserver-8.0.log"<br></div><div>export "PWD=/etc/mapserver"<br></div><div>export "IO_TIMEOUT=40"<br></div><div>export "HOME=/root"<br></div><div>export "APACHE_LOG_DIR=/var/log/apache2"<br></div><div>export "MIN_PROCESSES=1"<br></div><div>export "APACHE_PID_FILE=/tmp/apache2/apache2.pid"<br></div><div>export "MS_MAP_PATTERN=^\/etc\/mapserver\/([^\.][-_A-Za-z0-9\.]+\/{1})*([-_A-Za-z0-9\.]+\.map)$"<br></div><div><br></div><div>Seth<br></div><div><br></div><div>[1] <a href="https://github.com/camptocamp/docker-mapserver/blob/cffc18f12146969ed914834b7eba4b798e9c24d9/runtime/etc/mapserver.conf#L15"> https://github.com/camptocamp/docker-mapserver/blob/cffc18f12146969ed914834b7eba4b798e9c24d9/runtime/etc/mapserver.conf#L15</a><br></div><div>[2] <a href="https://github.com/camptocamp/docker-mapserver/blob/31594debf18f091ad7ca5cf7126723bc014d9781/runtime/usr/local/bin/start-server#L8"> https://github.com/camptocamp/docker-mapserver/blob/31594debf18f091ad7ca5cf7126723bc014d9781/runtime/usr/local/bin/start-server#L8</a><br></div><div><br></div><div id="qt-x_sig62266145"><div class="qt-x_signature">--<br></div><div class="qt-x_signature">web:<a href="https://geographika.net">https://geographika.net</a> & <a href="https://mapserverstudio.net">https://mapserverstudio.net</a><br></div><div class="qt-x_signature">twitter: @geographika<br></div></div><div><br></div><div>On Tue, Jun 4, 2024, at 11:08 PM, Rob Dennett via MapServer-users wrote:<br></div><blockquote type="cite" id="qt-x_qt" style=""><div class="qt-x_qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><div>We're using the camptocamp MapServer image and I just tried changing the base image from 7.6 to 8.0, i.e.<br></div></div><div style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">FROM camptocamp/mapserver:7.6<br></div><div style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">To <br></div><div class="qt-x_qt-elementToProof" style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">FROM camptocamp/mapserver:8.0<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">in our own Dockerfile and when I try to deploy, We're seeing<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">"msCGILoadMap(): Web application error.  Required configuration value MS_MAP_PATTERN not set."<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">on some endpoints (the ones ending in .map)<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">The camptocamp image contains<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">ENV MS_MAP_PATTERN=^\\/etc\\/mapserver\\/([^\\.][-_A-Za-z0-9\\.]+\\/{1})*([-_A-Za-z0-9\\.]+\\.map)$<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">(<a href="https://github.com/camptocamp/docker-mapserver/blob/8.0.0/Dockerfile#L85" id="qt-x_qt-LPlnk">https://github.com/camptocamp/docker-mapserver/blob/8.0.0/Dockerfile#L85</a>)<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">and our own overwrites this env var anyway, along with MS_MAPFILE<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">These haven't changed and they work fine as long as the base image is 7.6. The changelog mentions MS_MAPFILE, but as mentioned, we do define it.<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">(<a href="https://github.com/camptocamp/docker-mapserver/blob/8.0.0/README.md#changelog" id="qt-x_qt-LPlnk714756">https://github.com/camptocamp/docker-mapserver/blob/8.0.0/README.md#changelog</a>)<br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);">Any idea what might be happening?<br></div><div class="qt-x_qt-_Entity qt-x_qt-_EType_OWALinkPreview qt-x_qt-_EId_OWALinkPreview_1 qt-x_qt-_EReadonly_1"><div id="qt-x_qt-LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2NhbXB0b2NhbXAvZG9ja2VyLW1hcHNlcnZlci9ibG9iLzguMC4wL0RvY2tlcmZpbGUjTDg1" class="qt-x_qt-LPBorder593785" style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px;"><table id="qt-x_qt-LPContainer593785" role="presentation" style="padding-top:12px;padding-right:36px;padding-bottom:12px;padding-left:12px;width:100%;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(200, 200, 200);border-right-color:rgb(200, 200, 200);border-bottom-color:rgb(200, 200, 200);border-left-color:rgb(200, 200, 200);border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;"><tbody><tr valign="top" style="border-spacing:0px;"><td><div id="qt-x_qt-LPImageContainer593785" style="margin-right:12px;height:120px;overflow-x:hidden;overflow-y:hidden;width:240px;"><a target="_blank" id="qt-x_qt-LPImageAnchor593785" href="https://github.com/camptocamp/docker-mapserver/blob/8.0.0/Dockerfile#L85"><img id="qt-x_qt-LPThumbnailImageId593785" alt="" height="120" width="240" style="display:block;" src="https://opengraph.githubassets.com/89914d21a14748d29e5eb2cb7cf59e720bd216e41863d0bff2ca0e490950eddd/camptocamp/docker-mapserver"></a><br></div></td><td style="width:100%;"><div id="qt-x_qt-LPTitle593785" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;margin-bottom:12px;"><a target="_blank" id="qt-x_qt-LPUrlAnchor593785" href="https://github.com/camptocamp/docker-mapserver/blob/8.0.0/Dockerfile#L85" style="text-decoration-line:none;text-decoration-style:solid;text-decoration-color:currentcolor;">docker-mapserver/Dockerfile at
 8.0.0 · camptocamp/docker-mapserver</a><br></div><div id="qt-x_qt-LPDescription593785" style="font-size:14px;max-height:100px;color:rgb(102, 102, 102);font-family:wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;margin-bottom:12px;margin-right:8px;overflow-x:hidden;overflow-y:hidden;">https://hub.docker.com/r/camptocamp/mapserver/. Contribute to camptocamp/docker-mapserver development by creating an account on GitHub.<br></div><div id="qt-x_qt-LPMetadata593785" style="font-size:14px;font-weight:400;color:rgb(166, 166, 166);font-family:wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">github.com<br></div></td></tr></tbody></table></div></div><div style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-_Entity qt-x_qt-_EType_OWALinkPreview qt-x_qt-_EId_OWALinkPreview qt-x_qt-_EReadonly_1"><div id="qt-x_qt-LPBorder_GTaHR0cHM6Ly9naXRodWIuY29tL2NhbXB0b2NhbXAvZG9ja2VyLW1hcHNlcnZlci9ibG9iLzguMC4wL0RvY2tlcmZpbGUjTDg1" class="qt-x_qt-LPBorder753082" style="width:100%;margin-top:16px;margin-bottom:16px;max-width:800px;min-width:424px;"><table id="qt-x_qt-LPContainer753082" role="presentation" style="padding-top:12px;padding-right:36px;padding-bottom:12px;padding-left:12px;width:100%;border-top-width:1px;border-right-width:1px;border-bottom-width:1px;border-left-width:1px;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-color:rgb(200, 200, 200);border-right-color:rgb(200, 200, 200);border-bottom-color:rgb(200, 200, 200);border-left-color:rgb(200, 200, 200);border-top-left-radius:2px;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:2px;"><tbody><tr valign="top" style="border-spacing:0px;"><td><div id="qt-x_qt-LPImageContainer753082" style="margin-right:12px;height:120px;overflow-x:hidden;overflow-y:hidden;width:240px;"><a target="_blank" id="qt-x_qt-LPImageAnchor753082" href="https://github.com/camptocamp/docker-mapserver/blob/8.0.0/Dockerfile#L85"><img id="qt-x_qt-LPThumbnailImageId753082" alt="" height="120" width="240" style="display:block;" src="https://opengraph.githubassets.com/89914d21a14748d29e5eb2cb7cf59e720bd216e41863d0bff2ca0e490950eddd/camptocamp/docker-mapserver"></a><br></div></td><td style="width:100%;"><div id="qt-x_qt-LPTitle753082" style="font-size:21px;font-weight:300;margin-right:8px;font-family:wf_segoe-ui_light, "Segoe UI Light", "Segoe WP Light", "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;margin-bottom:12px;"><a target="_blank" id="qt-x_qt-LPUrlAnchor753082" href="https://github.com/camptocamp/docker-mapserver/blob/8.0.0/Dockerfile#L85" style="text-decoration-line:none;text-decoration-style:solid;text-decoration-color:currentcolor;">docker-mapserver/Dockerfile at
 8.0.0 · camptocamp/docker-mapserver</a><br></div><div id="qt-x_qt-LPDescription753082" style="font-size:14px;max-height:100px;color:rgb(102, 102, 102);font-family:wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;margin-bottom:12px;margin-right:8px;overflow-x:hidden;overflow-y:hidden;">https://hub.docker.com/r/camptocamp/mapserver/. Contribute to camptocamp/docker-mapserver development by creating an account on GitHub.<br></div><div id="qt-x_qt-LPMetadata753082" style="font-size:14px;font-weight:400;color:rgb(166, 166, 166);font-family:wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;">github.com<br></div></td></tr></tbody></table></div></div><div style="font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div class="qt-x_qt-elementToProof" style="line-height:19px;font-family:Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif;font-size:12pt;color:rgb(0, 0, 0);"><br></div><div>_______________________________________________<br></div><div>MapServer-users mailing list<br></div><div><a href="mailto:MapServer-users@lists.osgeo.org">MapServer-users@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div><div><br></div></blockquote><div><br></div></div></div></blockquote><div><br></div></body></html>