marcy-terui / serverless-alexa-skills

Manage your Alexa Skills with Serverless Framework
https://www.npmjs.com/package/serverless-alexa-skills
MIT License
71 stars 13 forks source link

"sls alexa update" is not updating skill manifest #27

Open jthomerson opened 5 years ago

jthomerson commented 5 years ago

I've used your plugin for several weeks successfully, but today after I deleted the skill I was working on and started a new one, suddenly sls alexa update will not work. It says that it successfully updated the manifest, but it does not appear to actually make any changes. I've verified in the Amazon Developer console that the ARN of my Lambda function is never getting set - which is one thing the sls alexa update command should be doing for me.

I manually deleted the skill I was working on earlier today, and then started stepping through my build steps to make sure another developer could easily create their own copy of the skill. So, I did sls alexa create --locale en-US --type custom --name "foo ${USER}", and then tried using sls alexa update and sls alexa build. The build steps works, but the update does not. I've tried deleting my ~/.serverless/.alexa-skills-token.json and re-authenticating, as well as a number of other things that I could think of to see if something, somewhere, was tied to some old state. I even tried it from another machine, and I tried deleting the skill again and starting over.

Any ideas?

image

jthomerson commented 5 years ago

Ugh ... as always, you spend hours trying to figure something out, finally break down and open an issue, and thirty seconds later you figure out the problem.

I tried putting my ARN into the Amazon Developer portal (web console) and got this somewhat helpful error:

The trigger setting for the Lambda arn:aws:lambda:us-east-1:redacted-acct-id:function:vox-alexa-skill-backend-jrthomer is invalid. Error code: SkillManifestError

I realized that the Lambda function policy was probably still only configured to allow my original skill ID to invoke it. I redeployed my code (sls deploy) and then ran sls alexa update and it worked.

I think this does mean there's a bug in the plugin, though: presumably that error (or some error) was getting returned when the plugin did the PUT request to update the manifest, but the plugin was reporting a success.

jthomerson commented 5 years ago

Tangentially, sls alexa delete reports that the skill was deleted, but the skill is not deleted. I'm posting this here (rather than a new issue) because the first thing I would check is if that call is also returning an error that's getting swallowed somewhere.