[mapserver-users] Regular expression error

Richard Greenwood richard.greenwood at gmail.com
Tue Jun 12 14:14:57 PDT 2012


Steve,

Yeah, the map draws fine. Maybe even too fine because it draws with a
query sting of:
   ogc_fid=430454
and a validation string of:
  'filter_validation_pattern'  'ogc_fid.'
which doesn't look right.

But I'm still looking at what initially caught my attention - hundreds
of mapserver ERRORFILE entries:
  msValidateParameter(): Regular expression error. Parameter pattern
validation failed.

and I'm beginning to think that it's a Windows versus Linux issue.
With the same map file, data and requests I'm seeing the errors in the
Windows instances but not the Linux instances. Do the Windows and
Linux builds use different regex lib's? Again, these are all either
6.0.2 or 6.0.3.

It's not a show stopper but I'd like to figure out if it's me, or my
data, or a mapserver bug. And I'm kind of anal about my log files...

Thanks,
Rich

On Tue, Jun 12, 2012 at 9:47 AM, Lime, Steve D (DNR)
<Steve.Lime at state.mn.us> wrote:
> But the map draws correct? Validation is applied regardless of layer status I think. Wonder what the link is between # of error messages and number of layers. Is validation in layer or web metadata sections?
>
> The validation stuff was all re-written for 6.0. It's possible there are bugs. It's also a relatively expensive operation (lot's of loops- for each parameter, each layer, each class)...
>
> Steve
>
> -----Original Message-----
> From: Richard Greenwood [mailto:richard.greenwood at gmail.com]
> Sent: Tuesday, June 12, 2012 10:25 AM
> To: Lime, Steve D (DNR)
> Subject: Re: [mapserver-users] Regular expression error
>
> Steve -
>
> Cool, much better regex, thanks. But regardless of whether I use your validation & filter or mine, I'm getting 20 errors in my MS_ERRORFILE from that layer when there is no filter=value in the querystring. The layer's status is off in the map file, I'm not requesting it in the query string. I just do a mode=map requesting a different layer and my MS_ERRORFILE has this:
>  msValidateParameter(): Regular expression error. Parameter pattern validation failed.
> repeated 20x.
>
> This is happening in 6.0.2 and 6.0.3 but not 5.6.
>
> Thanks,
> Rich
>
>
> On Tue, Jun 12, 2012 at 9:11 AM, Lime, Steve D (DNR) <Steve.Lime at state.mn.us> wrote:
>> Your regex only allows for 1 character after ogc_fid. I'd rewrite as:
>>
>>  '^ogc_fid=[0-9]{1,5}$'
>>
>> This restricts the number a bit more, plus doesn't allow characters before or after. Really you could to:
>>
>>   VALIDATION
>>     'ogc_fid'  '^[0-9]{1-5}$'
>>   END
>>   FILTER "ogc_fid=%ogc_fid%"
>>
>> That's a lot cleaner.
>>
>> Steve
>>
>> -----Original Message-----
>> From: Richard Greenwood [mailto:richard.greenwood at gmail.com]
>> Sent: Tuesday, June 12, 2012 9:35 AM
>> To: Lime, Steve D (DNR)
>> Cc: mapserver
>> Subject: Re: [mapserver-users] Regular expression error
>>
>> If I don't have any key/value in the query string I get a whole bunch
>> regular expression errors in the error log. In other words, just the
>> presence of that layer in the map file is generating error. An actual
>> value would look like
>>   ogr_fid=123456
>>
>> Thanks,
>> Rich
>>
>> On Tue, Jun 12, 2012 at 8:29 AM, Lime, Steve D (DNR) <Steve.Lime at state.mn.us> wrote:
>>> What value are you trying to validate?
>>>
>>> -----Original Message-----
>>> From: mapserver-users-bounces at lists.osgeo.org
>>> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Richard
>>> Greenwood
>>> Sent: Tuesday, June 12, 2012 9:26 AM
>>> To: mapserver
>>> Subject: [mapserver-users] Regular expression error
>>>
>>> I am getting the error:
>>>  msValidateParameter(): Regular expression error. Parameter pattern validation failed.
>>>
>>> From the following in my LAYER definition:
>>>  METADATA
>>>    'filter_validation_pattern'  'ogc_fid.'
>>>  END
>>>  FILTER "%filter%"
>>>
>>> And I just can't see what I'm doing wrong. I'd sure appreciate another set of eyes...
>>>
>>> Thanks,
>>> Rich
>>>
>>> --
>>> Richard Greenwood
>>> richard.greenwood at gmail.com
>>> www.greenwoodmap.com
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>>>
>>
>>
>>
>> --
>> Richard Greenwood
>> richard.greenwood at gmail.com
>> www.greenwoodmap.com
>>
>>
>
>
>
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
>
>



-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the mapserver-users mailing list