... | ... | @@ -42,3 +42,37 @@ You can find Orions API spec here: |
|
|
- [Orion API spec (context broker)](https://fiware.github.io/specifications/ngsiv2/stable/#simplified-entity-representation)
|
|
|
- [QuantumLeap API spec (historic API)](https://app.swaggerhub.com/apis/smartsdk/ngsi-tsdb/0.7)
|
|
|
|
|
|
|
|
|
## Fail to consume data from historical API
|
|
|
|
|
|
if you are getting an error description like "TypeError: unsupported type for timedelta " from the API call
|
|
|
|
|
|
or
|
|
|
|
|
|
if you find the logs of QuantumLeap the following error message:
|
|
|
|
|
|
```
|
|
|
ERROR:root:Something went wrong with QL. Error: unsupported type for timedelta milliseconds component: str
|
|
|
Traceback (most recent call last):
|
|
|
File "/src/ngsi-timeseries-api/src/reporter/query_1T1ENA.py", line 57, in query_1T1ENA
|
|
|
geo_query=geo_query)
|
|
|
File "/src/ngsi-timeseries-api/src/translators/crate.py", line 700, in query
|
|
|
last_n)
|
|
|
File "/src/ngsi-timeseries-api/src/translators/crate.py", line 803, in _format_response
|
|
|
v = self._get_isoformat(v)
|
|
|
File "/src/ngsi-timeseries-api/src/translators/crate.py", line 134, in _get_isoformat
|
|
|
d = timedelta(milliseconds=ms_since_epoch)
|
|
|
TypeError: unsupported type for timedelta milliseconds component: str
|
|
|
```
|
|
|
|
|
|
Then that's probably due to the fact that some data has been pushed to the historical API with wrong date format.
|
|
|
No simple solution has been found for this, you need to delete that entry from the database manually.
|
|
|
The simple (violent) solution is to drop that table of records and start again:
|
|
|
|
|
|
e.g.:
|
|
|
|
|
|
```
|
|
|
curl --location --request DELETE 'http://5.53.108.182:8668/v2/types/WaterQualityObserved' \
|
|
|
--header 'Fiware-Service: carouge'
|
|
|
```
|
|
|
|