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

Cloning skill with ASK CLI - resulting in error #286

Closed
HeIp opened this issue Aug 19, 2020 · 10 comments
Closed

Cloning skill with ASK CLI - resulting in error #286

HeIp opened this issue Aug 19, 2020 · 10 comments

Comments

@HeIp
Copy link

HeIp commented Aug 19, 2020

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

Trying to Code with offline tools on local machine running
ask init --hosted-skill-id amzn1.ask.skill.X-X-X-X-X
Expecting it to clone/copy/download the code on aws to my machine.

Current Behavior

Instead of downloading the code for offline use CLI returns the following:

CLI Snapshot
image

Steps to Reproduce (for bugs)

1)run ask init --hosted-skill-id amzn1.ask.skill.X-X-X-X-X
2)see error as shown in snapshot above

Possible Solution

Work Around:
1)Get VS code and get Alexa Skills KiT (ASK) ToolKit plugin
2) Set up the plugin with aws account/credentials
3) Click Import existing skill
4) Click skill name planning to import
5) Pick folder location
6) Code downloads successfully

Your Environment and Context

  • ask-cli version: 2.14.0
  • Operating System and version: Windows_NT x64 10.0.19041
  • Node.js version used for development: 14.5.0
  • NPM version used for development: 6.14.7
@HeIp HeIp changed the title Cloning skill with ASK CLI. Cloning skill with ASK CLI - resulting in error Aug 19, 2020
@kakhaUrigashvili
Copy link
Contributor

kakhaUrigashvili commented Aug 19, 2020

@HeIp ask init for hosted skill should work if run it inside of an empty folder. It seems like you are running the command inside of a folder that already has initialized git repo.

@HeIp
Copy link
Author

HeIp commented Aug 19, 2020

@kakhaUrigashvili I actually created an empty folder and ran the command in the newly created empty folder and still resulted in the same way(just now).

@kakhaUrigashvili
Copy link
Contributor

@HeIp I was able to reproduce the issue.

.ask and .ask-resources.json should be in .gitignore on the master branch. If you dont have them it would cause this issue.
When ask init runs it first creates .ask and .ask-resources.json.

https://github.com/alexa/ask-cli/blob/develop/lib/controllers/hosted-skill-controller/index.js#L64

then clones git repo and tries to checkout master branch. If there are conflicts the git checkout fails.

I will have to discuss with the team about the solution.

@HeIp
Copy link
Author

HeIp commented Aug 19, 2020

Thank you for looking into this !
I'll add them to the git ignore now.
Just weird that the work around solution I mentioned works without a problem.
Thanks again @kakhaUrigashvili

@cbothra
Copy link

cbothra commented Sep 11, 2020

Hi, I tried all the above solution but nothing works for me. It just throws me below error message:

[Error]: { "message": "Resource not found." }

Just to mention I am not using git. Still I added .ask and .ask-resources.json file in .gitignore. Besides that I created this skill with ASK CLI V2 and deployed it and everything worked fine. When I try to clone it in another folder then it throws me the above error.

Any help?

@HeIp
Copy link
Author

HeIp commented Sep 11, 2020

Have you tried using the vscode extension ?

@kakhaUrigashvili
Copy link
Contributor

Hi, I tried all the above solution but nothing works for me. It just throws me below error message:

[Error]: { "message": "Resource not found." }

Just to mention I am not using git. Still I added .ask and .ask-resources.json file in .gitignore. Besides that I created this skill with ASK CLI V2 and deployed it and everything worked fine. When I try to clone it in another folder then it throws me the above error.

Any help?

@cbothra would you mind providing detailed steps to help reproduce the issue?

@cbothra
Copy link

cbothra commented Sep 12, 2020

@HeIp Yes I tried the vscode extension but wasn't very comfortable with it. So switched back to terminal :)

@kakhaUrigashvili Here are the detailed steps.
1. Installed latest version of ASK CLI using npm install -g ask-cli
2. Configured my aws account using ask configure
3. Created skill using ask new (helloworld template)
4. Deployed skill using 'ask deploy'
5. Tested the skill in the dashboard.

Everything works like a charm till here.

6. Now created an empty folder.
7. Tried to clone the skill using ask init --hosted-skill-id amzn1.ask.skill.X-X-X-X-X

At step 7. it throws me error [Error]: { "message": "Resource not found." }

Hope this helps.

@cbothra
Copy link

cbothra commented Sep 12, 2020

I think I got the answer from the migration guide.

To migrate skill code hosted on AWS Lambda to a local machine, export the skill code from AWS Lambda. After the skill code has been downloaded, run ask init within the project directory to download Alexa Skill Package resources and set up the project for deployment using the ASK CLI.

To migrate an Alexa-hosted skill code to a local machine, run ask init --hosted-skill-id HOSTED_SKILL_ID with the skill identifier of the Alexa-hosted skill.

Thanks @everyone for the quick reverts. I really appreciate that.

@HimanshuPrimo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants