# Database not found

**URL:** <https://community.influxdata.com/t/database-not-found/30700>\
**Category:** InfluxDB 2\
**Tags:** influxdb, influxql, query, influxdb-cloud-2-0, python\
**Created:** [July 13, 2023, 9:39am UTC](https://community.influxdata.com/t/database-not-found/30700 "2023-07-13T09:39:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oimat](https://avatars.discourse-cdn.com/v4/letter/o/7ea924/32.png) [@Oimat](https://community.influxdata.com/u/Oimat)\
**Post date:** [July 13, 2023, 9:39am UTC](https://community.influxdata.com/t/database-not-found/30700/1 "2023-07-13T09:39:32Z")

</div>

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

```auto
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.

Trying with the http api

```auto

import requests

url = "https://eu-central-1-1.aws.cloud2.influxdata.com"
INFLUXDB_TOKEN= xxx

params = {"db" : "laser-filtre",
          "q" : """SELECT * FROM "courant" """}

headers = {
    'Authorization': f"Token {INFLUXDB_TOKEN}"
    }  

response = requests.get(url + "/query", params=params, headers=headers)
response.text

```

I get the error `'{"results":[{"statement_id":0,"error":"database not found: laser-filtre"}]}\n'`

Here is a screenshot of the InfluxDB, where we can see the bucket’s name and measurements are okay.

[![enter image description here](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/8/8f23d09b424b463b4503576614607e349370260c.png)](https://i.stack.imgur.com/LKYKq.png)

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [July 13, 2023, 5:25pm UTC](https://community.influxdata.com/t/database-not-found/30700/2 "2023-07-13T17:25:15Z")

</div>

Hello @Oimat,  
Thank you for this. Make sure to include your actual bucket name like so:

```auto
query_client = FlightSQLClient(
  host = "eu-central-1-1.aws.cloud2.influxdata.com",
  token = token,
  metadata={"bucket-name": laser-filter})

```

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [July 13, 2023, 5:35pm UTC](https://community.influxdata.com/t/database-not-found/30700/3 "2023-07-13T17:35:05Z")

</div>

You can also try using the python client directly which wraps all of the flightsql info:

> **[GitHub - InfluxCommunity/influxdb3-python: Python module that provides a...](https://github.com/InfluxCommunity/influxdb3-python)**
>
> Python module that provides a simple and convenient way to interact with InfluxDB 3.0. - GitHub - InfluxCommunity/influxdb3-python: Python module that provides a simple and convenient way to inter...

Flight SQL example

> **[InfluxDB, Flight SQL, Pandas, and Jupyter Notebooks Tutorial | InfluxData](https://www.influxdata.com/blog/influxdb-flight-sql-pandas-jupyter-notebooks-tutorial/)**
>
> You can query #InfluxDB Cloud with the Apache Arrow Flight SQL interface, which provides SQL support for working with time series data.

---

<div class="post-metadata">

**Author:** ![Oimat](https://avatars.discourse-cdn.com/v4/letter/o/7ea924/32.png) [@Oimat](https://community.influxdata.com/u/Oimat)\
**Post date:** [July 17, 2023, 12:07pm UTC](https://community.influxdata.com/t/database-not-found/30700/5 "2023-07-17T12:07:49Z")

</div>

It is already included as a variable

```auto

bucket="laser-filtre"
# Define the query client
query_client = FlightSQLClient(
  host = "eu-central-1-1.aws.cloud2.influxdata.com",
  token = token,
  metadata={"bucket-name": bucket})

```

This code is actually almost copy-paste from the tutorial.

---

<div class="post-metadata">

**Author:** ![Oimat](https://avatars.discourse-cdn.com/v4/letter/o/7ea924/32.png) [@Oimat](https://community.influxdata.com/u/Oimat)\
**Post date:** [July 17, 2023, 3:19pm UTC](https://community.influxdata.com/t/database-not-found/30700/6 "2023-07-17T15:19:16Z")

</div>

And with the other sample code, still same problem. Feel free to try with that token, I don’t care about what’s inside

```auto
# 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.

---

<div class="post-metadata">

**Author:** ![Bruins\_Smith](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/bruins_smith/32/13929_2.png) [@Bruins\_Smith](https://community.influxdata.com/u/Bruins_Smith)\
**Post date:** [July 20, 2023, 10:56am UTC](https://community.influxdata.com/t/database-not-found/30700/7 "2023-07-20T10:56:30Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Bruins\_Smith](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/bruins_smith/32/13929_2.png) [@Bruins\_Smith](https://community.influxdata.com/u/Bruins_Smith)\
**Post date:** [July 20, 2023, 11:58am UTC](https://community.influxdata.com/t/database-not-found/30700/8 "2023-07-20T11:58:32Z")

</div>

I fixed this issue by installing the Python package grpcio, “pip install grpcio”.

I can now query my data.

---

<div class="post-metadata">

**Author:** ![De\_Jong](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/de_jong/32/15018_2.png) [@De\_Jong](https://community.influxdata.com/u/De_Jong)\
**Post date:** [February 1, 2024, 4:51pm UTC](https://community.influxdata.com/t/database-not-found/30700/9 "2024-02-01T16:51:48Z")

</div>

I’m encountering database not found issue when querying the data using the influxdb3 javascript client.

I followed the instructions here: [https://github.com/InfluxCommunity/influxdb3-js](https://github.com/InfluxCommunity/influxdb3-js) and double-checked the host, token, and database name.

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’  
}

Please advise. Thanks.
