"Error: aborted" when querying for results not found in database

See original GitHub issue

Environment

Knex version: 0.21.1 Database + version: Postgres, 11.2 OS: MacOS, Linux for Database (Docker)

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do

After upgrading from 0.20.15 to 0.21.1, any of my queries that would return no results are getting an aborted error, seems like it’s dealing with the connection pool.

  1. Error message
Error: aborted
        at PendingOperation.abort (./project/node_modules/tarn/dist/PendingOperation.js:25:21)
        at./project/node_modules/tarn/dist/Pool.js:203:25
        at Array.map (<anonymous>)
        at ./project/node_modules/tarn/dist/Pool.js:202:53
  1. Reduced test code, for example in https://npm.runkit.com/knex or if it needs real database connection to MySQL or PostgreSQL, then single file example which initializes needed data and demonstrates the problem.

Finding it in simple find by ID queries, and also some complex raw ones, like the following:

const keys = [1]
const flatKeyTubles = [[45, 'THO', '2020-01-01', '2020-04-01']]
const results = await table.whereRaw(
          `
        ("userId", "symbol", "startDate", "endDate") IN
        ( ${keys.map((k) => "(?, ?, ?, ?)")} )
      `,
          flatKeyTuples
        );

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
Aposhiancommented, Jun 8, 2020

I got this error when I was accidentally calling knex.destroy() and then performing more queries on that knex object. (This was with a MySQL client, not Postgres). Knex version 0.21.1

2reactions
mbabauercommented, Jun 4, 2020

@elhigu Did you ever figure out what was causing this issue? I am seeing it on an insert from a unit test using sqllite3 in-memory as the DB. It doesn’t give much info other than “Error: aborted”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >
B.3.2.9 Communication Errors and Aborted Connections
A client attempts to access a database but has no privileges for it. A client uses an incorrect password. A connection packet does...
Read more >
current transaction is aborted, commands ignored until end of ...
I just tried this code and it seems to work, failing silently without having to care about any possible errors, and working when...
Read more >
My query aborted in Amazon Redshift - AWS
If a query is hopped but no matching queues are available, then the canceled query returns the following error message:.
Read more >
Solution to "current transaction is aborted" error for Po...
DROP SEQUENCE FOO; ==>"42P01: Error while executing the query; ERROR: sequence "FOO" does not exist". > SELECT * FROM T1; ==>ERROR: current ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found