#2284 closed defect (fixed)

Upgrade to pygeoapi 0.9.0 causes demo error

Reported by: kalxas Owned by: osgeolive@…
Priority: critical Milestone: OSGeoLive14.0
Component: OSGeoLive Keywords: pygeoapi
Cc: osgeolive@…

Description

Setting up python3-pygeoapi (0.9.0-1~focal0) ...
Traceback (most recent call last):
  File "/usr/bin/pygeoapi", line 11, in <module>
    load_entry_point('pygeoapi==0.9.0', 'console_scripts', 'pygeoapi')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pygeoapi/openapi.py", line 878, in generate_openapi_document
    click.echo(yaml.safe_dump(get_oas(s), default_flow_style=False))
  File "/usr/lib/python3/dist-packages/pygeoapi/openapi.py", line 863, in get_oas
    return get_oas_30(cfg)
  File "/usr/lib/python3/dist-packages/pygeoapi/openapi.py", line 422, in get_oas_30
    collections[k]['providers'], 'feature'))
KeyError: 'providers'

Change history (3)

comment:2 Changed 10 months ago by kalxas

Hitting the collections after the fix gives this error:

[2020-12-13T17:44:36Z] {/usr/lib/python3/dist-packages/werkzeug/_internal.py:122} INFO - 127.0.0.1 - - [13/Dec/2020 17:44:36] "GET /collections?f=html HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pygeoapi/util.py", line 351, in get_provider_default
    default = (next(d for i, d in enumerate(providers) if 'default' in d
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/lib/python3/dist-packages/pygeoapi/flask_app.py", line 168, in collections
    headers, status_code, content = api_.describe_collections(
  File "/usr/lib/python3/dist-packages/pygeoapi/api.py", line 106, in inner
    return func(cls, headers_, format_, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pygeoapi/linked_data.py", line 54, in inner
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pygeoapi/api.py", line 340, in describe_collections
    collection_data = get_provider_default(v['providers'])
  File "/usr/lib/python3/dist-packages/pygeoapi/util.py", line 356, in get_provider_default
    default = providers[0]
KeyError: 0

comment:3 Changed 10 months ago by kalxas

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.