geopython / GeoHealthCheck

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

WFS3 Validate OpenAPI Probe fails initializing on jsonschema #331

Closed justb4 closed 4 years ago

justb4 commented 4 years ago

Describe the bug Error seen from openapi-spec-validator which depends on jsonschema package when opening any WFS3 (OAPIF) Resource.

Screenshots or Logfiles

2020-09-29 11:50:06,955 - factory - ERROR - cannot create class 'GeoHealthCheck.plugins.probe.wfs3.WFS3OpenAPIValidator'
2020-09-29 11:50:06,956 - factory - ERROR - cannot create object instance from class 'GeoHealthCheck.plugins.probe.wfs3.WFS3OpenAPIValidator' e=open: path should be string, bytes or os.PathLike, not _NormalAccessor
2020-09-29 11:50:06,957 - init - ERROR - Exception on /resource/165 [GET]
Traceback (most recent call last):
  File "/venv/lib/python3.7/site-packages/jsonschema/__init__.py", line 31, in <module>
    from importlib import metadata
ImportError: cannot import name 'metadata' from 'importlib' (/usr/local/lib/python3.7/importlib/__init__.py)

Context (please complete the following information):

Additional context This was due to a silent upgrade when Docker Image was rebuilt. (Hint: we should pin ALL packages to have reproducible builds, from pip freeze).

Solution is here (for now) downgrade/pin jsonschema package: https://stackoverflow.com/questions/59216175/importerror-cannot-import-name-metadata-from-importlib so downgrade jsonschema 3.2.0 (default) to jsonschema==3.0.2