Skip to content

Warning: a promise was created in a handler but was not returned from it #545

Closed
@jessev123

Description

@jessev123

I'm submitting a...

  • Bug report
  • Feature request

Current behavior

When running any migration (up or down) the following error presents itself:

Warning: a promise was created in a handler but was not returned from it
    at Function.Migration.registerHook (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/migration.js:41:20)
    at module.exports (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/commands/helper/migration-hook.js:4:20)
    at module.exports (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/commands/up.js:7:3)
    at run (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/lib/commands/run.js:64:9)
    at Object.run (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/api.js:439:16)
    at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/bin/db-migrate:36:19
    at runCallback (timers.js:574:20)
    at tryOnImmediate (timers.js:554:5)
    at processImmediate [as _immediateCallback] (timers.js:533:5)
From previous event:
    at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/db-migrate/bin/db-migrate:35:8
    at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:45:21
    at ondir (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:196:27)
    at onex (/Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:104:32)
    at /Users/jessevanderwerf/taskspace/cloud-service/node_modules/resolve/lib/async.js:24:24
    at FSReqWrap.oncomplete (fs.js:123:15)

Expected behavior

Migrations should return all promises and not warn on extra promises not returning.

Minimal reproduction of the problem with instructions

we have a psql db. we are currently running the following versions:
db-migrate: 0.10.0
db-migrate-pg: 0.2.5
I have tried the latest published versions and still get the same error.
install the latest version of db-migrate and db-migrate-pg and run a migration.
I am attempting to run db-migrate up with no migrations (just to see if the warning goes away without our migrations)
As a side note our migrations are all of the callback variety. It is happening for our whole team.

What is the motivation / use case for changing the behavior?

I would think that if db-migrate is leaving promises un-resolved they would like to know about it verify where (if it is in your codebase) and resolve them and if not then perhaps pin bluebird and notify them of the warnings.

Or

If its something in how we are currently using db-migrate we'd like to modify how we are doing things to remove the warning.

Environment


db-migrate version: 0.10.0
plugins with versions: 0.2.5
db-migrate driver with versions: 
db-migrate-pg v0.2.5 
Additional information:
- Node version: 6.5.0  
- Platform: Mac 

Others:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions