Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse dimension values: no <value> children supplied #173

Open
sebastic opened this issue Nov 22, 2017 · 14 comments
Open

Failed to parse dimension values: no <value> children supplied #173

sebastic opened this issue Nov 22, 2017 · 14 comments

Comments

@sebastic
Copy link
Contributor

It looks like the <dimensions> configuration is not actually optional as suggested by comment in the sample configuration.

When the <dimensions> configuration is not present in the mapcache configuration file, or when the sample configuration is used, apache fails to start:

failed to parse dimension values: no <value> children supplied
@jmckenna
Copy link
Member

Actually @tchaddad once hit this same error in MS4W about 10 months ago, with mapcache-master, but I could never reproduce the error locally: https://ms4w.com/trac/ticket/105
mapcache-master-error

@sebastic
Copy link
Contributor Author

My findings are pretty much the same, with the 1.4.1 package from Debian stretch my mapcache configuration (which is a slightly modified default/sample configuration) works as expected, but with the 1.6.1 backport this issue is triggered.

@tbonfort
Copy link
Member

@sebastic, I'm unable to reproduce when there is no present for a tileset. I've updated the sample xml config file with the correct syntax.

@sebastic
Copy link
Contributor Author

sebastic commented Nov 24, 2017

Even with the new syntax the error remains the same when using MapCache 1.6.1.

Having dug through the code a little more, I found the following.

In lib/service_wms.c the _configuration_parse_wms_xml() function calls the mapcache_dimension_values_create() function when it finds a <param> child in a <forwarding_rule> element. Which I have in my configuration:

<forwarding_rule name="WFS">
  <param name="SERVICE" type="values">WFS</param>
  <http>
    <url>http://example.com/some-map/wfs</url>
  </http>
  <append_pathinfo>false</append_pathinfo>
</forwarding_rule>

This will need to use the new syntax like <dimension type="values"> elements too, something the MIGRATION_GUIDE.txt does not document (nor does http://mapserver.org/mapcache/proxying.html).

Updating the syntax for the above fixes the issue in my setup.

@sebastic
Copy link
Contributor Author

While the error at apache startup is resolved, the WMS-C service previously provided by the <service type="wms"> is now no longer working for SERVICE=WMS&REQUEST=GetCabilities requests., logging the following:

failed to validate requested value for dimension (SERVICE)

An explicit <forwarding_rule> for the WMS service needs to be added before the WFS service now:

<forwarding_rule name="WMS">
  <param name="SERVICE" type="values">WMS</param>
  <http>
    <url>http://example.com/some-map/wms</url>
  </http>
  <append_pathinfo>false</append_pathinfo>
</forwarding_rule>

<forwarding_rule name="WFS">
  <param name="SERVICE" type="values">WFS</param>
  <http>
    <url>http://example.com/some-map/wfs</url>
  </http>
  <append_pathinfo>false</append_pathinfo>
</forwarding_rule>

But then the WFS passthrough no longer works because the requested value cannot be validated.

It's unclear to me how WFS passthrough is supposed to be configured now.

@tchaddad
Copy link

@sebastic can you share how you altered your forwarding rule to include the dimension syntax? I still have this problem, and have 2 forwarding rules that probably should be updated...

@sebastic
Copy link
Contributor Author

See my previous comment, that's what I use now. Only the WMS-C works, WFS passthrough doesn't.

@tchaddad
Copy link

Ah ok, thanks - my rules were for just for WMS (GetFeatureInfo and GetLegendGraphic), and syntax was already similar to what you had, so I don't think that was my problem.

Unfortunately, adding the syntax from 145a29b to my tilesets is also not solving my problem, so I guess I need to remain at 1.4.1 for now.

@tchaddad
Copy link

tchaddad commented Feb 20, 2018

Just to report back with some good news - I was able to finally get past this issue (started Apache successfully with MapCache 1.6), by altering my forwarding rules as follows:

Old Syntax:

 <forwarding_rule name="GetLegendGraphic rule">
             <append_pathinfo>true</append_pathinfo>
			<param name="SERVICE" type="values">WMS</param>
			<param name="REQUEST" type="values">GetLegendGraphic</param>
            <http>
               <url>http://www.example.com/some-map/wms</url>
            </http>
 </forwarding_rule> 

<forwarding_rule name="GetFeatureInfo rule">
        <append_pathinfo>true</append_pathinfo>
			<param name="SERVICE" type="values">WMS</param>
			<param name="REQUEST" type="values">GetFeatureInfo</param>
            <http>
               <url>http://www.example.com/some-map/wms</url>
            </http>
 </forwarding_rule>

New Syntax:

<forwarding_rule name="GetLegendGraphicRule">
          <append_pathinfo>true</append_pathinfo>
			<param name="SERVICE" type="values">
				<value>WMS</value>
			</param>
			<param name="REQUEST" type="values">
				<value>GetLegendGraphic</value>
			</param>
            <http>
               <url>http://www.example.com/some-map/wms</url>
            </http>
</forwarding_rule> 

<forwarding_rule name="GetFeatureInfoRule">
          <append_pathinfo>true</append_pathinfo>
			<param name="SERVICE" type="values">
				<value>WMS</value>
			</param>
			<param name="REQUEST" type="values">
				<value>GetFeatureInfo</value>
			</param>
            <http>
               <url>http://www.example.com/some-map/wms</url>
            </http>
</forwarding_rule> 

Hopefully this is helpful to others. Perhaps an example can be added to the sample config or other docs too?

@jmckenna
Copy link
Member

@tchaddad do you think issue #168 (and its solution) is related? (was that "failed to validate requested value for dimension" your most recent error?)

@jmckenna
Copy link
Member

hmm maybe it is not related, but I do wonder if we should go ahead and merge that fix in #168

@tchaddad
Copy link

tchaddad commented Feb 20, 2018

Hmm - no I never got the "failed to validate error", just the "failed to parse" because no child element was supplied. But I suppose I should do some tests to actually use the rule and see if it still works as expected. I'm just glad the first step allows Apache to start!

Another comment - the reason this error was so confusing was that the error message implies missing <value> in <dimensions>, while in this case it was actually missing <value> in the <forwarding_rule>. Without @sebastic pointing in that direction, it would have been very difficult to figure out (thanks!). So differentiating between the 2 problems in the error messages would be helpful to future users.

@jmckenna
Copy link
Member

Yes I'm very happy to hear that you can start Apache now (!!), glad you solved that.

@jbo-ads
Copy link
Member

jbo-ads commented Feb 3, 2020

I created PR #303 on docs to update syntax discrepancies in Proxying Unsupported Requests document. Hope this solves part of the issue.

I also created PR #227 on MapCache to address misleading "dimension" reference. Hope this solves another part of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants