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

Local debugging suddenly stopped working #29

Closed
joerg86 opened this issue Aug 12, 2020 · 11 comments
Closed

Local debugging suddenly stopped working #29

joerg86 opened this issue Aug 12, 2020 · 11 comments
Labels
bug Something isn't working response needed use this if you need more information regarding the issue

Comments

@joerg86
Copy link

joerg86 commented Aug 12, 2020

Describe the bug

Local debugging suddenly stopped working: Requests from the Alexa simulator or my Echo dot are not proxied anymore.

To Reproduce
I am working on a Python / lambda based skill.
In the morning, I set up local debugging following these steps:
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/vs-code-ask-skills.html#test

It worked perfectly: All my requests I made through the Alexa simulator were routed to my local machine and I could see debugging output and exceptions on the VSCode debug console.

Now, a few hours later even after stop and restart of the debugger, restart of VSCode and restart of the whole system, it doesn't work anymore. The response I get always come directly from Lambda. The ASK local debug thing is running, the bar at the bottom is orange, the skill is loaded, but the debug output window stays empty and none of the intents is ever called. Any idea how I can debug what is going wrong here?

Extension Logs
[debug - 2020-08-12 13:00:19.800Z] Calling method: ask.debugAdapterPath, args: [{"name":"Debug Alexa Skill (Python)","type":"python","request":"launch","program":"${command:ask.debugAdapterPath}","pythonPath":"/home/joerg/iubh_alexa/IUBH/venv/bin/python","args":["--accessToken","${command:ask.accessToken}","--skillId","${command:ask.skillIdFromWorkspace}","--skillHandler","lambda_handler","--skillFilePath","/home/joerg/iubh_alexa/IUBH/lambda/lambda_function.py"],"console":"internalConsole","cwd":"/home/joerg/iubh_alexa/IUBH","envFile":"/home/joerg/iubh_alexa/IUBH/.env","env":{"ELECTRON_RUN_AS_NODE":"1","GTK_CSD":"1","USER":"joerg","LANGUAGE":"de_DE","LC_TIME":"de_DE.UTF-8","XDG_SEAT":"seat0","XDG_SESSION_TYPE":"x11","SSH_AGENT_PID":"4175","SHLVL":"0","HOME":"/home/joerg","DESKTOP_SESSION":"pantheon","QT_STYLE_OVERRIDE":"adwaita","GTK_MODULES":"gail:atk-bridge","XDG_SEAT_PATH":"/org/freedesktop/DisplayManager/Seat0","LC_MONETARY":"de_DE.UTF-8","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1000/bus","MANDATORY_PATH":"/usr/share/gconf/pantheon.mandatory.path","QT_QPA_PLATFORMTHEME":"gtk3","LOGNAME":"joerg","DEFAULTS_PATH":"/usr/share/gconf/pantheon.default.path","XDG_SESSION_ID":"c2","GDM_LANG":"de_DE","GTK3_MODULES":"pantheon-filechooser-module","PAPERSIZE":"a4","S_COLORS":"auto","LC_ADDRESS":"de_DE.UTF-8","XDG_RUNTIME_DIR":"/run/user/1000","XDG_SESSION_PATH":"/org/freedesktop/DisplayManager/Session0","DISPLAY":":0","LANG":"de_DE.UTF-8","XDG_CURRENT_DESKTOP":"Unity","LC_TELEPHONE":"de_DE.UTF-8","XDG_SESSION_DESKTOP":"pantheon","XAUTHORITY":"/home/joerg/.Xauthority","XDG_GREETER_DATA_DIR":"/var/lib/lightdm-data/joerg","SSH_AUTH_SOCK":"/run/user/1000/keyring/ssh","LC_NAME":"de_DE.UTF-8","SHELL":"/bin/bash","QT_ACCESSIBILITY":"1","GDMSESSION":"pantheon","LC_MEASUREMENT":"de_DE.UTF-8","GPG_AGENT_INFO":"/run/user/1000/gnupg/S.gpg-agent:0:1","LC_IDENTIFICATION":"de_DE.UTF-8","XDG_VTNR":"7","JAVA_HOME":"/usr/lib/jvm/java-8-openjdk-amd64/","PWD":"/home/joerg","ANDROID_HOME":"/home/joerg/Android/Sdk","XDG_DATA_DIRS":"/usr/share/gnome:/usr/share/pantheon:/home/joerg/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop","XDG_CONFIG_DIRS":"/etc/xdg/xdg-pantheon:/etc/xdg","LC_NUMERIC":"de_DE.UTF-8","LC_PAPER":"de_DE.UTF-8","QT_IM_MODULE":"ibus","XMODIFIERS":"@im=ibus","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","XDG_MENU_PREFIX":"gnome-","SESSION_MANAGER":"local/rog:@/tmp/.ICE-unix/4058,unix/rog:/tmp/.ICE-unix/4058","GIO_LAUNCHED_DESKTOP_FILE":"/usr/share/applications/code.desktop","GIO_LAUNCHED_DESKTOP_FILE_PID":"5038","CHROME_DESKTOP":"code-url-handler.desktop","ORIGINAL_XDG_CURRENT_DESKTOP":"Pantheon","VSCODE_NLS_CONFIG":"{"locale":"de","availableLanguages":{},"_languagePackSupport":true}","VSCODE_NODE_CACHED_DATA_DIR":"/home/joerg/.config/Code/CachedData/91899dcef7b8110878ea59626991a18c8a6a1b3e","VSCODE_LOGS":"/home/joerg/.config/Code/logs/20200812T143336","VSCODE_IPC_HOOK":"/run/user/1000/vscode-f8c03cfe-1.47.3-main.sock","VSCODE_PID":"5038","AMD_ENTRYPOINT":"vs/workbench/services/extensions/node/extensionHostProcess","PIPE_LOGGING":"true","VERBOSE_LOGGING":"true","VSCODE_IPC_HOOK_EXTHOST":"/tmvscode-ipc-4104b89f-80fa-45d5-b78c-0b1a07620a38.sock","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_LOG_STACK":"false","APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL":"true","PATH":"/home/joerg/bin:/home/joerg/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/joerg/Android/Sdk/emulator:/home/joerg/Android/Sdk/tools:/home/joerg/Android/Sdk/tools/bin:/home/joerg/Android/Sdk/platform-tools:/home/joerg/flutter/bin","PYTHONIOENCODING":"UTF-8","PYTHONUNUFFERED":"1"},"stopOnEntry":false,"showReturnValue":true,"debugOptions":["ShowReturnValue","RedirectOutput"],"justMyCode":true,"workspaceFolder":"/home/joerg/iubh_alexa/IUBH","redirectOutput":true}]
[debug - 2020-08-12 13:00:21.703Z] Successfully uploaded telemetry data.
[debug - 2020-08-12 13:00:23.952Z] Successfully uploaded telemetry data.
[debug - 2020-08-12 13:00:25.590Z] Successfully uploaded telemetry data.

Expected behavior

Requests being proxied to my local machine.

Desktop (please complete the following information):

OS: Linux x64 4.15.0-101-generic
Visual Studio Code Version: 1.47.3
Alexa Skills Toolkit Version: 2.0.0
Git Version: git version 2.17.1

@joerg86 joerg86 added the bug Something isn't working label Aug 12, 2020
@nikhilym
Copy link
Contributor

Thanks for reporting this @joerg86 . I assume you might have already tried this, but just for confirmation, did you try closing and restarting the local debug connection again? Currently, there is a 1 hour restriction on an active local debug connection after which the service closes it.

@nikhilym nikhilym added the response needed use this if you need more information regarding the issue label Aug 12, 2020
@joerg86
Copy link
Author

joerg86 commented Aug 12, 2020

Yes, sure. I restarted the debugger, I I restarted VS code, I restarted the computer....nothing worked :-) Can I somehow track this on the AWS side with CloudWatch or so?

@nikhilym
Copy link
Contributor

I expected you already did this, but thanks for responding 😄 . I don't think this can be tracked on the AWS side since this is an Alexa service, outside of AWS stack. So sorry about that.

To investigate this further, can you please provide the following info :

  • Skill ID :
  • Timestamp for a request that lead to failure :

@sattpat
Copy link
Contributor

sattpat commented Aug 12, 2020

Hey @joerg86 along with giving the above info, could you also provide the country that your developer account belongs to? To do so go to - https://www.amazon.com/mn/dcw/myx.html#/home/settings/payment, logging in with the account you are using to debug your skill, click on Preferences and then click on Country/Region Settings

@joerg86
Copy link
Author

joerg86 commented Aug 12, 2020

Hi @nikhilym, here is my request body. I cleaned away some possbily sensitive infos.
My debugger is now online (for the next ~60 minutes I assume), just in case you want to check that.
The launch request below was sent directly to lambda. And yes, this request should fail, because I added a print(asdf) in the code in order to make it throw a NameError. That should be visible in the lambda logs. But nothing coming up here on the debug console. Plus, it reports me back "userAgent": "ask-python/1.11.0 Python/3.7.8", but I am definitely running 3.6.9 in the local debugger.

If I can help you directly by sharing my screen or so, write me an email at [email protected] and I'll send you a Teams or Zoom meeting link.

Thanks,
Jörg

{
"version": "1.0",
"session": {
"new": true,
"sessionId": "amzn1.echo-api.session.XXX",
"application": {
"applicationId": "amzn1.ask.skill.2fab31d4-9098-40dd-8c3a-f431fe07a4a3"
},
"user": {
"userId": "amzn1.ask.account.XXX"
}
},
"context": {
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 160,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1024,
"pixelHeight": 600
}
}
}
}
],
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 246,
"arcMinuteHeight": 144,
"canRotate": false,
"canResize": false
}
],
"shape": "RECTANGLE",
"pixelWidth": 1024,
"pixelHeight": 600,
"dpi": 160,
"currentPixelWidth": 1024,
"currentPixelHeight": 600,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.2fab31d4-9098-40dd-8c3a-f431fe07a4a3"
},
"user": {
"userId": "amzn1.ask.account.XXX"
},
"device": {
"deviceId": "amzn1.ask.device.XXX",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.eu.amazonalexa.com",
"apiAccessToken": "..."
}
},
"request": {
"type": "LaunchRequest",
"requestId": "amzn1.echo-api.request.6f57b074-7540-4934-9d12-c84919de012c",
"timestamp": "2020-08-12T17:02:57Z",
"locale": "de-DE",
"shouldLinkResultBeReturned": false
}
}

@joerg86
Copy link
Author

joerg86 commented Aug 12, 2020

@sattpat The account is US-based. As I am actually Germany-based I followed this to set up a US-based account: https://github.com/alexa/ask-toolkit-for-vscode/wiki/Setting-Up-Local-Debugging-In-Other-Regions

The strange thing is that it worked earlier this morning... and if I try to switch the profile to the Germany-based account, the debugger immediately exits with a message saying I should switch to the US account.

@sattpat
Copy link
Contributor

sattpat commented Aug 12, 2020

@joerg86 as I can see from the request json - "apiEndpoint": "https://api.eu.amazonalexa.com", that means the skill endpoint is still going to EU.

@joerg86
Copy link
Author

joerg86 commented Aug 12, 2020

@sattpat yes, indeed, you are absolutely right. But why? I am definitely logged into the dev console / simulator with the US-based account. It says Texas, US under Settings -> Company Profile. Is it maybe because of the locale? That all de_DE skills are routed via the EU endpoint? Or is there a hidden switch somewhere in the dev console to change the default endpoint?

@joerg86
Copy link
Author

joerg86 commented Aug 12, 2020

@sattpat @nikhilym Problem resolved. Sorry for the trouble!
I think the problem was that I added and later removed the US account from my household. That must have transferred the account to EU. I now added a US address in the Kindle content section thing (that was empty before) and now it works....sorry once again for all the trouble!

@joerg86 joerg86 closed this as completed Aug 12, 2020
@nikhilym
Copy link
Contributor

Thanks for the update @joerg86 . Glad that you got this working.

@sattpat
Copy link
Contributor

sattpat commented Aug 12, 2020

Awesome stuff @joerg86

tydonelson pushed a commit that referenced this issue Mar 18, 2023
- Update Alexa hosted skills deployment page
- Add git operations listener & refactor skill deploy view logic & add export skill package command
- Rebase & add error messages when skill deploy failed
- Improve deploy skill page rendering & change createZipFile input parameter
- Fix bug bash issues:
    Improve deploy skill page rendering (bug #15) &
    Non-hosted skill dynamic skill package path issue (bug #18, #25, #29) &
    Update force deploy indication (bug #22, #24) &
    Add lambda code indication in non-hosted skill deploy page (bug # 26, #27)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working response needed use this if you need more information regarding the issue
Projects
None yet
Development

No branches or pull requests

3 participants