ChuBL / OpenMindat

A Python package for the OpenMindat API.
https://pypi.org/project/openmindat/
Apache License 2.0
4 stars 2 forks source link

Data queries involving multiple pages might return an Internal Server Error. #12

Closed ChuBL closed 7 months ago

ChuBL commented 8 months ago

Bug Report

Bug Type: Server

Observation:

Once the quantity of the queried item is less than the page size, the server will return a Server Error (500).

Case Study:

url1 = ‘https://api.mindat.org/geomaterials/?id__in=&lustretype=Adamantine&page_size=200

The query of url1 involves no more than 600 items; hence, page_size=200 is functional for the first two pages. However, the third page(https://api.mindat.org/geomaterials/?id__in=&lustretype=Adamantine&page=3&page_size=200) is not accessible.

If we increase the page_size to exceed the total item quantity, say 800, the query (https://api.mindat.org/geomaterials/?id__in=&lustretype=Adamantine&page_size=800) will fail directly.

Hazard:

The queries involving multiple pages will fail, e.g., the geomaterials endpoint is somehow experiencing an outage.

ChuBL commented 7 months ago

Fixed.