Re: [MapServer-users] CGI variable "map" fails to validate
I think I've stumbled into what is causing my issue. I was making requests to the endpoint /cgi-bin/mapserv.exe? (which is what I used in 7.6.2) When I change request to the endpoint /cgi-bin/? (no mapserv.exe) my requests work and validate as expected. I'm not sure why this is the case - if I swap my FastCGI back to point to the 7.6.2 module it serves requests at /mapserv.exe, but with 8.0.1 including the executable as part of the path causes issues with map validation. In any case, I can work around this by updating all the web apps to point to the new path (maybe also add in a URL Rewrite). Thanks, Matt -Original Message- From: MapServer-users On Behalf Of Lernout, Matthew via MapServer-users Sent: Wednesday, March 6, 2024 5:29 PM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate So, still banging my head against this a month later after eliminating HTTPS as the bogeyman. Using FastCGI and MapServer with the simplest config and what should be an "allow everything" test expression: CONFIG ENV MS_MAP_PATTERN "." END END And all requests return: msLoadMap(): Regular expression error. Filename validation failed. BONUS: If I strip out the map variable from my request, I'd expect the error "CGI variable "map" is not set." but I still get "msLoadMap(): Regular expression error. Filename validation failed." even without providing a map! This is following IISRESET, and I know the config is being loaded (if I remove it, I get "msLoadConfig(): Unable to access file") If I'm not supplying a map parameter in my request and it's not throwing an error that it's missing, what is being used for map value against the expression? (And how do I get it to read my variable in the request?) Thanks for any direction, Matt -Original Message- From: MapServer-users On Behalf Of Lernout, Matthew via MapServer-users Sent: Wednesday, February 7, 2024 3:32 PM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate Hi, After scratching my head for a while, realized all my testing was over HTTPS. Made a localhost connection over HTTP and the map variable was then valid. I was looking in the wrong place - the error reports a failed validation, but that's due to failed certificate trust from what I can see. Thanks for helping me steer into the real issue - I now have a direction to move in! Matt -Original Message- From: Rahkonen Jukka Sent: Wednesday, February 7, 2024 1:05 PM To: Lernout, Matthew ; mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, "." works for me. I have a Windows env set first as set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf These are the meaningful lines in the "ms4w.conf" file. CONFIG ENV MS_MAP_PATTERN "." END END Test proves that validation is successful http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map) -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: MapServer-users Puolesta Lernout, Matthew via MapServer-users Lähetetty: keskiviikko 7. helmikuuta 2024 19.01 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: Re: [MapServer-users] CGI variable "map" fails to validate I've ensured I am restarting the mapserv process with each config change - a quick test of commenting out the MS_MAP_PATTERN variable confirmed that is enough to refresh the config via error. Here's a snippet of a sample request. It works with my running instance of Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1. /cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map Matt -Original Message- From: Seth G Sent: Wednesday, February 7, 2024 11:48 AM To: Lernout, Matthew ; MapServer Users Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from se...@geographika.co.uk. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi Matthew, The CONFIG file I think is only reloaded when IIS or the Application Pool is restarted, so some changes to the regex may have been ignored. Do you have a sample request with the &map= parameter? Is there anything in a web.config file that could be stripping these out or modifying them? Seth -- web:https://geographika.net/ & https://mapserverstudio.net/ twitter: @geographika On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote: > MS_MAP_PATTERN '.' also results in the same failed validation error, > which is what makes me think the issue may be with another config > setting. '.' should match any input, right? > > Just to make sure my config file was being loaded, I co
Re: [MapServer-users] CGI variable "map" fails to validate
Shouldn't it be ".*' ? On 06/03/2024 23:29, Lernout, Matthew via MapServer-users wrote: So, still banging my head against this a month later after eliminating HTTPS as the bogeyman. Using FastCGI and MapServer with the simplest config and what should be an "allow everything" test expression: CONFIG ENV MS_MAP_PATTERN "." END END And all requests return: msLoadMap(): Regular expression error. Filename validation failed. BONUS: If I strip out the map variable from my request, I'd expect the error "CGI variable "map" is not set." but I still get "msLoadMap(): Regular expression error. Filename validation failed." even without providing a map! This is following IISRESET, and I know the config is being loaded (if I remove it, I get "msLoadConfig(): Unable to access file") If I'm not supplying a map parameter in my request and it's not throwing an error that it's missing, what is being used for map value against the expression? (And how do I get it to read my variable in the request?) Thanks for any direction, Matt -Original Message- From: MapServer-users On Behalf Of Lernout, Matthew via MapServer-users Sent: Wednesday, February 7, 2024 3:32 PM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate Hi, After scratching my head for a while, realized all my testing was over HTTPS. Made a localhost connection over HTTP and the map variable was then valid. I was looking in the wrong place - the error reports a failed validation, but that's due to failed certificate trust from what I can see. Thanks for helping me steer into the real issue - I now have a direction to move in! Matt -Original Message- From: Rahkonen Jukka Sent: Wednesday, February 7, 2024 1:05 PM To: Lernout, Matthew ; mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, "." works for me. I have a Windows env set first as set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf These are the meaningful lines in the "ms4w.conf" file. CONFIG ENV MS_MAP_PATTERN "." END END Test proves that validation is successful http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map) -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: MapServer-users Puolesta Lernout, Matthew via MapServer-users Lähetetty: keskiviikko 7. helmikuuta 2024 19.01 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: Re: [MapServer-users] CGI variable "map" fails to validate I've ensured I am restarting the mapserv process with each config change - a quick test of commenting out the MS_MAP_PATTERN variable confirmed that is enough to refresh the config via error. Here's a snippet of a sample request. It works with my running instance of Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1. /cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map Matt -Original Message- From: Seth G Sent: Wednesday, February 7, 2024 11:48 AM To: Lernout, Matthew ; MapServer Users Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from se...@geographika.co.uk. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi Matthew, The CONFIG file I think is only reloaded when IIS or the Application Pool is restarted, so some changes to the regex may have been ignored. Do you have a sample request with the &map= parameter? Is there anything in a web.config file that could be stripping these out or modifying them? Seth -- web:https://geographika.net/ & https://mapserverstudio.net/ twitter: @geographika On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote: MS_MAP_PATTERN '.' also results in the same failed validation error, which is what makes me think the issue may be with another config setting. '.' should match any input, right? Just to make sure my config file was being loaded, I commented out the MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web application error. Required configuration value MS_MAP_PATTERN not set." Matt -Original Message- From: MapServer-users On Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users Sent: Wednesday, February 7, 2024 3:24 AM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from mapserver-users@lists.osgeo.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, I'm not sure whether the pattern is correct. Shouldn't ist start with ^? Have yout tried MS_MAP_PATTERN '.'? (not for production, just as a test) Jörg Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapSer
Re: [MapServer-users] CGI variable "map" fails to validate
So, still banging my head against this a month later after eliminating HTTPS as the bogeyman. Using FastCGI and MapServer with the simplest config and what should be an "allow everything" test expression: CONFIG ENV MS_MAP_PATTERN "." END END And all requests return: msLoadMap(): Regular expression error. Filename validation failed. BONUS: If I strip out the map variable from my request, I'd expect the error "CGI variable "map" is not set." but I still get "msLoadMap(): Regular expression error. Filename validation failed." even without providing a map! This is following IISRESET, and I know the config is being loaded (if I remove it, I get "msLoadConfig(): Unable to access file") If I'm not supplying a map parameter in my request and it's not throwing an error that it's missing, what is being used for map value against the expression? (And how do I get it to read my variable in the request?) Thanks for any direction, Matt -Original Message- From: MapServer-users On Behalf Of Lernout, Matthew via MapServer-users Sent: Wednesday, February 7, 2024 3:32 PM To: mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate Hi, After scratching my head for a while, realized all my testing was over HTTPS. Made a localhost connection over HTTP and the map variable was then valid. I was looking in the wrong place - the error reports a failed validation, but that's due to failed certificate trust from what I can see. Thanks for helping me steer into the real issue - I now have a direction to move in! Matt -Original Message- From: Rahkonen Jukka Sent: Wednesday, February 7, 2024 1:05 PM To: Lernout, Matthew ; mapserver-users@lists.osgeo.org Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from jukka.rahko...@maanmittauslaitos.fi. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi, "." works for me. I have a Windows env set first as set MAPSERVER_CONFIG_FILE=\ms4w\ms4w.conf These are the meaningful lines in the "ms4w.conf" file. CONFIG ENV MS_MAP_PATTERN "." END END Test proves that validation is successful http://localhost:8060/cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map msLoadMap(): Unable to access file. (f:\IMS_Maps\Client\projectarea.map) -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: MapServer-users Puolesta Lernout, Matthew via MapServer-users Lähetetty: keskiviikko 7. helmikuuta 2024 19.01 Vastaanottaja: mapserver-users@lists.osgeo.org Aihe: Re: [MapServer-users] CGI variable "map" fails to validate I've ensured I am restarting the mapserv process with each config change - a quick test of commenting out the MS_MAP_PATTERN variable confirmed that is enough to refresh the config via error. Here's a snippet of a sample request. It works with my running instance of Mapserver 7.6.2 but doesn't pass validation (pattern '.') in MapServer 8.0.1. /cgi-bin/mapserv.exe?map=f:\IMS_Maps\Client\projectarea.map Matt -Original Message- From: Seth G Sent: Wednesday, February 7, 2024 11:48 AM To: Lernout, Matthew ; MapServer Users Subject: Re: [MapServer-users] CGI variable "map" fails to validate [You don't often get email from se...@geographika.co.uk. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] Hi Matthew, The CONFIG file I think is only reloaded when IIS or the Application Pool is restarted, so some changes to the regex may have been ignored. Do you have a sample request with the &map= parameter? Is there anything in a web.config file that could be stripping these out or modifying them? Seth -- web:https://geographika.net/ & https://mapserverstudio.net/ twitter: @geographika On Wed, Feb 7, 2024, at 5:33 PM, Lernout, Matthew via MapServer-users wrote: > MS_MAP_PATTERN '.' also results in the same failed validation error, > which is what makes me think the issue may be with another config > setting. '.' should match any input, right? > > Just to make sure my config file was being loaded, I commented out the > MS_MAP_PATTERN entry entirely, and got the error "msCGILoadMap(): Web > application error. Required configuration value MS_MAP_PATTERN not set." > > Matt > > -Original Message- > From: MapServer-users On > Behalf Of Jörg Thomsen (WhereGroup) via MapServer-users > Sent: Wednesday, February 7, 2024 3:24 AM > To: mapserver-users@lists.osgeo.org > Subject: Re: [MapServer-users] CGI variable "map" fails to validate > > [You don't often get email from mapserver-users@lists.osgeo.org. Learn > why this is important at https://aka.ms/LearnAboutSenderIdentification > ] > > Hi, > > I'm not sure whether the pattern is correct. Shouldn't ist start with ^? > > Have yout tried > MS_MAP_PATTERN '.'? (not for production, just as a test) > > Jörg > > Am 06.02.24 um 20:12 schrieb Lernout, Matthew via MapServer-users: >> Hi, >> >> Having trouble makin