alexkli opened a new issue #59:
URL: https://github.com/apache/openwhisk-wskdebug/issues/59


   If the debug port is already used on the system, the container start will 
fail and `wskdebug` will output a not-so-helpful error message:
   
   ```
   Error: Command failed: docker run -d --name wskdebug-dump-1587406223576 --rm 
-m 268435456 -p 8080 -p 9229:9229 -e DEBUG='wskdebug' 
adobeapiplatform/adobe-action-nodejs-v10:3.0.21 node --expose-gc 
--inspect=0.0.0.0:9229 app.js 
   ```
   
   This can actually be caused by `wskdebug` itself if a previous run failed to 
properly shutdown the container.
   
   A better error message and even handling would be possible:
   
   1. (basic) check if the port is already in use on the local system before 
starting the container and if yes, show an error message "debug port 1234 
already in use"
   2. (nicer) if positive, check if a docker container from wskdebug is the one 
with the open port:
   
      1. we should add the fully qualified action name as a [label on the 
container](https://docs.docker.com/engine/reference/commandline/run/#set-metadata-on-container--l---label---label-file):
 `wskdebug-action=/namespace/package/action`
   
      2. if it's the same action then log a note, kill it and proceed
      3. if it's another action, print a clear error message "debug port 1234 
already in use by another wskdebug for action xyz"
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to