Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACNA-894 - Action running in local cannot be debugged #128

Closed
kptdobe opened this issue Aug 14, 2020 · 4 comments · Fixed by #129
Closed

ACNA-894 - Action running in local cannot be debugged #128

kptdobe opened this issue Aug 14, 2020 · 4 comments · Fixed by #129
Assignees
Labels
bug Something isn't working

Comments

@kptdobe
Copy link

kptdobe commented Aug 14, 2020

Expected Behaviour

Create an app, run the app with "--local", add a breakpoint in run the action and run the debugger. When action is executed, the debugger pause the execution.

Actual Behaviour

The debugger does not start.

Steps to Reproduce

On a fresh new app, run aio app run --local.
Open VC Code and hit the Run Action:<app>-0.0.1/<action> button from the debugger.

The debugger starts but crashes immediately:

Error: Action not found: <app>-0.0.1/<action>
    at AgentMgr.peekAction (/Users/acapt/work/dev/helix/playground/test/node_modules/@openwhisk/wskdebug/src/agentmgr.js:104:19)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Environment Info

  System:
    OS: macOS 10.15.6
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 2.60 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 10.21.0 - ~/.nvm/versions/node/v10.21.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v10.21.0/bin/npm
  Virtualization:
    Docker: 19.03.12 - /usr/local/bin/docker
  npmGlobalPackages:
    @adobe/aio-cli: 3.7.0

Workaround

I found the issue: the .env file contains the runtime_auth and runtime_namespace twice (almost lower case and uppercase) and the debugger use the lowercase one while it should use the uppercase one.
In fact, the "local override" does not work anymore because of the letters case.

AIO_runtime_auth=abc
AIO_runtime_namespace=def
SERVICE_API_KEY=
AIO_LAUNCH_URL_PREFIX=https://experience.adobe.com/?devMode=true#/custom-apps/?localDevUrl=
AIO_RUNTIME_APIHOST=http://localhost:3233
AIO_RUNTIME_AUTH=xyz
AIO_RUNTIME_NAMESPACE=guest

Workaround is to stop the server, edit the .env and uppercase the 2 variables: AIO_RUNTIME_AUTH and AIO_RUNTIME_NAMESPACE.

cc @meryllblanchet

@meryllblanchet
Copy link

meryllblanchet commented Aug 14, 2020

Thanks for the complete summary, @kptdobe !
We'll have a look on our side.

@aiojbot
Copy link
Collaborator

aiojbot commented Aug 14, 2020

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

@meryllblanchet meryllblanchet transferred this issue from adobe/aio-cli Aug 14, 2020
@shazron
Copy link
Member

shazron commented Aug 23, 2020

When .env is read by aio-lib-core-config, the env var name is normalized to lowercase for uniqueness: https://github.com/adobe/aio-lib-core-config/blob/ebdfbab892f186e581239c585463307b46b1971e/src/Config.js#L50-L61

However, in aio-app-scripts, it is read in verbatim without any processing: https://github.com/adobe/aio-app-scripts/blob/77c47f67406f71bf91c4f9147b562d0dd92d20c9/lib/utils.js#L373

Fix: for any new keys to be set, normalize the key names and remove any existing env values that match the normalized key name.

@shazron shazron transferred this issue from adobe/aio-cli-plugin-app Aug 23, 2020
@shazron shazron changed the title Action running in local cannot be debugged ACNA-894 - Action running in local cannot be debugged Aug 23, 2020
@shazron
Copy link
Member

shazron commented Aug 23, 2020

PR #129

@meryllblanchet meryllblanchet added the bug Something isn't working label Aug 24, 2020
@adobe adobe deleted a comment from aiojbot Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants