alexa / ask-toolkit-for-vscode

ASK Toolkit is an extension for Visual Studio Code (VSC) that that makes it easier for developers to develop and deploy Alexa Skills.
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html
Apache License 2.0
108 stars 52 forks source link

Skill clone failed. Reason: Git folder setup failed #275

Closed nikhammerellis closed 7 months ago

nikhammerellis commented 1 year ago

Describe the bug

I initially created an Alexa Skill in my personal AWS account for work. I got the VS Code extension installed and the project / code downloaded to the extension. I followed the documentation to a T.

I manually migrated the project over to my company's AWS account and got it working in the Alexa Dev Console. I was initially able to download the skill project / code to the VS Code extension from my personal account.

I added my work AWS profile to the extension. When I attempt to download the code via the ASK VS Code extension, I get the following error: "Skill clone failed. Reason: Git folder setup failed for filepath. Reason: Error: Command failed: git fetch --all --quiet"

Switching back to my personal accounts profile in the extension, I now get the same error and clone failure with the projects in my personal account that I was previously able to download before adding another profile.

I also attempted to create a skill from the extension and then redownload the skill code; this also failed. I've tried deleting profiles and logging in again.

To Reproduce

  1. Having two profiles in the profile manager appears to be causing this issue. I can't identify what else would be.

Extension Logs

I replaced the actual skill ID with zeros.

[verbose - 2023-09-26 18:12:18.575Z] Calling method: getSkillMetadata, args: ["amzn1.ask.skill.00000000-0000-0000-0000-000000000000","development"] [debug - 2023-09-26 18:12:18.799Z] Calling method: askContainer.skillsConsole.cloneSkill, args: [{"label":"amzn1.ask.skill.00000000-0000-0000-0000-000000000000","data":{"skillSummary":{"_links":{"self":{"href":"/v1/skills/amzn1.ask.skill.00000000-0000-0000-0000-000000000000/stages/development/manifest"}},"apis":["custom"],"lastUpdated":"2023-09-25T23:11:11.567Z","nameByLocale":{"en-US":"Community Transit"},"publicationStatus":"DEVELOPMENT","skillId":"amzn1.ask.skill.00000000-0000-0000-0000-000000000000","stage":"development"},"isHosted":true,"hostedSkillMetadata":{"alexaHosted":{"repository":{"type":"GIT","url":"https://git-codecommit.us-east-1.amazonaws.com/v1/repos/00000000-0000-0000-0000-000000000000"},"runtime":"nodejs16.x"}}}}] [verbose - 2023-09-26 18:12:18.799Z] Calling method: createSkillFolder [verbose - 2023-09-26 18:12:28.404Z] Calling method: getSkillNameFromLocales, args: [{"en-US":"Community Transit"},null] [debug - 2023-09-26 18:12:28.404Z] Skill folder c:\Users\nik_e\Desktop\work\community-transit\skills\CommunityTransit already exists. [debug - 2023-09-26 18:12:31.749Z] Confirmed skill folder overwrite option. Overwriting c:\Users\nik_e\Desktop\work\community-transit\skills\CommunityTransit. [verbose - 2023-09-26 18:12:31.756Z] Calling method: cloneSkill, args: [{"f":{},"g":5}] [verbose - 2023-09-26 18:12:31.757Z] Calling method: checkGitInstallation [verbose - 2023-09-26 18:12:31.757Z] Calling method: isGitInstalled [verbose - 2023-09-26 18:12:31.757Z] Executing git command : git --version [verbose - 2023-09-26 18:12:31.831Z] Calling method: setupGitFolder [verbose - 2023-09-26 18:12:32.117Z] Calling method: downloadGitCredentialScript, args: ["c:\Users\nik_e\Desktop\work\community-transit\skills\CommunityTransit"] [verbose - 2023-09-26 18:12:32.118Z] Executing git command : git init "c:\Users\nik_e\Desktop\work\community-transit\skills\CommunityTransit" --quiet [verbose - 2023-09-26 18:12:32.200Z] Executing git command : git config --local credential.https://git-codecommit.us-east-1.amazonaws.com/v1/repos/00000000-0000-0000-0000-000000000000.helper "" [verbose - 2023-09-26 18:12:32.268Z] Executing git command : git config --local --add credential.https://git-codecommit.us-east-1.amazonaws.com/v1/repos/00000000-0000-0000-0000-000000000000.helper "!'C:\Users\nik_e.ask\scripts\git-credential-helper' Nik's Work Profile amzn1.ask.skill.00000000-0000-0000-0000-000000000000" [verbose - 2023-09-26 18:12:32.340Z] Executing git command : git config --local credential.https://git-codecommit.us-east-1.amazonaws.com/v1/repos/00000000-0000-0000-0000-000000000000.UseHttpPath true [verbose - 2023-09-26 18:12:32.413Z] Executing git command : git remote add origin https://git-codecommit.us-east-1.amazonaws.com/v1/repos/00000000-0000-0000-0000-000000000000 [verbose - 2023-09-26 18:12:32.486Z] Executing git command : git fetch --all --quiet [error - 2023-09-26 18:12:33.099Z] Error: Command failed: git fetch --all --quiet

[error - 2023-09-26 18:12:33.099Z] Git folder setup failed for c:\Users\nik_e\Desktop\work\community-transit\skills\CommunityTransit. Reason: Error: Command failed: git fetch --all --quiet

[error - 2023-09-26 18:12:33.100Z] Skill clone failed. Reason: Git folder setup failed for c:\Users\nik_e\Desktop\work\community-transit\skills\CommunityTransit. Reason: Error: Command failed: git fetch --all --quiet

Expected behavior

I expect the skill code to download without issues from the respective AWS Profile account to the VS Code extension.

Screenshots

Desktop (please complete the following information):

Additional context

I am able to see the correct projects listed for each account profile when I attempt to download them, so it is fully aware of their existence, git just fails. I considered it a permissions issue but then I was set to administrator in the skills permissions.

nikhammerellis commented 1 year ago

I want to leave this up so that it can be resolved, what I ended up doing to fix it was go into my .ask folder and remove the profile manually from cli_config since the extension won't allow you to delete the last / default profile. Then I was able to re-sign in, and finally download the code. Seems like some sort of cache issue, but what I noticed is that in cli_config, before I deleted the profile it had the profile name set to what I set it as. After removing it and signing in again, the profile name is now "default". So it had an issue with reassigning the last remaining profile to being the default profile internally.

github-actions[bot] commented 10 months ago

This issue is stale since it has been open for 60 days with no activity. Please respond or this issue will be closed soon.

github-actions[bot] commented 10 months ago

This stale issue has been closed now. Please reopen the issue if you are still having problems with the toolkit.

github-actions[bot] commented 8 months ago

This issue is stale since it has been open for 60 days with no activity. Please respond or this issue will be closed soon.

github-actions[bot] commented 7 months ago

This stale issue has been closed now. Please reopen the issue if you are still having problems with the toolkit.