Opened 12 years ago

Last modified 12 years ago

#4187 new defect

wms_enable_request-related errors are not properly tagged as such

Reported by: hobu Owned by: aboudreault
Priority: normal Milestone: 6.2 release
Component: WMS Server Version: unspecified
Severity: normal Keywords:
Cc: dmorissette

Description

If you do not have wms_enable_request set on a layer, but explicitly ask for it via a GetMap or other some such request, you'll only get the blithe error:

` Invalid layer(s) given in the LAYERS parameter. `

Which pretty much tells you nothing about what's going on. The error message(s) could be tweaked to tell you much more info.

Change History (3)

comment:1 by dmorissette, 12 years ago

Cc: dmorissette added
Milestone: 6.2 release
Owner: changed from msogcbugs to aboudreault

Alan, can you please look into this one?

comment:2 by aboudreault, 12 years ago

hobu, you are right that the error is not very explicit but I don't think it's an issue. If the request has not been enabled in the MapFile... that mean exactly that MapServer should not be aware of this layer at all. Basicly, a user would check the GetCapabilities and see the available layers. In a ideal case... a user wouldn't try a GetMap if the layer is not in the GetCapabilities. Unfortunately, I know that all of us do it blindly. My point is that I do not want the user to be able to determine the difference between a non-existing layer and a disabled layer. The code do not handle the difference either.

So, we could change the message to something like:

Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings.

but we will get the same error for non-existing layers so I am not sure if it's worth to add that. Otherwise... I will need to modify the code in all services to write a message for those cases in the debug file. hobu, what do you think?

in reply to:  2 comment:3 by hobu, 12 years ago

Replying to aboudreault:

Unfortunately, I know that all of us do it blindly. My point is that I do not want the user to be able to determine the difference between a non-existing layer and a disabled layer. The code do not handle the difference either.

So, we could change the message to something like:

Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings.

but we will get the same error for non-existing layers so I am not sure if it's worth to add that. Otherwise... I will need to modify the code in all services to write a message for those cases in the debug file. hobu, what do you think?

Updating the error message to hint at why the layer they are explicitly asking for is not GetMap- or GetCapabilites- enabled is improvement, but I disagree with the sentiment that you don't want to discriminate between non-existent layers and non-enabled layers. I explicitly ran into this situation where I was bringing up mapfiles from a 4.10/5.0 setup to 6.2. As far as I was concerned, they were "enabled" (I forgot/didn't know about the wms_enable_request thing), and I was explicitly asking for a layer that I could see in my mapfile. The message didn't tell me why it was "invalid", and the only way I found out was to troll through the source code. Not everyone has that capability.

Note: See TracTickets for help on using tickets.