@Nivix neither, as per the doc at https://docs.nodebb.org/en/latest/installing/cloud/heroku.html I have the following in my Procfile:
web: node loader.js --no-daemon --no-silent
@Nivix neither, as per the doc at https://docs.nodebb.org/en/latest/installing/cloud/heroku.html I have the following in my Procfile:
web: node loader.js --no-daemon --no-silent
Here is the log with --no-silent:
2015-09-29T19:42:50.624831+00:00 heroku[api]: Deploy 715e5ac by [email protected]
2015-09-29T19:42:50.624831+00:00 heroku[api]: Release v11 created by [email protected]
2015-09-29T19:42:51.132849+00:00 heroku[web.1]: State changed from crashed to starting
2015-09-29T19:42:56.134355+00:00 heroku[web.1]: Starting process with command `node loader.js --no-daemon --no-silent`
2015-09-29T19:42:58.582537+00:00 app[web.1]: NodeBB v0.7.2 Copyright (C) 2013-2014 NodeBB Inc.
2015-09-29T19:42:58.581013+00:00 app[web.1]:
2015-09-29T19:42:58.582880+00:00 app[web.1]: This program comes with ABSOLUTELY NO WARRANTY.
2015-09-29T19:42:58.582945+00:00 app[web.1]: For the full license, please visit: http://www.gnu.org/copyleft/gpl.html
2015-09-29T19:42:58.582915+00:00 app[web.1]: This is free software, and you are welcome to redistribute it under certain conditions.
2015-09-29T19:42:58.582983+00:00 app[web.1]:
2015-09-29T19:42:58.585384+00:00 app[web.1]: Clustering enabled: Spinning up 1 process(es).
2015-09-29T19:42:58.585388+00:00 app[web.1]:
2015-09-29T19:42:58.969416+00:00 app[web.1]: 29/9 19:42 [14] - info: Time: Tue Sep 29 2015 19:42:58 GMT+0000 (UTC)
2015-09-29T19:42:58.971906+00:00 app[web.1]: 29/9 19:42 [14] - info: Initializing NodeBB v0.7.2
2015-09-29T19:43:00.597928+00:00 app[web.1]: 29/9 19:43 [14] - warn: One or more of NodeBB's dependent packages are out-of-date. Please run the following command to update them:
2015-09-29T19:43:00.597198+00:00 app[web.1]: [outdated] nodebb-plugin-sso-session v1.0.0, requires https://github.com/contentblvd/nodebb-plugin-sso-session.git
2015-09-29T19:43:00.621467+00:00 app[web.1]: [cluster] Child Process (14) has exited (code: 0, signal: null)
2015-09-29T19:43:00.598121+00:00 app[web.1]: 29/9 19:43 [14] - warn: ./nodebb upgrade
2015-09-29T19:43:01.400551+00:00 heroku[web.1]: Process exited with status 0
2015-09-29T19:43:05.707029+00:00 heroku[web.1]: Starting process with command `node loader.js --no-daemon --no-silent`
2015-09-29T19:43:07.737952+00:00 app[web.1]: NodeBB v0.7.2 Copyright (C) 2013-2014 NodeBB Inc.
2015-09-29T19:43:07.738785+00:00 app[web.1]: This program comes with ABSOLUTELY NO WARRANTY.
2015-09-29T19:43:07.735771+00:00 app[web.1]:
2015-09-29T19:43:07.738856+00:00 app[web.1]: This is free software, and you are welcome to redistribute it under certain conditions.
2015-09-29T19:43:07.738915+00:00 app[web.1]: For the full license, please visit: http://www.gnu.org/copyleft/gpl.html
2015-09-29T19:43:07.738985+00:00 app[web.1]:
2015-09-29T19:43:07.742875+00:00 app[web.1]: Clustering enabled: Spinning up 1 process(es).
2015-09-29T19:43:07.742881+00:00 app[web.1]:
2015-09-29T19:43:08.261768+00:00 app[web.1]: 29/9 19:43 [14] - info: Time: Tue Sep 29 2015 19:43:08 GMT+0000 (UTC)
2015-09-29T19:43:08.264657+00:00 app[web.1]: 29/9 19:43 [14] - info: Initializing NodeBB v0.7.2
2015-09-29T19:43:01.412721+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-29T19:43:01.413927+00:00 heroku[web.1]: State changed from crashed to starting
2015-09-29T19:43:09.654606+00:00 app[web.1]: [outdated] nodebb-plugin-sso-session v1.0.0, requires https://github.com/contentblvd/nodebb-plugin-sso-session.git
2015-09-29T19:43:09.655386+00:00 app[web.1]: 29/9 19:43 [14] - warn: One or more of NodeBB's dependent packages are out-of-date. Please run the following command to update them:
2015-09-29T19:43:09.655481+00:00 app[web.1]: 29/9 19:43 [14] - warn: ./nodebb upgrade
2015-09-29T19:43:09.691575+00:00 app[web.1]: [cluster] Child Process (14) has exited (code: 0, signal: null)
2015-09-29T19:43:10.516695+00:00 heroku[web.1]: State changed from starting to crashed
2015-09-29T19:43:10.489869+00:00 heroku[web.1]: Process exited with status 0
Just did a deploy on Heroku. The build succeeded, but when nodded tries to run i get:
2015-09-29T15:28:26.939075+00:00 heroku[api]: Release v7 created by [email protected]
2015-09-29T15:28:28.795032+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2015-09-29T15:28:29.139986+00:00 app[web.1]: fs.js:883
2015-09-29T15:28:29.140014+00:00 app[web.1]: return binding.unlink(pathModule._makeLong(path));
2015-09-29T15:28:29.140017+00:00 app[web.1]: ^
2015-09-29T15:28:29.140019+00:00 app[web.1]: Error: ENOENT, no such file or directory '/app/pidfile'
2015-09-29T15:28:29.140021+00:00 app[web.1]: at Error (native)
2015-09-29T15:28:29.140024+00:00 app[web.1]: at Object.fs.unlinkSync (fs.js:883:18)
2015-09-29T15:28:29.140026+00:00 app[web.1]: at process.Loader.stop (/app/loader.js:226:5)
2015-09-29T15:28:29.140027+00:00 app[web.1]: at process.emit (events.js:104:17)
2015-09-29T15:28:29.140029+00:00 app[web.1]: at Signal.wrap.onsignal (node.js:655:46)
2015-09-29T15:28:30.108059+00:00 heroku[web.1]: Process exited with status 1
2015-09-29T15:28:32.328599+00:00 heroku[web.1]: Starting process with command `node loader.js --no-daemon`
2015-09-29T15:28:27.070703+00:00 heroku[web.1]: State changed from up to starting
2015-09-29T15:28:45.037482+00:00 heroku[web.1]: State changed from starting to up
2015-09-29T17:07:38.359609+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-29T17:07:38.359620+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Node.js app
2015-09-29T18:24:27.288142+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-29T18:24:27.288151+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Node.js app
2015-09-29T18:30:29.652288+00:00 heroku[slug-compiler]: Slug compilation started
2015-09-29T18:30:29.652332+00:00 heroku[slug-compiler]: Slug compilation finished
2015-09-29T18:30:29.585288+00:00 heroku[api]: Deploy 4da95eb by [email protected]
2015-09-29T18:30:29.585288+00:00 heroku[api]: Release v8 created by [email protected]
2015-09-29T18:30:30.805941+00:00 heroku[web.1]: State changed from up to starting
Any ideas / suggestions?
@julian Thanks, I understand that part better now. I added conditionals and now that error goes away. It seems to be working now as designed for that hook -- any suggestions regarding other hooks to use, to achieve the flow I described in my previous message in this thread?
Despite the error in the logs above, I just noticed that the plugin did do its thing, it logged in uid=1 regardless of what what user/pass was submitted.
So far, so good. but not quite the flow I was hoping for.
Here is what I am trying to achieve, maybe there is a better hook to use:
All without the user needing to click the Login link, of course.
Any suggestions? The plugin, as it stands now seems to require a post of the local login form to get triggered, whereas ideally the following logic would happen: IF nodeBB session exists, use it ELSE: look for app session cookie as described above...
Okay, got past the first issue (after learning how to to do ./nodebb dev ) -- I needed to require winston in library.js.
Now I get an error when I try to submit the login form:
9/9 10:53 [2522] - error: /login
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
at ServerResponse.header (/path/to/NodeBB/node_modules/express/lib/response.js:718:10)
at ServerResponse.send (/path/to/NodeBB/node_modules/express/lib/response.js:163:12)
at /path/to/NodeBB/src/controllers/authentication.js:144:27
at Strategy.strategy.error (/path/to/NodeBB/node_modules/passport/lib/middleware/authenticate.js:333:18)
at Strategy.authenticate (/path/to/NodeBB/node_modules/passport-local/lib/strategy.js:93:17)
at attempt (/path/to/NodeBB/node_modules/passport/lib/middleware/authenticate.js:341:16)
at authenticate (/path/to/NodeBB/node_modules/passport/lib/middleware/authenticate.js:342:7)
at continueLogin (/path/to/NodeBB/src/controllers/authentication.js:196:4)
at authenticationController.login (/path/to/NodeBB/src/controllers/authentication.js:121:10)
9/9 10:53 [2522] - error: Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
at ServerResponse.header (/path/to/NodeBB/node_modules/express/lib/response.js:718:10)
at ServerResponse.send (/path/to/NodeBB/node_modules/express/lib/response.js:163:12)
at defaultFn (/path/to/NodeBB/src/middleware/middleware.js:314:10)
at /path/to/NodeBB/src/middleware/middleware.js:362:7
at /path/to/NodeBB/public/src/modules/translator.js:160:6
at /path/to/NodeBB/public/src/modules/translator.js:180:4
at /path/to/NodeBB/public/src/modules/translator.js:226:6
at /path/to/NodeBB/public/src/modules/translator.js:291:4
at fs.js:334:14
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11)
at ServerResponse.header (/path/to/NodeBB/node_modules/express/lib/response.js:718:10)
at ServerResponse.send (/path/to/NodeBB/node_modules/express/lib/response.js:163:12)
at defaultFn (/path/to/NodeBB/src/middleware/middleware.js:314:10)
at /path/to/NodeBB/src/middleware/middleware.js:362:7
at /path/to/NodeBB/public/src/modules/translator.js:160:6
at /path/to/NodeBB/public/src/modules/translator.js:180:4
at /path/to/NodeBB/public/src/modules/translator.js:226:6
at /path/to/NodeBB/public/src/modules/translator.js:291:4
at fs.js:334:14
9/9 10:53 [2522] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
Thoughts?
I am in the earlier stages of writing my first plugin, a SSO plugin that is based off of the gist that @julian provided at https://community.nodebb.org/topic/812/using-php-sessions-with-nodebb/23:
How to create a login override plugin. GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
My plugin is at:
https://github.com/contentblvd/nodebb-plugin-sso-session
And the library.js is almost identical to the gist above. The only change I made it to hardcode the uid variable, for early testing purposes. My thought was that it would auto login to the uid=1 user. (Later I plan to add the real logic for the login)
I have activated the plugin, but nothing happens, nothing shows in the logs either (./nodebb log). As suggested by @julian in the thread linked above, I am trying to use the action:auth.overrideLogin hook.
I am pretty sure I am missing something (or several things!). Any guidance is greatly appreciated.
I think I figured this out after trying to run it locally,
The Heroku install steps say to add the follow dependencies to you package.json:
"dependencies": {
...
"nodebb-plugin-dbsearch": "0.0.10",
"redis": "~0.10.1",
"connect-redis": "~2.0.0"
},
"devDependencies": {
But looking closer, nodebb-plugin-dbsearch is already in the package.json at a higher version. This conflict seemed to cause the crash.
I am guessing that recent versions of nodeBB have changed so this part of the doc is no longer applicable. Here is a pull request to adjust the docs, if I am correct in this assumption:
....since it seems the package.so already has that module in the dependencies, requiring higher version
GitHub (github.com)
I am new new to nodeBB, excited to get things going!
I followed the instructions at:
https://docs.nodebb.org/en/latest/installing/cloud/heroku.html
to install on Heroku and all of the steps seem to go smoothly,
But when I try to view the app, I get a (standard Heroku) "Application Error" message.
Looking at the logs I found the follow, which doesn't seem to provide much insight:
2015-08-12T14:01:15.294630+00:00 heroku[api]: Enable Logplex by [email protected]
2015-08-12T14:01:15.294630+00:00 heroku[api]: Release v2 created by [email protected]
2015-08-12T14:17:42.858141+00:00 heroku[slug-compiler]: Slug compilation started
2015-08-12T14:17:42.858159+00:00 heroku[slug-compiler]: Slug compilation finished
2015-08-12T14:17:42.769401+00:00 heroku[api]: Scale to web=1 by [email protected]
2015-08-12T14:17:42.816196+00:00 heroku[api]: Release v3 created by [email protected]
2015-08-12T14:17:42.816196+00:00 heroku[api]: Deploy f12c3f2 by [email protected]
2015-08-12T14:17:48.326841+00:00 heroku[web.1]: Starting process with command `node loader.js --no-daemon`
2015-08-12T14:17:52.067405+00:00 heroku[web.1]: State changed from crashed to starting
2015-08-12T14:17:52.066137+00:00 heroku[web.1]: State changed from starting to crashed
2015-08-12T14:17:52.040458+00:00 heroku[web.1]: Process exited with status 0
2015-08-12T14:17:56.266234+00:00 heroku[web.1]: Starting process with command `node loader.js --no-daemon`
2015-08-12T14:17:59.226070+00:00 heroku[web.1]: State changed from starting to crashed
2015-08-12T14:17:59.213278+00:00 heroku[web.1]: Process exited with status 0
2015-08-12T14:25:59.584537+00:00 heroku[api]: Scale to web=1 by [email protected]
2015-08-12T14:26:17.967124+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=my-app.herokuapp.com request_id=ed569ab5-5fb9-4d18-af46-6e5294e3958a fwd="24.123.240.91" dyno= connect= service= status=503 bytes=
Thoughts? Are there ways to enable a debug mode to help troubleshoot the reason for the crash?
I am interested in SSO as well. I have seen several threads that mention the "how to" as described by @julian above, but haven't yet seem any real world examples or replies from folks who have done it. I would be great to hear some such examples.
(We are trying to make a decision between nodeBB and Discourse. I like what I am learning about nodeBB so far, but SSO may be important for us. Looking for some added confidence that we'd be able to get an Oauth2 endpoint setup on our app, which is powered by node)