Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query data error - {[[GeneratorState]]: 'suspended'} #528

Open
simonelandi opened this issue Feb 5, 2025 · 0 comments
Open

Query data error - {[[GeneratorState]]: 'suspended'} #528

simonelandi opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@simonelandi
Copy link

Specifications

  • Client Version: "^1.0.0"
  • InfluxDB Version: V3
  • Platform: Nodejs - v. 23.7.0

Following the documentation and the examples available we tried to setup a nodejs service aiming to write and read data from an InfluxDB bucket.

The client initialization and point creation was a-ok but as soon as we run the client.query() function we always end up with the following generator state in the response payload: {[[GeneratorState]]: 'suspended'}.

We tried to run several tests in order to sort this issue out but the other results we got were all Uncaught RpcError RpcError: Received HTTP status code 405.

In the end, we rollback to V2 node client and we were able to read/write data without errors.

Thanks in advance for your help.

Code sample to reproduce problem

In our code we instantiate a client as follows:

// client init - ok
client = new InfluxDBClient({
    host: 'my-azure-endpoint',
    token: 'my-token'
})

//point creation - ok
const p = Point.measurement(measurement)
      .setTag('unit', 'temperature')
      .setFloatField('avg', 24.5)
      .setFloatField('max', 45.0)
      .setTimestamp(new Date()
)
await client.write(p, database)

// bucket query - error
const query = `
      SELECT *
      FROM "${measurement}"
      WHERE
      time >= now() - interval '20 minute'
      AND
      "unit" IN ('temperature')`;
const queryResult = client.query(query, database, {type: 'sql'})
for await (const row of queryResult) {
      console.log(`avg is ${row.avg}`)
      console.log(`max is ${row.max}`)
}

Expected behavior

When running the client.query() function we expect the queryResult variable to be and array of Points to be iterated.

Actual behavior

We received a response payload object with this attribute: {[[GeneratorState]]: 'suspended'}

Additional info

No response

@simonelandi simonelandi added the bug Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant