API URL causes a 500 error
This corresponds to the dataset: https://db.nomics.world/IMF/CPIS?dimensions=%7B%22INDICATOR%22%3A%5B%22I_A_T_T_T_BP6_USD%22%5D%2C%22REF_SECTOR%22%3A%5B%22T%22%5D%2C%22COUNTERPART_SECTOR%22%3A%5B%22T%22%5D%2C%22COUNTERPART_AREA%22%3A%5B%22W00%22%5D%2C%22FREQ%22%3A%5B%22B%22%5D%7D
Error log
Oct 02 10:50:12 oizys gunicorn[43810]: ERROR:flask.app:Exception on /series/IMF/CPIS [GET]
Oct 02 10:50:12 oizys gunicorn[43810]: Traceback (most recent call last):
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/dbnomics_data_model/storages/filesystem.py", line 112, in iter_observations_by_seeking
Oct 02 10:50:12 oizys gunicorn[43810]: line = next(fp)
Oct 02 10:50:12 oizys gunicorn[43810]: StopIteration
Oct 02 10:50:12 oizys gunicorn[43810]: The above exception was the direct cause of the following exception:
Oct 02 10:50:12 oizys gunicorn[43810]: Traceback (most recent call last):
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
Oct 02 10:50:12 oizys gunicorn[43810]: response = self.full_dispatch_request()
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
Oct 02 10:50:12 oizys gunicorn[43810]: rv = self.handle_user_exception(e)
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
Oct 02 10:50:12 oizys gunicorn[43810]: return cors_after_request(app.make_response(f(*args, **kwargs)))
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
Oct 02 10:50:12 oizys gunicorn[43810]: reraise(exc_type, exc_value, tb)
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
Oct 02 10:50:12 oizys gunicorn[43810]: raise value
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
Oct 02 10:50:12 oizys gunicorn[43810]: rv = self.dispatch_request()
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
Oct 02 10:50:12 oizys gunicorn[43810]: return self.view_functions[rule.endpoint](**req.view_args)
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/flasgger/utils.py", line 248, in wrapper
Oct 02 10:50:12 oizys gunicorn[43810]: return function(*args, **kwargs)
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/dbnomics-api-v22/dbnomics-api/dbnomics_api/route_handlers.py", line 406, in series_of_dataset
Oct 02 10:50:12 oizys gunicorn[43810]: dataset_dir, dataset_json, series_codes, series_solr_by_id, args["observations"])
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/dbnomics-api-v22/dbnomics-api/dbnomics_api/json_responses.py", line 209, in build_series_list_for_dataset
Oct 02 10:50:12 oizys gunicorn[43810]: for exc, series_code, observations1 in dataset_dir.iter_observations(found_series_code, offset_by_series_code):
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/dbnomics_data_model/storages/abstract.py", line 150, in iter_observations
Oct 02 10:50:12 oizys gunicorn[43810]: yield from self.iter_observations_from_jsonl(series_codes, offset_by_series_code)
Oct 02 10:50:12 oizys gunicorn[43810]: File "/home/cepremap/virtualenvs/dbnomics-api-v22/lib/python3.7/site-packages/dbnomics_data_model/storages/filesystem.py", line 135, in iter_observations_from_jsonl
Oct 02 10:50:12 oizys gunicorn[43810]: for exc, series_code, observations in iter_observations_by_seeking(fp, offset_by_series_code):
Oct 02 10:50:12 oizys gunicorn[43810]: RuntimeError: generator raised StopIteration
Edited by Christophe Benz