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

"TypeError: 'NoneType' object is not iterable" if WFS server returns an HTML document instead of XML capabilities #8000

Open
danduk82 opened this issue Mar 25, 2021 · 2 comments

Comments

@danduk82
Copy link
Member

Bug description:

if the WFS URL is set to a server that respond with an html document, the attributes are set to None, and the themes.py raises the following error TypeError: 'NoneType' object is not iterable at returns a Http 500 status at this line.

In my opinion it is strange that attributes is still of NoneType at this stage (it is intialized as None here, as it should have been re-initialized to an empty dict here and overwritten. But it appears not to be the case.

Expected behaviour:

At least the exception should be correctly handled and not return a 500.

Ideally the wfs parser should return an empty dict with an error that tells that it didn't receive a valid WFS capability response.

How to reproduce:

We found this bug because of a misconfiguration in admin interface by the client. To reproduce the bug create an OGC server with the following configuration:

BASIS_URL = https://geodienste.ch/db/av_0/deu
WFS_URL = https://geodienste.ch/
[x] WFS support

GMF versions

(we found the bug on 2.5, I presume the problem is still present in 2.6 and master, but I didn't test)

  • 2.5
  • 2.6
  • master
@vuilleumierc
Copy link
Member

I ran into the same error with the following parameters (also on 2.5):

BASIS_URL = https://wms.geo.admin.ch/?VERSION=1.3.0
WFS_URL = 
[x] WFS support

The WMS version is used for the WFS request and it is not supported by the server, although it responds with an XML (https://wms.geo.admin.ch/?VERSION=1.3.0&SERVICE=WFS&REQUEST=DescribeFeatureType&ROLE_ID=0&USER_ID=0)

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

2 participants