Using InfluxDB Cloud, integrated on the AWS suite. Just on the “setting up” page, token has been created, org and bucket. Writing to the bucket is OK, but retrieving data from it fails with a “database not found” error.
The example retrieving code
from flightsql import FlightSQLClient,connect
token = "xxxx"
org = "artilect"
url = "https://eu-central-1-1.aws.cloud2.influxdata.com"
bucket="laser-filtre"
query = """SELECT *
FROM 'census'
WHERE time >= now() - interval '24 hours'
AND ('bees' IS NOT NULL OR 'ants' IS NOT NULL)"""
# Define the query client
query_client = FlightSQLClient(
host = "eu-central-1-1.aws.cloud2.influxdata.com",
token = token,
metadata={"bucket-name": bucket})
# Execute the query
info = query_client.execute(query)
reader = query_client.do_get(info.endpoints[0].ticket)
Which is the tutorial’s code with minimal modification. I get the error FlightUnavailableError: Flight returned unavailable error, with message: empty address list: on the query_client.execute.
And with the other sample code, still same problem. Feel free to try with that token, I don’t care about what’s inside
# 1. Import dependencies.
from flightsql import FlightSQLClient
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from influxdb_client import InfluxDBClient
from influxdb_client.client.write_api import SYNCHRONOUS
# 2. Gather authentication credentials.
token = "xUim0CYGS5MeUAYd9KBmtZQMeE9OtVBjVshOB4uMmbcrgwgxJl6YYnRQZ2Rwnvn0RRv7LtVMPFkSXQoy_Mx0lg=="
url = "https://eu-central-1-1.aws.cloud2.influxdata.com"
org = "artilect"
bucket = "laser-filtre"
# 3. Instantiate the FlightSQL Client
client = FlightSQLClient(host="eu-central-1-1.aws.cloud2.influxdata.com",
token=token,
metadata={'bucket-name': bucket},
features={'metadata-reflection': 'true'})
# 4. Execute a query against InfluxDB's Flight SQL endpoint. Here we are querying for all of our data.
query = client.execute("SELECT * FROM \"courant\"")
# 5. Create reader to consume result
reader = client.do_get(query.endpoints[0].ticket)
# 6. Read all data into a pyarrow.Table
Table = reader.read_all()
# 7. Convert to Pandas DataFrame
df = Table.to_pandas()
df = df.sort_values(by="time")
df.head(20)
Error FlightUnavailableError: Flight returned unavailable error, with message: empty address list:
The first day I managed to make it work, but not after that.
Again, posting works, getting doesn’t. I’m with the trial version, in order to understand if using influxdb cloud or an ec2 influx, but the cloud version doesn’t look to worki well…
I feel the problem is not with the code but the database in itself. Token’s good though.
I’m encountering the same problem, I can write to the database but can’t retrieve anything. I’ve tried to initialize a connection using InfluxDBClient3 and send the query via that instance, but still no luck. Have you had any success in solving this problem?
I can write data to it but not able to query and the error shows:
RpcError: Database ‘[org_id]_[bucket_id]’ not found
at ClientReadableStreamImpl.eval (webpack-internal:///(rsc)/./node_modules/@protobuf-ts/grpc-transport/build/es2015/grpc-transport.js:95:84)
at ClientReadableStreamImpl.emit (node:events:514:28)
at Object.onReceiveStatus (webpack-internal:///(rsc)/./node_modules/@grpc/grpc-js/build/src/client.js:351:28)
at Object.onReceiveStatus (webpack-internal:///(rsc)/./node_modules/@grpc/grpc-js/build/src/client-interceptors.js:308:181)
at eval (webpack-internal:///(rsc)/./node_modules/@grpc/grpc-js/build/src/resolving-call.js:94:78)
at process.processTicksAndRejections (node:internal/process/task_queues:77:11) {
code: ‘NOT_FOUND’,
meta: {},
methodName: ‘DoGet’,
serviceName: ‘arrow.flight.protocol.FlightService’
}