geopython / GeoHealthCheck

Service Status and QoS Checker for OGC Web Services
https://geohealthcheck.org
MIT License
83 stars 71 forks source link

update OGC API - Feature to official shortname #431

Closed tomkralidis closed 2 years ago

tomkralidis commented 2 years ago

As per OGC guidance using scheme 7

tomkralidis commented 2 years ago

Failures appear unrelated.

justb4 commented 2 years ago

Like said, existing installs with OGC:WFS3 Resources will have startup failures like demo.geohealthcheck.org:

2022-08-02 23:05:36,095 - init - ERROR - Exception on / [GET]
Traceback (most recent call last):
  File "/venv/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/venv/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/venv/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/venv/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/venv/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/venv/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/GeoHealthCheck/GeoHealthCheck/app.py", line 254, in home
    return render_template('home.html', response=response)
  File "/venv/lib/python3.7/site-packages/flask/templating.py", line 140, in render_template
    ctx.app,
  File "/venv/lib/python3.7/site-packages/flask/templating.py", line 120, in _render
    rv = template.render(context)
  File "/venv/lib/python3.7/site-packages/jinja2/environment.py", line 1090, in render
    self.environment.handle_exception()
  File "/venv/lib/python3.7/site-packages/jinja2/environment.py", line 832, in handle_exception
    reraise(*rewrite_traceback_stack(source=source))
  File "/venv/lib/python3.7/site-packages/jinja2/_compat.py", line 28, in reraise
    raise value.with_traceback(tb)
  File "/GeoHealthCheck/GeoHealthCheck/templates/home.html", line 1, in top-level template code
    {% extends "layout.html" %}
  File "/GeoHealthCheck/GeoHealthCheck/templates/layout.html", line 81, in top-level template code
    <li><a href="{{ url_for('resources', lang=g.current_lang, resource_type=rt[0]) }}">{{ resource_types[rt[0]]['label'] }} ({{ rt[1] }})</a></li>
  File "/venv/lib/python3.7/site-packages/jinja2/environment.py", line 452, in getitem
    return obj[argument]
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'OGC:WFS3'
justb4 commented 2 years ago

For reference, to fix this run the SQL script:


UPDATE resource SET resource_type = 'OGCFeat' WHERE resource_type = 'OGC:WFS3';
UPDATE probe_vars SET probe_class = 'GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatCaps' WHERE probe_class = 'GeoHealthCheck.plugins.probe.wfs3.WFS3Caps';
UPDATE probe_vars SET probe_class = 'GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatDrilldown' WHERE probe_class = 'GeoHealthCheck.plugins.probe.wfs3.WFS3Drilldown';
UPDATE probe_vars SET probe_class = 'GeoHealthCheck.plugins.probe.ogcfeat.OGCFeatOpenAPIValidator' WHERE probe_class = 'GeoHealthCheck.plugins.probe.wfs3.WFS3OpenAPIValidator';
DELETE from run where report LIKE '%WFS3%';

Maybe we should still make this an Alembic upgrade, as existing installs with OGC:WFS3 Resources are inaccessible...