question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v1.5.1 hangs after `executed` call(but works with 1.4.0)

See original GitHub issue

I have following scripts at package.json

{
  "scripts": {
     "db:migrate": "knex-migrate up",
     "db:migrate:drop": "knex-migrate down --to 0",
     "db:migrate:reset": "npm run db:migrate:drop && npm run db:migrate"
  }
}

When I run npm run db:migrate:reset with knex-migrate(v1.5.1), it will hang (looks like waiting for reponse forever?) after this log (of knex with debug:true option)

{ method: 'pluck',
  options: {},
  timeout: false,
  cancelOnTimeout: false,
  bindings: [],
  __knexQueryUid: '794b75ef-f7e5-4600-ac2d-e9224b1bb30a',
  toNative: [Function: toNative],
  sql: 'select "name" from "knex_migrations" order by "id" asc',
  pluck: 'name' }

https://github.com/sheerun/knex-migrate/blob/ceefeeda085089158d3737c9625f920028ed18c6/src/storage.js#L69

But when I downgrade knex-migrate from v1.5.1 to v1.4.0, It works with same configuration(env) 🤔

Postgres logs

I’m not sure is this related…

ERROR:  relation "knex_migrations" does not exist at character 25
STATEMENT:  select count("id") from "knex_migrations"

Versions

npm packages

  • knex@0.14.2
  • knex-migrate@1.5.1

others

  • npm - 4.2.0
  • node - v7.10.0
  • Uses docker image of postgres:10-alpine - PostgreSQL 10.1 on x86_64-pc-linux-musl, compiled by gcc (Alpine 6.3.0) 6.3.0, 64-bit

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
subutacommented, Mar 27, 2018

@sheerun thanks for reply!

If it still exists, could you modify example project in repository to reproduce this issue?

The error still exists, and reproduced at forked repository by following steps

Prerequisites

  • knex v0.14.2
  • knex-migrate v1.5.3
  • Use postgres as a db (cannot reproduced with sqlite3)

Steps to reproduce

  1. git clone https://github.com/subuta/knex-migrate
  2. npm i && npm run build && cd example npm i // build package dir and install dependencies.
  3. docker-compose up // to start postgres
  4. npm run db:migrate:reset

And it looks like this issue consists with 3 suspicious things.

  1. I cannot find exact issue, but knex v0.14.2 has some wrong behavior with postgres?
  2. Because old knex-migrate(v1.4.0) had process.exit(0) after main() resolved, we could ignore non-resolve promise issue at that time(first time when I posted) 😭, but latest(v1.5.3) version not has process.exit(0)

https://github.com/sheerun/knex-migrate/blob/v1.4.0/src/cli.js#L327 https://github.com/sheerun/knex-migrate/blob/master/src/cli.js#L118

  1. These errors might not occur, if you aren’t instantiate knex like this way knex(config.development) at knexfile.js call.

Conclusion

BTW I can confirm these issues are gone, when I upgrade knex from old version(0.14.2) to latest version(0.14.4). So we can close this issue! but it would be nice to add some notice to README or elsewhere 😉

@sheerun @rewop thanks again for your cooperation!

0reactions
sheeruncommented, Mar 26, 2018

@rewop @subuta I’ve update umzig for knex-migrate 1.5.3, does this error happen again?

If it still exists, could you modify example project in repository to reproduce this issue?

@rewop btw. I cannot reproduce unfortunately

Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues — nRF Connect SDK 2.2.99 documentation
The Android CHIP Tool crashes when attempting to start the subscription after typing minimum and maximum subscription interval values. Also, the Subscription ...
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Bug listing with status RESOLVED with resolution FIXED as at 2022/12/31 05:46:05.
Read more >
Changelog | Meteor API Docs
Proving the login results to the _onLoginHook when finishing login inside callLoginMethod . PR. github-oauth@1.4.0. More data will be retrieved and saved under ......
Read more >
OpenFlow Switch Specification - Open Networking Foundation
Version 1.4.0. Table. 0. Table. 1. Table n. Packet. Execute ... omitted) and has priority equal to 0 is called the table-miss flow...
Read more >
Known issues - PaperCut
The Print Deploy client attempts to install printers that have already been installed. 1.2.1194. Resolved. v1.3 Print Deploy and later.
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