Skip to content

Library throws randomly [Error: Failed to execute prepared statement] #207

Closed
@matthiasfeist

Description

@matthiasfeist

Hi DuckDB team!

I have a weird and hard to reproduce error. I'm running a relatively simple query in a loop (the query is easily executed over 10000 times in a short time).
From time to time, the duckDB node API randomly throws an error. I can't find a pattern because sometimes it works for the whole script, sometimes it's every 100 loop-iteration that the error is thrown.

The error in itself is also not very helpful. When I console.log the Error I get:

[Error: Failed to execute prepared statement]

No stacktrace or anything. Only this.

The query I am running in this loop is also very straight forward:

    const reader = await connection.runAndReadAll(
      `SELECT i.id, adminCategoryId, mapping_coop, mapping_coop_level, consumptionMixRule, cm.useCountries, cm.useManufacturingCountry 
      FROM ingredients i LEFT JOIN consumptionMix cm ON i.consumptionMixRule = cm.id
      WHERE hideInHub = false AND adminId = $adminId LIMIT 1`,
      { adminId },
    );
    const result = reader.getRowObjects()[0];

I am using: "@duckdb/node-api": "^1.2.2-alpha.18"

I'm sorry for this shitty bugreport but I can't really re-produce it consistently and I'm not sure how to get more relevant information about the error out of this library.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds reproReproduction of issue is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions