Query issue in the influxdata cloud

Hello to all,

Another new user or better excited new user.
I started to experiment with InfluxDB. I thought that the best way was to start with the cloud. Indeed, easy to set up a bucket, token etc.

I was able to add data in various ways using the influxdb-client-python library. However, when I started to query data back nothing seems to work. More precisely, in my terminal I get:

 Traceback (most recent call last):
  File "/home/angelos/Documents/influxdb_cloud_tests/test1.py", line 24, in <module>
    tables = client.query_api().query(query, org=org)
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/client/query_api.py", line 77, in query
    async_req=False, _preload_content=False, _return_http_data_only=False)
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/service/query_service.py", line 246, in post_query
    (data) = self.post_query_with_http_info(**kwargs)  # noqa: E501
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/service/query_service.py", line 334, in post_query_with_http_info
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/api_client.py", line 341, in call_api
    _preload_content, _request_timeout)
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/api_client.py", line 172, in __call_api
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/api_client.py", line 384, in request
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/rest.py", line 295, in POST
  File "/home/angelos/Documents/influxdb_cloud_v2.0_python/lib/python3.6/site-packages/influxdb_client/rest.py", line 243, in request
    raise ApiException(http_resp=r)
influxdb_client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 11 Aug 2020 13:32:37 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Accept-Encoding, Accept-Encoding', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains', 'trace-id': '6dc385a263fa7131', 'x-platform-error-code': 'not found'})
HTTP response body: b'{"code":"not found","message":"failed to initialize execute state: could not find bucket \\"c853ca908de64f26\\""}'

In terms of code, nothing fancy, I just use the basic examples from the github readme page. Any idea what I have done wrong, please?

Well I don’t know it is a RTFM case but the problem was that I was using the bucket_id instead of the bucket name.

Problem solved.

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.