-
Notifications
You must be signed in to change notification settings - Fork 55
Enable OpenShift Debugging #33
Comments
Ok, so at some point i was able to remote debug my application running on openshift in the chrome debugger, so i set out to remember how to do it. I had originally used the openshift-test repo, https://github.com/lance/openshift-test. deployed that openshift in debug mode The end of the log of the pod looked sort of like this:
Then from console, i did this: Then went to I wanted to recreate that with a booster, so i took the configmap booster, https://github.com/bucharest-gold/nodejs-configmap, and did the normal deploy stuff, but made sure it was in debug mode using "--build.env NODE_ENV=debug" The end of the pod log for that is similar to this:
Now, when i try to port forward, i keep getting an error about a connection refused, sort of like this:
I think i know why, in the second example, the debugger is never listening since the "--inspect=5858" is in the wrong spot when starting the node process. Not sure how to fix that. I'll check in the nodemon issues |
might be a possible solution remy/nodemon#1226 |
@lholmquist are you sure you don't need to expose that port as a route? |
Ahh - I think you are right @lholmquist - specifically this comment in that issue
|
that almost worked, I added the main section with "./bin/www" and my scripts.start is now "PORT=8080 node ." but it looks like nodemon is stripping that PORT part for some reason.
almost there. with this new setup, if i do a "npm run start" locally, things are working, |
It looks like this is expected behavior for nodemon. from what i've seen, if you want to add an environment variable during the nodemon execution, you do something like @lance i have it in my head that the s2i images are expecting port 8080 for some reason, is that actually true or am i making that up? I think the issue is that our liveness and readiness probes for the boosters are looking for port 8080 if no PORT env is provided, express starts out on port 3000 So there are a couple things we can do for the boosters to add the PORT env variable.
I do need to update all the boosters to include a "main" property and change the start script to what i showed in the previous post. So i will need to update the boosters no matter what |
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to https://github.com/bucharest-gold/centos7-s2i-nodejs/issues/33\#issuecomment-382587104. fixes nodeshift-starters#98
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-starters#93
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-starters#45
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#69
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-starters#44
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-starters#11
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#69
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-starters#45
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-starters#93
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to https://github.com/bucharest-gold/centos7-s2i-nodejs/issues/33\#issuecomment-382587104. fixes nodeshift-archived#26
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to https://github.com/bucharest-gold/centos7-s2i-nodejs/issues/33\#issuecomment-382587104. fixes nodeshift-archived#26
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#93
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#30
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#33
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#69
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#101
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#28
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#31
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#11
npm start will now look at the main property for the entry point. Port 8080 is now set as the default port instead of 3000. This is a fix related to nodeshift-archived/centos7-s2i-nodejs#33\#issuecomment-382587104. fixes nodeshift-archived#4
So i think to close this issue, we really just need to update the docs? perhaps i can write a blog post also, sort of piggybacking off of https://medium.com/@auscunningham/debug-your-openshift-node-js-apps-locally-with-visual-studio-code-vs-code-1b7da847fd9c and not using vscode but just the chrome debugger The fixes i needed to do to the boosters aren't live yet in the launcher, but they are in master of each of the repos, and probably won't be until summit, but that should be ok. |
Enable a debugger to attach to a node.js application running in OpenShift.
ATM, you can set the following environment variables:
which will provide some access over 5858, but you should consider a different solution.
The text was updated successfully, but these errors were encountered: