GithubHelp home page GithubHelp logo

Comments (26)

coolbigbear avatar coolbigbear commented on June 9, 2024 3

@SpellMender Great to hear it worked for you!

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024 1

Excellent! @coolbigbear's solution worked for me! I didn't even have to revert back to a different version of VSCode!

From start to finish, here's the process for me to export a skill from the Amazon Developer Console to VSCode:

  1. From the Alexa Developer Console go to the "Code" tab
    image
  2. Select "Offline Tools" on the toolbar above the code
    image
  3. Select "Export to VSCode"
    image
  4. You will be prompted to select a folder to load your project into. You don't have to create a new folder. A folder with the name of your project will be created for you. Then the project will fail with the error Skill clone failed. Reason: Git folder setup failed
    image
  5. Open a new Explorer window and navigate to C:\Users\<your_user_name>\.ask\scripts\
    image
  6. Both of these files need to be edited. Double-click and open with your favorite text editor (in my case it was Notepad++)
    image
  7. Both of those files have a line beginning with askRefreshToken=.

askRefreshToken=$(tr -d '\n' < ${configFile} | tr -d ' ' | sed -n $configOp | sed 's/".*//')

You must add double quotes around ${ConfigFile} for both files. Be sure to save your changes.

askRefreshToken=$(tr -d '\n' < "${configFile}" | tr -d ' ' | sed -n $configOp | sed 's/".*//')

  1. Now navigate back to VSCode and make sure to open the folder with your skill (if its not already opened) in your workspace.
    image
  2. Open up a Terminal
    image
  3. Type the command git fetch and press enter. Type the command git checkout dev and press enter.
    image

You will now see files populate in your workspace:
image

I figured if anyone on the internet is as visual a learner as I am, this should be helpful.

I'm hoping there is a quicker, easier resolution found soon.

EDIT: You should probably use git checkout master and git checkout prod as well. I used git checkout dev in the example above because that seems to be the branch that is associated with the code you actually edit in the Alexa Developer Console.

from ask-toolkit-for-vscode.

HimanshuPrimo avatar HimanshuPrimo commented on June 9, 2024 1

Hi @tydonelson,

Thanks for the response. It has been really helpful, and I greatly appreciate it. I had an older version of Git, but the issue has now been resolved.

from ask-toolkit-for-vscode.

nikhilym avatar nikhilym commented on June 9, 2024

@khac , thanks for logging the bug. This seems to be similar to the bug #54 . We figured the issue is with respect to a bug in our clone skill functionality and fixed it through the PR #56 . However, that fix has not been released in the extension.

Sorry for the inconvenience. We will be working on releasing the patch soon.

In the mean time, to get around this, you can manually install the earlier version of the toolkit from the marketplace and try creating/downloading the skills. Once downloaded, for using the latest toolkit features you can upgrade it back to the latest version. We understand this is painful, is not the best developer experience and will try to address this through our next release ASAP.

from ask-toolkit-for-vscode.

khac avatar khac commented on June 9, 2024

@nikhilym, I installed an older version, v2.0.2
The error was the same when I tried to Create an Alexa-hosted skill, at the same time, I was able to see the skill being created on the Alexa developer console.

Skill creation failed. Reason: Git folder setup failed for /Users/a/Desktop/AlexaSkills/qwer123. Reason: Failed to execute git { "exitCode": 1, "gitCommand": "checkout", "stdout": "", "stderr": "error: pathspec 'prod' did not match any file(s) known to git\n" }
  • Could you mention how to sync VS Code with the Amazon Developer Console - git, so that command line git works

  • One workaround is, to create the skill with ASK Toolkit then download the code from Amazon Developer Console

from ask-toolkit-for-vscode.

nikhilym avatar nikhilym commented on June 9, 2024

Interesting. I was not able to reproduce this error. Can you please provide some more details about your toolkit configuration? Please run Alexa: About Alexa Skill Toolkit command from command palette, and paste that information here. For context, here is my toolkit configuration :

OS: Darwin x64 19.6.0
Visual Studio Code Version:  1.51.1
Alexa Skills Toolkit Version: 2.1.0
Git Version: git version 2.29.2

Also, can you try downloading the skill and see if the issue persists? Is it happening for an existing skill as well or only for a new skill?

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024

Any news on the update? I'm having the same problem.

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024

@nikhilym here is what shows up when I run Alexa: About Alexa Skill Toolkit
alexa

from ask-toolkit-for-vscode.

Chih-Ying avatar Chih-Ying commented on June 9, 2024

@SpellMender @khac Thanks for reporting.
Are you able to run git fetch, git checkout prod and git checkout master in the skill root directory using the command line?
Also, is it happening for an existing skill as well or only for a new skill??

from ask-toolkit-for-vscode.

khac avatar khac commented on June 9, 2024

@nikhilym @Chih-Ying
OS: Darwin x64 19.6.0
Visual Studio Code Version: 1.51.1
Alexa Skills Toolkit Version: 2.1.0
Git Version: git version 2.28.0

My git is connected to my github.com account, not the Alexa or AWS account, I was able to download the files from Amazon Developer Console

  • Kindly let me know how to connect again to the git repository on the cloud to run the git commands.

from ask-toolkit-for-vscode.

coolbigbear avatar coolbigbear commented on June 9, 2024

Having the same issue.
OS: Windows_NT x64 10.0.19042 Visual Studio Code Version: 1.51.1 Alexa Skills Toolkit Version: 2.1.0 Git Version: git version 2.23.0.windows.1

Clicking on Download and edit skill also does nothing.
Error:
Skill creation failed. Reason: Git folder setup failed for ...\AlexaSkills\test-test\test-test. Reason: Failed to execute git { "exitCode": 128, "gitErrorCode": "AuthenticationFailed", "gitCommand": "fetch", "stdout": "", "stderr": "...\.ask\\scripts\\git-credential-helper: line 11: ${configFile}: ambiguous redirect\n ...\.ask\\scripts\\git-credential-helper: line 11: ${configFile}: ambiguous redirect\nfatal: Authentication failed for 'https://git-codecommit.us-east-1.amazonaws.com/v1/repos/8b1aa862-0611-47fa-80bf-f6c054a0828c/'\n" }

I can execute git fetch just fine

from ask-toolkit-for-vscode.

Chih-Ying avatar Chih-Ying commented on June 9, 2024

@nikhilym @Chih-Ying
OS: Darwin x64 19.6.0
Visual Studio Code Version: 1.51.1
Alexa Skills Toolkit Version: 2.1.0
Git Version: git version 2.28.0

My git is connected to my github.com account, not the Alexa or AWS account, I was able to download the files from Amazon Developer Console

  • Kindly let me know how to connect again to the git repository on the cloud to run the git commands.

@khac The ASK Toolkit extension automatically initializes git and configures git credentials for users, so users can access the AWS CodeCommit repository that the hosted skill resides at. This git is using a different account from your personal git account.

More information you can look into FAQs:Why do I get a prompt for Git credentials when an Alexa hosted skill is created or downloaded?

Can you successfully run git fetch, git checkout prod and git checkout master in the skill root folder without error messages? Can you share the error messages if any?

from ask-toolkit-for-vscode.

Chih-Ying avatar Chih-Ying commented on June 9, 2024

@khac @SpellMender @coolbigbear
We observed the Download and edit skill does not work in the latest Visual Studio Code(version 1.51). We are currently investigating.

To unblock your work, please downgrade your Visual Studio Code to 1.50 <= , Please let us know if skill creation and downloading still do not work.

from ask-toolkit-for-vscode.

coolbigbear avatar coolbigbear commented on June 9, 2024

Downgrading to 1.49.3 does make Download and edit skill button work.
However, it fails later with the same issue I mentioned (Skill creation failed. Reason: Git folder setup failed for), git fetch also did not work this time.

I managed to fix it by simply adding quotes around ${configFile} inside the git-credential-helper.
Specifically:

  1. Opened git-credential-helper in notepad. For me located in C:\Users\<user_name>\.ask\scripts
  2. Changed the ${configFile} on this line askRefreshToken=$(tr -d '\n' < ${configFile} | tr -d ' ' | sed -n $configOp | sed 's/".*//') to be surrounded by quotes i.e. "${configFile}"
  3. git fetch worked fine in the directory now and using Download and edit skill while on VSCode version = 1.49.3 works.

from ask-toolkit-for-vscode.

coolbigbear avatar coolbigbear commented on June 9, 2024

Downgrading to 1.49.3 does make Download and edit skill button work.
However, it fails later with the same issue I mentioned (Skill creation failed. Reason: Git folder setup failed for), git fetch also did not work this time.

I managed to fix it by simply adding quotes around ${configFile} inside the git-credential-helper.
Specifically:

  1. Opened git-credential-helper in notepad. For me located in C:\Users\<user_name>\.ask\scripts
  2. Changed the ${configFile} on this line askRefreshToken=$(tr -d '\n' < ${configFile} | tr -d ' ' | sed -n $configOp | sed 's/".*//') to be surrounded by quotes i.e. "${configFile}"
  3. git fetch worked fine in the directory now and using Download and edit skill while on VSCode version = 1.49.3 works.

Pushing updates failed due to the same error but in ask-pre-push script inside the same directory.
Identical fix worked

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024

@Chih-Ying

When I run git fetch:
image

When I run git checkout prod:
image

When I run git checkout master:
image

Also, it happens for both new and existing skills. As mentioned above, you can't use the ASK in VSCode to retrieve an existing skill, but you can do it from Alexa Developer Console via this menu:
image

The result is always the same though.

from ask-toolkit-for-vscode.

Chih-Ying avatar Chih-Ying commented on June 9, 2024

Downgrading to 1.49.3 does make Download and edit skill button work.
However, it fails later with the same issue I mentioned (Skill creation failed. Reason: Git folder setup failed for), git fetch also did not work this time.
I managed to fix it by simply adding quotes around ${configFile} inside the git-credential-helper.
Specifically:

  1. Opened git-credential-helper in notepad. For me located in C:\Users\<user_name>\.ask\scripts
  2. Changed the ${configFile} on this line askRefreshToken=$(tr -d '\n' < ${configFile} | tr -d ' ' | sed -n $configOp | sed 's/".*//') to be surrounded by quotes i.e. "${configFile}"
  3. git fetch worked fine in the directory now and using Download and edit skill while on VSCode version = 1.49.3 works.

Pushing updates failed due to the same error but in ask-pre-push script inside the same directory.
Identical fix worked

@coolbigbear
It’s nice to hear this solution works for you!

I was thinking about this solution as well, but I could not reproduce skill creation fail
on Windows

OS: Windows_NT x64 10.0.17763
Visual Studio Code Version: 1.51.1
Alexa Skills Toolkit Version: 2.1.0
Git Version: 2.23.0.windows.1

and Mac

OS: Darwin x64 18.7.0
Visual Studio Code Version:  1.51.0
Alexa Skills Toolkit Version: 2.1.0
Git Version: git version 2.28.0

@SpellMender
Thanks for your report.
Could you also try the solution @coolbigbear provided?

We will consider these environment settings into our test cases.

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024

@Chih-Ying I've already attempted his solution. Unfortunately I can't find the .ask\script folder. In fact, my .ask folder is completely blank. I've tried to create a new skill via ASK, and I've tried to use a current skill. Same issue with both attempts. I will try to roll back the VSCode version to see if that helps, but I have my doubts. @coolbigbear if you have any suggestions to reproduce those results I'd love to hear them.

from ask-toolkit-for-vscode.

Chih-Ying avatar Chih-Ying commented on June 9, 2024

@SpellMender
According to your git fetch error message above, I saw you have the file in C:\Users\<your_user_name>\.ask\scripts\git-credential-helper.
The .ask folder is not located at your skill project, but in your system at C:\Users\<your_user_name>\.ask.

from ask-toolkit-for-vscode.

coolbigbear avatar coolbigbear commented on June 9, 2024

@SpellMender Looks like you have the exact same issue as me.
Look in your C:\Users\Michael Kellet\.ask\scripts folder, should be located there
You'd also need to fix the ask-pre-push script while you're in there to be able to push changes.

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024

Thanks! Sorry for the confusion. I'll try that out and report back.

from ask-toolkit-for-vscode.

doctor-iksterog avatar doctor-iksterog commented on June 9, 2024

well, it seems to work for me when i use the Export to VS Code in Dev Console and that creates the directory and exports and open my skill WITHOUT errors. So i guess i will just stick with that. If i ever have to create a new skill i guess i will have to create it first in dev console then open it up in VS Code.

from ask-toolkit-for-vscode.

SpellMender avatar SpellMender commented on June 9, 2024

@Chih-Ying @nikhilym This morning I Exported from the developer console via my laptop on a fresh install of VSCode and everything worked without any errors! Perhaps the issue has been resolved! Please also make sure to resolve referenced issue #54 if you deem it solved.

from ask-toolkit-for-vscode.

nikhilym avatar nikhilym commented on June 9, 2024

@SpellMender @khac @coolbigbear @doctor-iksterog sorry for the late response and thanks for keeping this thread super active and updated on the progress. Special thanks to @coolbigbear & @SpellMender to debug and help us resolve the issue. As a small token of appreciation, we added your github user names in our Thank you section in the toolkit updates view. Anyone can view the toolkit updates view again, in the extension, by running the Alexa: Show Toolkit Update notes command in the vscode command palette.

@Chih-Ying fixed the scripts and released them recently. As @SpellMender observed, the recent extension release v2.2.0 should have these issues fixed.

If i ever have to create a new skill i guess i will have to create it first in dev console then open it up in VS Code.

@doctor-iksterog , we hope the latest extension release fixes this for you. The create skill view from the extension should work flawlessly for you now. Sorry for the inconvenience.

I am going ahead and closing this and #54 issue. Please let us know if you are still facing problems. It would also be great if you can let us know of any feedback, feature requests or issues around the extension. Hope you are finding the extension useful πŸ˜„

from ask-toolkit-for-vscode.

HimanshuPrimo avatar HimanshuPrimo commented on June 9, 2024

I am getting this error while cloning the code from the Alexa Developer console on Ubuntu.

Skill clone failed. Reason: Command failed: git branch --show-current

image

Could anyone please let me what I have to do for fix this issue?
OS- Ubuntu

from ask-toolkit-for-vscode.

tydonelson avatar tydonelson commented on June 9, 2024

Hey @HimanshuPrimo , do you have git installed on your machine? Per the prerequisites here, the ASK VSCode extension requires at least version 2.27 of Git to be installed.

from ask-toolkit-for-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.