adobe / aio-cli-plugin-app

Create, Build and Deploy Cloud Native Applications
Apache License 2.0
19 stars 35 forks source link

action debugging is not working, throws ECONNREFUSED error #729

Open shazron opened 12 months ago

shazron commented 12 months ago

Debug workflow: https://developer.adobe.com/app-builder/docs/resources/debugging/

When the action is debugged in Visual Studio Code, it never gets to "Ready for activations", and throws an ECONNRESET error or just hangs (Windows x86_64, macOS x86_64).

Error Log

C:\test-app-debug/node_modules/.bin/wskdebug.CMD test-app-debug/__secured_generic C:\test-app-debug\actions\generic\index.js -v --disable-concurrency --kind nodejs:14 --inspect-brk=53577
Using openwhisk credential from AIO_runtime_auth environment variable
Agent was already installed, but backup is still present. All good.
- Debugging /53444-shazff8-stage/test-app-debug/__secured_generic on https://adobeioruntime.net
Debugger listening on ws://0.0.0.0:9229/8c0ff2e6-dc66-4856-abd8-da1a9185c4b6
For help, see: https://nodejs.org/en/docs/inspector
Following helper actions are not removed to keep shutdown fast. Remove using --cleanup if desired.
- test-app-debug/__secured_generic_wskdebug_original
- test-app-debug/__secured_generic_wskdebug_invoked
- test-app-debug/__secured_generic_wskdebug_completed
Stopping container wskdebug-test-app-debug-__secured_generic-1694523669978.

FetchError: request to http://0.0.0.0:60813/init failed, reason: connect ECONNREFUSED 0.0.0.0:60813
    at ClientRequest.<anonymous> (C:\openwhisk-wskdebug\node_modules\node-fetch\lib\index.js:1491:11)
    at ClientRequest.emit (node:events:513:28)
    at Socket.socketErrorListener (node:_http_client:494:9)
    at Socket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:157:8)
    at emitErrorCloseNT (node:internal/streams/destroy:122:3)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}

It is failing during a fetch for initializing an action in Docker. This was working previously, not sure if it's a Docker version issue or something else.

Workaround

None for step by step debugging. The alternative is logs.

Verbose wskdebug logs

Before you do an aio app run debug session, update your .env and add this line:

DEBUG=wskdebug
aiojbot commented 11 months ago

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-2542

shazron commented 11 months ago

Might be related: https://github.com/docker/for-mac/issues/6978

pru55e11 commented 6 months ago

Related with some interesting findings: https://github.com/adobe/aio-cli/issues/587