You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wis2box-api prints and an ERROR and traceback when a user attempt to receive an item that does not exist.
I personally find this confusing as traceback makes me think something goes wrong when instead this happens every time we create a new discovery-metadata item.
Is there any way to suppress this ERROR and traceback ? The API can just return 404 when an item does not exist:
[2024-08-25T22:07:19Z] {/usr/lib/python3/dist-packages/elasticsearch/connection/base.py:288} WARNING - GET http://elasticsearch:9200/discovery-metadata/_doc/urn%3Awmo%3Amd%3Adz-meteoalgerie%3Asurface-weather-observations [status:404 request:0.002s]
[2024-08-25T22:07:19Z] {/usr/local/lib/python3.10/dist-packages/pygeoapi/provider/elasticsearch_.py:385} ERROR - NotFoundError(404, '{"_index":"discovery-metadata","_id":"urn:wmo:md:dz-meteoalgerie:surface-weather-observations","found":false}')
[2024-08-25T22:07:19Z] {/usr/local/lib/python3.10/dist-packages/pygeoapi/api/__init__.py:1393} ERROR - identifier not found
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/pygeoapi/provider/elasticsearch_.py", line 362, in get
result = self.es.get(index=self.index_name, id=identifier)
File "/usr/lib/python3/dist-packages/elasticsearch/client/utils.py", line 347, in _wrapped
return func(*args, params=params, headers=headers, **kwargs)
File "/usr/lib/python3/dist-packages/elasticsearch/client/__init__.py", line 1059, in get
return self.transport.perform_request(
File "/usr/lib/python3/dist-packages/elasticsearch/transport.py", line 466, in perform_request
raise e
File "/usr/lib/python3/dist-packages/elasticsearch/transport.py", line 427, in perform_request
status, headers_response, data = connection.perform_request(
File "/usr/lib/python3/dist-packages/elasticsearch/connection/http_urllib3.py", line 291, in perform_request
self._raise_error(response.status, raw_data)
File "/usr/lib/python3/dist-packages/elasticsearch/connection/base.py", line 328, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(
elasticsearch.exceptions.NotFoundError: NotFoundError(404, '{"_index":"discovery-metadata","_id":"urn:wmo:md:dz-meteoalgerie:surface-weather-observations","found":false}')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/pygeoapi/api/itemtypes.py", line 1086, in get_collection_item
content = p.get(
File "/usr/local/lib/python3.10/dist-packages/pygeoapi/util.py", line 799, in get_geojsonf
result = func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pygeoapi/provider/elasticsearch_.py", line 386, in get
raise ProviderItemNotFoundError(err)
pygeoapi.provider.base.ProviderItemNotFoundError: NotFoundError(404, '{"_index":"discovery-metadata","_id":"urn:wmo:md:dz-meteoalgerie:surface-weather-observations","found":false}')
The text was updated successfully, but these errors were encountered:
The snippet I provided is from the logs in wis2box-api when running our automated testing, you can reproduce the behaviour with: python3 wis2box-ctl.py execute wis2box dataset publish /data/wis2box/metadata/discovery/dz-surface-weather-observations.yml
The wis2box-api prints and an ERROR and traceback when a user attempt to receive an item that does not exist.
I personally find this confusing as traceback makes me think something goes wrong when instead this happens every time we create a new discovery-metadata item.
Is there any way to suppress this ERROR and traceback ? The API can just return 404 when an item does not exist:
The text was updated successfully, but these errors were encountered: