alexa-samples / skill-sample-nodejs-audio-player

An Alexa Skill Sample showing how to play long form audio in 3P-skills
Other
470 stars 319 forks source link

not deploying..error is coming after giving the command ask deploy" Failed to deploy. Please ensure current working directory is the root of your skill project." #69

Closed ghost closed 6 years ago

sebsto commented 6 years ago

Hello,

The error message "Please ensure current working directory is the root of your skill project" means that you need to issue the deploy command from the directory where skill.json file is located.

Let us know if this works for you.

rexana commented 6 years ago

I am having the same issue and I am issuing the deploy command from the directory that skill.json is located in. Are there any other potential causes for this?

sebsto commented 6 years ago

Hello Rexana,

You can use the --debug option from the ASK CLI to gather more details. Please feel free to share the output here.

Also, can you share the output of the following commands (on Linux or Mac) taken from your project root ?

pwd && ls -R

Thanks

rexana commented 6 years ago

I'm not sure if I'm using the --debug command correctly but doing ask deploy --debug doesn't produce any different output than just ask deploy.

I ran the pwd && ls -R command from the single-stream directory where skill.json is located and it produces an unreasonably large output because of the node_modules directory.

tfolbrecht commented 6 years ago

Having the same issue, will report back if I find out what went wrong. During the build process the skill.json was modified, not sure if it has anything to do with it.

{ "skillManifest": { became { "manifest": {

Here's the output from the single stream dir pwd && ls -R output

sebsto commented 6 years ago

Thank you for sharing data.

1/ directory structure is correct. Be sure to issue the ask deploy command from the main directory of your project, NOT from the lambda directory.

If you re-share issue about this, can you please share the output similar to the one below ?

$ pwd
/Users/[redacted]/skill

$ ls
lambda                   models                   skill.json

$ ask --version
1.1.0

$ ask deploy 
-------------------- Update Skill Project --------------------
Skill Id: amzn1.ask.skill.[redacted]
Skill deployment finished.
Model deployment finished.
Lambda deployment finished.
Your skill is now deployed and enabled in the development stage.
Try invoking the skill by saying “Alexa, open {your_skill_invocation_name}” or simulat

2/ skill manifest being modified from skillManifest to manifest is normal and part of the ASK CLI 0.x to 1.x automatic migration process.

sebsto commented 6 years ago

@rexana please check ASK CLI version and syntax of the --debug option you're using.

on ASK CLI 1.1.0, my version produces output like

-------------------- Debug Mode --------------------
[2018-02-21T10:36:13.824Z] - DEBUG - GET-SKILL-STATUS
request-id: 0a14cf16-16f3-11e8-9bc2-3935ae74fa02
GET https://api.amazonalexa.com/v1/skills/amzn1.ask.skill.[redacted]/status?resource=manifest
status code: 200 OK

Request headers: {"User-Agent":"ask-cli/1.1.0 Node/v9.5.0","Authorization":"Atza|I[redacted]"}

Response headers: {"server":"Server","date":"Wed, 21 Feb 2018 10:36:13 GMT","content-type":"application/json","content-length":"99","connection
":"close","x-amzn-requestid":"0a[redacted]02","x-amz-date":"Wed, 21 Feb 2018 10:36:13 GMT","vary":"Accept-Encoding,User-A
gent"}

Response body: "{\"manifest\":{\"eTag\":\"e9916f0b5cdf067ece53f6a254ec2b1e\",\"lastUpdateRequest\":{\"status\":\"SUCCEEDED\"}}}"
----------------------------------------
[2018-02-21T10:36:14.378Z] - DEBUG - UPDATE-SKILL
(...)
tfolbrecht commented 6 years ago

I appreciate your willingness to nail this down.

screen.log

sebsto commented 6 years ago

Thank you. Super clear. Stupid question. Did you properly initialize ask ?

ask init

cat ~/.ask/cli_config

Doc : https://developer.amazon.com/docs/smapi/ask-cli-command-reference.html#init-command

--Seb

Sent from a smartphone. Please, accept apologies for brevity and typos.

On 21 Feb 2018, at 21:22, tfolbrecht notifications@github.com wrote:

I appreciate your willingness to nail this down.

screen.log

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

tfolbrecht commented 6 years ago

I think I'm getting closer to the issue. When trying to deploy another sample npm app it produced the following instead of :

Error]: Failed to deploy...

I get

-------------------- Update Skill Project -------------------- Skill Id: blah Skill deployment finished. Model deployment finished. Create role error. InvalidClientTokenId: The security token included in the request is invalid

I'm running from a cloud9 instance, when I init ask-cli I used the --no-browser flag and grabbed the code on the machine I'm using instead of through c9, not sure if that has anything to do with it -- will keep at it

sebsto commented 6 years ago

yes, it looks like your ask environment is not correctly initialized. You found the --no browser option to run it on a cloud machine. You also need to have a valid AWS cli installed (with permissions to deploy to lambda),

If you plan to use AWS Lambda to host your skill’s business logic, you need an AWS account. Ensure that you have AWS credentials set up with the appropriate permissions on the computer to which you are installing ASK CLI, as described in Set Up Credentials for an Amazon Web Services (AWS) Account. https://developer.amazon.com/docs/smapi/set-up-credentials-for-an-amazon-web-services-account.html

Please read the requirements and the doc about how to setup ASK CLI :https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html

simonravel commented 6 years ago

I have the same problem, but I did the initialization and signed in with my AWS account

sebsto commented 6 years ago

@simonravel - sorry you're having problem. I would need more data to investigate .

aws --version
ask --version 

And your full ask command to deploy, including --debug

simonravel commented 6 years ago

I didn't have the aws command line interface installed, so that will probably be it

sebsto commented 6 years ago

Indeed, you wrote

but I did the initialization and signed in with my AWS account

so I assumed AWS was correctly configured.

Please read the requirements and the doc about how to setup ASK CLI :https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html

simonravel commented 6 years ago

@sebsto I executed the ask init command and then I could sign in with my AWS account. But I never read anything about the requirement to also install aws cli when using the ask cli.

sebsto commented 6 years ago

Agreed this should be more obvious in our doc, but here is the quote from the page link I sent above

If you plan to use AWS Lambda to host your skill's business logic, you need an AWS account. Ensure that you have AWS credentials set up with the appropriate permissions on the computer to which you are installing ASK CLI, as described in Set Up Credentials for an Amazon Web Services (AWS) Account.

There is no magic, ASK CLI needs to get your AWS credentials to deploy to Lambda. ASK CLI reuses the information stored by AWS CLI config.

sebsto commented 6 years ago

If ASK and AWS CLI are corrected configured, please check existence of .ask/config file in the root directory of your project. See https://github.com/alexa/skill-sample-nodejs-audio-player/issues/80 for details

simonravel commented 6 years ago

@sebsto It didn't exist yet. But do you have to edit "uri": "your_lambda_function_name" to a specific name for this project?

sebsto commented 6 years ago

Yes, whatever name you will write there will be the name of the function created on Lambda

mobyjames commented 6 years ago

I have checked all the steps mentioned above and still have this issue. Here are my details:

$ pwd
/Users/[redacted]/Projects/[redacted_project_name]/skill

$ ls
lambda      models      skill.json

$ ask --version
1.1.2

$ aws --version
aws-cli/1.14.66 Python/2.7.10 Darwin/17.4.0 botocore/1.9.19

$ cat ~/.ask/cli_config
{

... long output of profiles I have configured ...

}

$ ask deploy --debug
[Error]: Failed to deploy. Please ensure current working directory is the root of your skill project.
sebsto commented 6 years ago

Hello @mobyjames

We fixed this a couple of days ago, please fetch the latest version again from GitHub. Alternatively, you can verify the .ask/config file in your project directory.
Sample config files are now included in the repo.

Let me know if this fixes your issue.

yadavrohitgithub commented 4 years ago

Hey @sebsto (ASK v2.1.1) I am unable to deploy the project even if I am in the root directory of project. I ran the --debug command and getting below response ++++++++++++++++++++++++++++++++++++++++++++++++ C:\Users\Rohit Yadav\Downloads\skill-sample-nodejs-salesforce-master\skill-sampl e-nodejs-salesforce-master>ask deploy --debug [Warn]: Please make sure you are in the root directory of the project.

-------------------- Debug Mode -------------------- [2020-04-27T06:27:31.896Z] - DEBUG - GET_NPM_REGISTRY GET http://registry.npmjs.org/ask-cli/latest status code: 200 OK

Request headers: {"User-Agent":"ask-cli/2.1.1 Node/v13.13.0 Windows_NT/6.2.9200" }

Response headers: {"date":"Mon, 27 Apr 2020 06:27:31 GMT","content-type":"applic ation/json","transfer-encoding":"chunked","connection":"close","set-cookie":["__ cfduid=d830dfb6b3d61aeaf74bf4bfd2b4b52cd1587968851; expires=Wed, 27-May-20 06:27 :31 GMT; path=/; domain=.npmjs.org; HttpOnly; SameSite=Lax"],"cf-ray":"58a67a6b0 dc3d58b-BOM","vary":"Accept-Encoding","cf-cache-status":"DYNAMIC","expect-ct":"m ax-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/exp ect-ct\"","server":"cloudflare","cf-request-id":"025bead6e70000d58bd28c620000000 1"}

Response body: "{\"name\":\"ask-cli\",\"version\":\"2.1.1\",\"description\":\"Al exa Skills Kit (ASK) Command Line Interfaces\",\"bin\":{\"ask\":\"bin/ask.js\"}, \"engines\":{\"node\":\">=8.3.0\"},\"license\":\"Apache 2.0\",\"repository\":{\" type\":\"git\",\"url\":\"git+https://github.com/alexa/ask-cli.git\"},\"author\": {\"name\":\"RonWang\",\"email\":\"nongwang@amazon.com\"},\"keywords\":[\"alexa\" ................

Please help me out. Regards, Rohit

yadavrohitgithub commented 4 years ago

Another, If I am trying to install ASK on different machine. While configuring ASK with credential using browser or --no-browser both I get error "Unable to verify first certificate". What is causing this issue in different machine?