Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Adding second user causes process to exit #177

Closed
bledek opened this Issue · 7 comments

3 participants

@bledek

The operation acts successful on the client (see attached image)
calipso create user

But on the server side, the following happens:

/Users/brownb/Dev/CMS/calipso/node_modules/mongoose/lib/utils.js:413
        throw err;
              ^
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:645:11)
    at ServerResponse.res.setHeader (/Users/brownb/Dev/CMS/calipso/node_modules/express/node_modules/connect/lib/patch.js:59:22)
    at ServerResponse.res.set.res.header (/Users/brownb/Dev/CMS/calipso/node_modules/express/lib/response.js:515:10)
    at ServerResponse.res.format (/Users/brownb/Dev/CMS/calipso/node_modules/express/lib/response.js:462:8)
    at ServerResponse.res.redirect (/Users/brownb/Dev/CMS/calipso/node_modules/express/lib/response.js:660:8)
    at Promise.<anonymous> (/Users/brownb/Dev/CMS/calipso/modules/core/user/user.js:905:19)
    at Promise.addBack (/Users/brownb/Dev/CMS/calipso/node_modules/mongoose/lib/promise.js:120:8)
    at Promise.EventEmitter.emit (events.js:99:17)
    at Promise.emit (/Users/brownb/Dev/CMS/calipso/node_modules/mongoose/lib/promise.js:59:38)
    at Promise.complete (/Users/brownb/Dev/CMS/calipso/node_modules/mongoose/lib/promise.js:70:20)

This happens on the npm repo install, or the local forked dev environment. The difference between the two is that on the npm version, you cannot log in after restarting the server - the login form does not render the username/password fields. This does not happen with the github version.

@richtera
Collaborator
@bledek

Here is a little better error message:

Module user, error: Cannot read property 'username' of undefined Calipso Module: userTypeError: Cannot read property 'username' of undefined Calipso Module: user
    at /www/martialmarketing.com/webroot/modules/core/user/user.js:722:31
    at me.process (/www/martialmarketing.com/webroot/lib/core/Form.js:1141:14)
    at /www/martialmarketing.com/webroot/lib/core/Form.js:1179:14
    at /www/martialmarketing.com/webroot/lib/core/Form.js:1215:7
    at _asyncMap (/www/martialmarketing.com/webroot/node_modules/async/lib/async.js:190:13)
    at async.forEach (/www/martialmarketing.com/webroot/node_modules/async/lib/async.js:94:25)
    at _asyncMap (/www/martialmarketing.com/webroot/node_modules/async/lib/async.js:187:17)
    at _asyncMap (/www/martialmarketing.com/webroot/node_modules/async/lib/async.js:190:13)
    at async.forEach (/www/martialmarketing.com/webroot/node_modules/async/lib/async.js:82:20)
    at _asyncMap (/www/martialmarketing.com/webroot/node_modules/async/lib/async.js:184:9)
@richtera
Collaborator
@richtera
Collaborator

Make sure that your config file has this:

{
"version": "0.3.0",
"installed": true,
"database": {
"uri": ...
},
"server": {
"name": ...
"authentication": {
"password": true,
"migrate2pbkdf2": true
....
}
...

migrate2pdkdf2 can be false but password is what enabled the username/password form.

Not sure what else it could be. I would need exact steps, os specs and such to try to reproduce.

@bledek

All of those things were in my conf/development.json. The root config.json was empty (just: {}).

@richtera
Collaborator

I published the npm module with the latest changes so there should no longer be a discrepancy between the current master and npm.

@richtera richtera closed this
@LeslieMurphy

I am encountering this exact issue as well - with a fresh install. My error before the app shuts down is:

/var/www/calipso/node_modules/mongoose/lib/utils.js:413
throw err;
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:704:11)
at ServerResponse.res.setHeader (/var/www/calipso/node_modules/express/node_modules/connect/lib/patch.js:59:22)
at ServerResponse.res.set.res.header (/var/www/calipso/node_modules/express/lib/response.js:515:10)
at ServerResponse.res.format (/var/www/calipso/node_modules/express/lib/response.js:462:8)
at ServerResponse.res.redirect (/var/www/calipso/node_modules/express/lib/response.js:662:8)
at Promise. (/var/www/calipso/modules/core/user/user.js:918:19)
at Promise. (/var/www/calipso/node_modules/mongoose/lib/promise.js:120:8)
at Promise.EventEmitter.emit (events.js:98:17)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.