# I can't query from the CLI tool but can connect and get a list of buckets

**URL:** <https://community.influxdata.com/t/i-cant-query-from-the-cli-tool-but-can-connect-and-get-a-list-of-buckets/29723>\
**Category:** Client SDKs\
**Created:** [April 29, 2023, 10:15am UTC](https://community.influxdata.com/t/i-cant-query-from-the-cli-tool-but-can-connect-and-get-a-list-of-buckets/29723 "2023-04-29T10:15:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![daslobo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daslobo/32/13329_2.png) [@daslobo](https://community.influxdata.com/u/daslobo)\
**Post date:** [April 29, 2023, 10:15am UTC](https://community.influxdata.com/t/i-cant-query-from-the-cli-tool-but-can-connect-and-get-a-list-of-buckets/29723/1 "2023-04-29T10:15:59Z")

</div>

I’ve posted screen shots on this reddit question: [Reddit - Dive into anything](https://www.reddit.com/r/influxdb/comments/132p2gr/help_pleas_cant_query_from_influx_cli_tool/)

`.\influx bucket list` works as expected and gives this output:

```auto

PS C:\Development\influx> .\influx bucket list
ID Name Retention Shard group duration Organization ID Schema Type
9506194c1d25d186 ESP32Logger 720h0m0s n/a c8401321ff2716be implicit
82b3ad82f0f7b54f _monitoring 168h0m0s n/a c8401321ff2716be implicit
9349c6636671e5b3 _tasks 72h0m0s n/a c8401321ff2716be implicit

```

But when I use this query command:

`.\influx query 'from(bucket:"ESP32Logger") |> range(start:-1h)'`

I get this error:

> Error: failed to execute query: 400 Bad Request: error @1:13-1:24: undefined identifier ESP32Logger

---

<div class="post-metadata">

**Author:** ![AVVS\_Sudheer](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/avvs_sudheer/32/13075_2.png) [@AVVS\_Sudheer](https://community.influxdata.com/u/AVVS_Sudheer)\
**Post date:** [April 29, 2023, 12:09pm UTC](https://community.influxdata.com/t/i-cant-query-from-the-cli-tool-but-can-connect-and-get-a-list-of-buckets/29723/2 "2023-04-29T12:09:41Z")

</div>

Hi,

It will not work at CLI. you have to use that query in UI–\>Explore and script editor

Regards  
Sudheer

---

<div class="post-metadata">

**Author:** ![daslobo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daslobo/32/13329_2.png) [@daslobo](https://community.influxdata.com/u/daslobo)\
**Post date:** [April 29, 2023, 4:02pm UTC](https://community.influxdata.com/t/i-cant-query-from-the-cli-tool-but-can-connect-and-get-a-list-of-buckets/29723/3 "2023-04-29T16:02:25Z")

</div>

Thanks. Is that because I’m using the serverless cloud (IOx) version?

---

<div class="post-metadata">

**Author:** ![AVVS\_Sudheer](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/avvs_sudheer/32/13075_2.png) [@AVVS\_Sudheer](https://community.influxdata.com/u/AVVS_Sudheer)\
**Post date:** [May 2, 2023, 4:45am UTC](https://community.influxdata.com/t/i-cant-query-from-the-cli-tool-but-can-connect-and-get-a-list-of-buckets/29723/4 "2023-05-02T04:45:13Z")

</div>

Hi,

In any version, flux queries will work in UI and not in CLI

Regards  
Sudheer
