onehilltech / blueprint

solid framework for building APIs and backend services
126 stars 26 forks source link

async: Callback was already called #36

Closed bdfoster closed 7 years ago

bdfoster commented 7 years ago

When loading a Blueprint.js server, I get an (extremely vague) error:

$ node ./app/index.js

info: configuration path: /home/bdfoster/Projects/fall2016-group1-apiserver/app/configs
info: configuration environment: development
/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:985
        if (fn === null) throw new Error("Callback was already called.");
                         ^

Error: Callback was already called.
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:985:32
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/@onehilltech/blueprint/lib/ApplicationModule.js:96:16
    at PolicyManager.ResourceManager.load (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/@onehilltech/blueprint/lib/ResourceManager.js:48:12)
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/@onehilltech/blueprint/lib/ApplicationModule.js:94:15
    at nextTask (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:5208:14)
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:5202:13
    at apply (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:41:25)
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:76:12
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:988:16
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/@onehilltech/blueprint/lib/ApplicationModule.js:96:16
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:484:16
    at nextTask (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:5195:29)
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:5202:13
    at apply (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:41:25)
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:76:12
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:988:16
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/@onehilltech/blueprint/lib/ListenerManager.js:73:16
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:484:16
    at iteratorCallback (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:1084:13)
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:988:16
    at /home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:484:16
    at nextTask (/home/bdfoster/Projects/fall2016-group1-apiserver/node_modules/async/dist/async.js:5195:29)

It leads me to believe that there's an issue with Blueprint.js itself, however I can't really confirm given the vague stack trace.

The code for this issue is living in https://github.com/CS450-ECE461/fall2016-group1-apiserver/tree/issue8. The issue occurred when updating from v0.48.1 to v1.1.1, and it was not occurring beforehand. In lib/ResourceController.js, you will see a custom ResourceController that is used in app/controllers/UserController.js. Switching to using blueprint-mongodb's ResourceController has the same results.

NPM and Node.js versions:

$ npm -v
3.10.3
$ node -v
v6.7.0

For reference, here is my package tree:

$ npm list
fall2015-group1-apiserver@0.0.1 /home/bdfoster/Projects/fall2016-group1-apiserver
├─┬ @onehilltech/blueprint@1.1.1
│ ├─┬ body-parser@1.15.2
│ │ ├── bytes@2.4.0
│ │ ├── content-type@1.0.2
│ │ ├── depd@1.1.0
│ │ ├─┬ http-errors@1.5.0
│ │ │ ├── setprototypeof@1.0.1
│ │ │ └── statuses@1.3.0
│ │ ├── iconv-lite@0.4.13
│ │ ├─┬ on-finished@2.3.0
│ │ │ └── ee-first@1.1.1
│ │ ├─┬ raw-body@2.1.7
│ │ │ └── unpipe@1.0.0
│ │ └─┬ type-is@1.6.13
│ │   └── media-typer@0.3.0
│ ├─┬ commander@2.9.0
│ │ └── graceful-readlink@1.0.1
│ ├─┬ consolidate@0.14.1
│ │ └── bluebird@3.4.6
│ ├─┬ cookie-parser@1.4.3
│ │ ├── cookie@0.3.1
│ │ └── cookie-signature@1.0.6
│ ├── dot@1.0.3
│ ├─┬ express@4.14.0
│ │ ├─┬ accepts@1.3.3
│ │ │ └── negotiator@0.6.1
│ │ ├── array-flatten@1.1.1
│ │ ├── content-disposition@0.5.1
│ │ ├── encodeurl@1.0.1
│ │ ├── escape-html@1.0.3
│ │ ├── etag@1.7.0
│ │ ├── finalhandler@0.5.0
│ │ ├── fresh@0.3.0
│ │ ├── merge-descriptors@1.0.1
│ │ ├── parseurl@1.3.1
│ │ ├── path-to-regexp@0.1.7
│ │ ├─┬ proxy-addr@1.1.2
│ │ │ ├── forwarded@0.1.0
│ │ │ └── ipaddr.js@1.1.1
│ │ ├── range-parser@1.2.0
│ │ ├─┬ send@0.14.1
│ │ │ └── destroy@1.0.4
│ │ ├── serve-static@1.11.1
│ │ ├── utils-merge@1.0.0
│ │ └── vary@1.1.0
│ ├─┬ express-session@1.14.1
│ │ ├── crc@3.4.0
│ │ ├── on-headers@1.0.1
│ │ └─┬ uid-safe@2.1.2
│ │   ├── base64-url@1.3.2
│ │   └── random-bytes@1.0.0
│ ├─┬ express-validator@2.20.10
│ │ └── validator@5.7.0
│ ├── extend@3.0.0
│ ├─┬ fs-extra@0.30.0
│ │ ├── jsonfile@2.4.0
│ │ ├── klaw@1.3.0
│ │ ├── path-is-absolute@1.0.1
│ │ └─┬ rimraf@2.5.4
│ │   └── glob@7.1.1
│ ├─┬ morgan@1.7.0
│ │ └── basic-auth@1.0.4
│ ├─┬ multer@1.2.0
│ │ ├── append-field@0.1.0
│ │ ├─┬ busboy@0.2.13
│ │ │ ├─┬ dicer@0.2.5
│ │ │ │ └── streamsearch@0.1.2
│ │ │ └─┬ readable-stream@1.1.14
│ │ │   └── isarray@0.0.1
│ │ ├─┬ concat-stream@1.5.2
│ │ │ ├─┬ readable-stream@2.0.6
│ │ │ │ └── isarray@1.0.0
│ │ │ └── typedarray@0.0.6
│ │ ├── object-assign@3.0.0
│ │ └── xtend@4.0.1
│ ├── mustache@2.2.1
│ ├── node-mime@1.0.0
│ ├── object-path@0.11.2
│ ├─┬ passport@0.3.2
│ │ ├── passport-strategy@1.0.0
│ │ └── pause@0.0.1
│ ├─┬ pug@2.0.0-beta6
│ │ ├─┬ pug-code-gen@1.1.0
│ │ │ ├─┬ constantinople@3.1.0
│ │ │ │ ├── acorn@3.3.0
│ │ │ │ └─┬ is-expression@2.1.0
│ │ │ │   └── object-assign@4.1.0
│ │ │ ├── doctypes@1.1.0
│ │ │ ├── js-stringify@1.0.2
│ │ │ ├── pug-attrs@2.0.1
│ │ │ ├── pug-error@1.3.1
│ │ │ ├── void-elements@2.0.1
│ │ │ └─┬ with@5.1.1
│ │ │   └── acorn-globals@3.0.0
│ │ ├─┬ pug-filters@1.2.4
│ │ │ ├─┬ clean-css@3.4.20
│ │ │ │ └── commander@2.8.1
│ │ │ ├─┬ jstransformer@1.0.0
│ │ │ │ └── is-promise@2.1.0
│ │ │ └── pug-walk@1.0.0
│ │ ├─┬ pug-lexer@2.3.0
│ │ │ ├─┬ character-parser@2.2.0
│ │ │ │ └── is-regex@1.0.3
│ │ │ └─┬ is-expression@3.0.0
│ │ │   ├── acorn@4.0.3
│ │ │   └── object-assign@4.1.0
│ │ ├── pug-linker@1.0.1
│ │ ├─┬ pug-load@2.0.3
│ │ │ └── object-assign@4.1.0
│ │ ├─┬ pug-parser@2.0.1
│ │ │ └── token-stream@0.0.1
│ │ ├── pug-runtime@2.0.2
│ │ └── pug-strip-comments@1.0.1
│ ├── require-all@2.0.0
│ ├── semver@5.3.0
│ └── underscore@1.8.3
├─┬ @onehilltech/blueprint-mongodb@0.9.1
│ └── @onehilltech/blueprint@1.1.1
├── async@2.1.2
├── bcrypt-nodejs@0.0.3
├─┬ chai@3.5.0
│ ├── assertion-error@1.0.2
│ ├─┬ deep-eql@0.1.3
│ │ └── type-detect@0.1.1
│ └── type-detect@1.0.0
├─┬ codeclimate-test-reporter@0.4.0
│ ├── async@1.5.2
│ ├── lcov-parse@0.0.10
│ └─┬ request@2.74.0
│   └─┬ bl@1.1.2
│     └─┬ readable-stream@2.0.6
│       └── isarray@1.0.0
├─┬ cross-env@3.1.3
│ └─┬ cross-spawn@3.0.1
│   └─┬ lru-cache@4.0.1
│     ├── pseudomap@1.0.2
│     └── yallist@2.0.0
├─┬ express-handlebars@3.0.0
│ ├─┬ glob@6.0.4
│ │ ├── inflight@1.0.5
│ │ ├── inherits@2.0.1
│ │ └─┬ minimatch@3.0.3
│ │   └─┬ brace-expansion@1.1.6
│ │     ├── balanced-match@0.4.2
│ │     └── concat-map@0.0.1
│ ├── graceful-fs@4.1.9
│ ├─┬ handlebars@4.0.5
│ │ ├── async@1.5.2
│ │ ├─┬ optimist@0.6.1
│ │ │ └── wordwrap@0.0.2
│ │ ├─┬ source-map@0.4.4
│ │ │ └── amdefine@1.0.0
│ │ └─┬ uglify-js@2.7.3
│ │   ├── async@0.2.10
│ │   ├── source-map@0.5.6
│ │   ├── uglify-to-browserify@1.0.2
│ │   └─┬ yargs@3.10.0
│ │     ├── camelcase@1.2.1
│ │     ├─┬ cliui@2.1.0
│ │     │ ├─┬ center-align@0.1.3
│ │     │ │ └─┬ align-text@0.1.4
│ │     │ │   └── longest@1.0.1
│ │     │ └── right-align@0.1.3
│ │     ├── decamelize@1.2.0
│ │     └── window-size@0.1.0
│ ├─┬ object.assign@4.0.4
│ │ ├─┬ define-properties@1.1.2
│ │ │ └── foreach@2.0.5
│ │ ├── function-bind@1.1.0
│ │ └── object-keys@1.0.11
│ └─┬ promise@7.1.1
│   └── asap@2.0.5
├─┬ handlebars-helpers@0.7.5
│ ├─┬ arr-filter@1.1.1
│ │ └── make-iterator@0.2.1
│ ├── arr-flatten@1.0.1
│ ├─┬ array-sort@0.1.2
│ │ └── kind-of@2.0.1
│ ├─┬ create-frame@0.1.4
│ │ ├── extend-shallow@2.0.1
│ │ └── lazy-cache@2.0.1
│ ├─┬ define-property@0.2.5
│ │ └─┬ is-descriptor@0.1.4
│ │   ├── is-accessor-descriptor@0.1.6
│ │   ├── is-data-descriptor@0.1.4
│ │   └── lazy-cache@1.0.4
│ ├── for-in@0.1.6
│ ├── for-own@0.1.4
│ ├─┬ get-object@0.2.0
│ │ └── isobject@0.2.0
│ ├── get-value@2.0.6
│ ├─┬ helper-date@0.2.2
│ │ ├─┬ date.js@0.2.2
│ │ │ └── debug@0.7.4
│ │ ├─┬ extend-shallow@1.1.4
│ │ │ └── kind-of@1.1.0
│ │ ├── kind-of@2.0.1
│ │ └── moment@2.15.1
│ ├─┬ helper-markdown@0.2.1
│ │ ├─┬ isobject@2.1.0
│ │ │ └── isarray@1.0.0
│ │ └─┬ remarkable@1.7.1
│ │   ├─┬ argparse@0.1.16
│ │   │ ├── underscore@1.7.0
│ │   │ └── underscore.string@2.4.0
│ │   └── autolinker@0.15.3
│ ├─┬ helper-md@0.2.1
│ │ ├── ent@2.2.0
│ │ └── fs-exists-sync@0.1.0
│ ├── html-tag@0.2.1
│ ├── index-of@0.2.0
│ ├─┬ is-even@0.1.1
│ │ └── is-number@1.1.2
│ ├─┬ is-glob@2.0.1
│ │ └── is-extglob@1.0.0
│ ├── is-number@2.1.0
│ ├─┬ is-odd@0.1.0
│ │ └── is-number@1.1.2
│ ├─┬ kind-of@3.0.4
│ │ └── is-buffer@1.1.4
│ ├─┬ lazy-cache@2.0.1
│ │ └─┬ set-getter@0.1.0
│ │   └── to-object-path@0.3.0
│ ├─┬ logging-helpers@0.4.0
│ │ └─┬ chalk@1.1.3
│ │   ├── ansi-styles@2.2.1
│ │   ├─┬ has-ansi@2.0.0
│ │   │ └── ansi-regex@2.0.0
│ │   ├── strip-ansi@3.0.1
│ │   └── supports-color@2.0.0
│ ├── make-iterator@0.3.0
│ ├─┬ micromatch@2.3.11
│ │ ├── arr-diff@2.0.0
│ │ ├── array-unique@0.2.1
│ │ ├─┬ braces@1.8.5
│ │ │ ├─┬ expand-range@1.8.2
│ │ │ │ └─┬ fill-range@2.2.3
│ │ │ │   ├─┬ isobject@2.1.0
│ │ │ │   │ └── isarray@1.0.0
│ │ │ │   ├── randomatic@1.1.5
│ │ │ │   └── repeat-string@1.5.4
│ │ │ ├── preserve@0.2.0
│ │ │ └── repeat-element@1.1.2
│ │ ├─┬ expand-brackets@0.1.5
│ │ │ └── is-posix-bracket@0.1.1
│ │ ├── extglob@0.3.2
│ │ ├── filename-regex@2.0.0
│ │ ├── object.omit@2.0.0
│ │ ├─┬ parse-glob@3.0.4
│ │ │ ├─┬ glob-base@0.3.0
│ │ │ │ └── glob-parent@2.0.0
│ │ │ └── is-dotfile@1.0.2
│ │ └─┬ regex-cache@0.4.3
│ │   ├── is-equal-shallow@0.1.3
│ │   └── is-primitive@2.0.0
│ ├─┬ mixin-deep@1.1.3
│ │ └── is-extendable@0.1.1
│ ├── normalize-path@2.0.1
│ ├─┬ relative@3.0.2
│ │ └─┬ isobject@2.1.0
│ │   └── isarray@1.0.0
│ ├── striptags@2.1.1
│ └── to-gfm-code-block@0.1.1
├── handlebars-layouts@3.1.4
├─┬ istanbul@0.4.5
│ ├── abbrev@1.0.9
│ ├── async@1.5.2
│ ├─┬ escodegen@1.8.1
│ │ ├── estraverse@1.9.3
│ │ ├── esutils@2.0.2
│ │ ├─┬ optionator@0.8.2
│ │ │ ├── deep-is@0.1.3
│ │ │ ├── fast-levenshtein@2.0.5
│ │ │ ├── levn@0.3.0
│ │ │ ├── prelude-ls@1.1.2
│ │ │ ├── type-check@0.3.2
│ │ │ └── wordwrap@1.0.0
│ │ └── source-map@0.2.0
│ ├── esprima@2.7.3
│ ├── glob@5.0.15
│ ├─┬ js-yaml@3.6.1
│ │ └─┬ argparse@1.0.9
│ │   └── sprintf-js@1.0.3
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
│ ├── nopt@3.0.6
│ ├─┬ once@1.4.0
│ │ └── wrappy@1.0.2
│ ├── resolve@1.1.7
│ ├─┬ supports-color@3.1.2
│ │ └── has-flag@1.0.0
│ ├─┬ which@1.2.11
│ │ └── isexe@1.1.2
│ └── wordwrap@1.0.0
├── lodash@4.16.5
├─┬ mocha@3.1.2
│ ├── browser-stdout@1.3.0
│ ├── debug@2.2.0
│ ├── diff@1.4.0
│ ├── escape-string-regexp@1.0.5
│ ├─┬ glob@7.0.5
│ │ └── fs.realpath@1.0.0
│ ├── growl@1.9.2
│ ├── json3@3.3.2
│ └─┬ lodash.create@3.1.1
│   ├─┬ lodash._baseassign@3.2.0
│   │ ├── lodash._basecopy@3.0.1
│   │ └─┬ lodash.keys@3.1.2
│   │   ├── lodash._getnative@3.9.1
│   │   ├── lodash.isarguments@3.1.0
│   │   └── lodash.isarray@3.0.4
│   ├── lodash._basecreate@3.0.3
│   └── lodash._isiterateecall@3.0.9
├─┬ mongoose@4.6.5
│ ├── async@2.0.1
│ ├── bson@0.5.6
│ ├── hooks-fixed@1.2.0
│ ├── kareem@1.1.3
│ ├─┬ mongodb@2.2.11
│ │ ├── es6-promise@3.2.1
│ │ ├─┬ mongodb-core@2.0.13
│ │ │ └─┬ require_optional@1.0.0
│ │ │   └── resolve-from@2.0.0
│ │ └─┬ readable-stream@2.1.5
│ │   └── isarray@1.0.0
│ ├── mpath@0.2.1
│ ├── mpromise@0.5.5
│ ├─┬ mquery@2.0.0
│ │ ├── bluebird@2.10.2
│ │ └── sliced@0.0.5
│ ├── ms@0.7.1
│ ├── muri@1.1.1
│ ├── regexp-clone@0.0.1
│ └── sliced@1.0.1
├─┬ request@2.76.0
│ ├── aws-sign2@0.6.0
│ ├── aws4@1.5.0
│ ├── caseless@0.11.0
│ ├─┬ combined-stream@1.0.5
│ │ └── delayed-stream@1.0.0
│ ├── forever-agent@0.6.1
│ ├─┬ form-data@2.1.1
│ │ └── asynckit@0.4.0
│ ├─┬ har-validator@2.0.6
│ │ ├─┬ is-my-json-valid@2.15.0
│ │ │ ├── generate-function@2.0.0
│ │ │ ├─┬ generate-object-property@1.2.0
│ │ │ │ └── is-property@1.0.2
│ │ │ └── jsonpointer@4.0.0
│ │ └─┬ pinkie-promise@2.0.1
│ │   └── pinkie@2.0.4
│ ├─┬ hawk@3.1.3
│ │ ├── boom@2.10.1
│ │ ├── cryptiles@2.0.5
│ │ ├── hoek@2.16.3
│ │ └── sntp@1.0.9
│ ├─┬ http-signature@1.1.1
│ │ ├── assert-plus@0.2.0
│ │ ├─┬ jsprim@1.3.1
│ │ │ ├── extsprintf@1.0.2
│ │ │ ├── json-schema@0.2.3
│ │ │ └── verror@1.3.6
│ │ └─┬ sshpk@1.10.1
│ │   ├── asn1@0.2.3
│ │   ├── assert-plus@1.0.0
│ │   ├── bcrypt-pbkdf@1.0.0
│ │   ├─┬ dashdash@1.14.0
│ │   │ └── assert-plus@1.0.0
│ │   ├── ecc-jsbn@0.1.1
│ │   ├─┬ getpass@0.1.6
│ │   │ └── assert-plus@1.0.0
│ │   ├── jodid25519@1.0.2
│ │   ├── jsbn@0.1.0
│ │   └── tweetnacl@0.14.3
│ ├── is-typedarray@1.0.0
│ ├── isstream@0.1.2
│ ├── json-stringify-safe@5.0.1
│ ├─┬ mime-types@2.1.12
│ │ └── mime-db@1.24.0
│ ├── node-uuid@1.4.7
│ ├── oauth-sign@0.8.2
│ ├── qs@6.3.0
│ ├── stringstream@0.0.5
│ ├── tough-cookie@2.3.1
│ └── tunnel-agent@0.4.3
├─┬ superagent@2.3.0
│ ├── component-emitter@1.2.1
│ ├── cookiejar@2.1.0
│ ├─┬ form-data@1.0.0-rc4
│ │ └── async@1.5.2
│ ├── formidable@1.0.17
│ ├── methods@1.1.2
│ ├── mime@1.3.4
│ ├── qs@6.2.0
│ └─┬ readable-stream@2.1.5
│   ├── buffer-shims@1.0.0
│   ├── core-util-is@1.0.2
│   ├── isarray@1.0.0
│   ├── process-nextick-args@1.0.7
│   ├── string_decoder@0.10.31
│   └── util-deprecate@1.0.2
├── supertest@2.0.1
├── uuid@2.0.3
├── validator@6.1.0
└─┬ winston@2.2.0
  ├── async@1.0.0
  ├── colors@1.0.3
  ├── cycle@1.0.3
  ├── eyes@0.1.8
  ├── pkginfo@0.3.1
  └── stack-trace@0.0.9
bdfoster commented 7 years ago

Closing, this now looks like it's an issue with our project itself, as evidenced by this PR: https://github.com/CS450-ECE461/fall2016-group1-apiserver/pull/14