Jeff Rosenberg
Jeff Rosenberg

Reputation: 3572

ASK-CLI deploy fails with "The object to be validated must not be null"

I went through one of the Alexa Skills Kit quick starts to create my first Alexa skill, and now I'm trying to work backwards to set up my project for development from my text editor and deployment via the ASK CLI. But it seems like ask-cli can't find my interaction model, because I get the following output when I try to deploy:

$ ask deploy

-------------------- Update Skill Project --------------------

Skill Id: amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7

Skill deployment finished.

Call update-model error.

Error code: 400 {
"message": "The interaction model is not valid.", "violations": [ { "message": "null: HV000116: The object to be validated must not be null." } ] }

When I run with the --debug flag, it looks to me like the interaction model is being sent as an empty object. I'm pasting the full output below, but as far as I can tell, I think this is the important part:

[2017-12-30T22:21:56.535Z] - DEBUG - UPDATE-MODEL request-id: d9357bc2-edaf-11e7-85ba-550bb02f81a7 POST https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/interactionModel/locales/en-US status code: 400 Bad Request

Request headers: {"User-Agent":"ask-cli/1.0.0-beta.8 Node/v9.3.0","Authorization":"Atza|IwEBIGhOiYYsONdFRcrE8Aapsyzk_O798yl_9FmRyO8BiXdsgo8tjYgq6eIB9323UavV2_U5PA2TkRYTq3Tt9Ui69n-XWyorWgRFpkm0ahl9uBWq5diTyQQIyGTXc_sgJQcjx3_mKiJ-ku5y_CR7cFOg6apqOTMyu4BO6pcC8ejydsne5GfqkbEqDHlwa44cQyxOw9Ir97CB0-WdleRI-IJpsyCoQvZ11Ah2pt_K-PZRtdqE5nUG9tQx49_v1N5apGrNyNxKAICAnJZ0aH3gE1ruAlZc4BUNn7SBM6-sSC1pppSTNVX_8MfwoRfVsdZ-cPbjJIxM3wftjUAah0wPdC-yeEVf-P2JOpTAscLpT-zEzzkEGiZrD1W61YyE0SH04KXqoOS3sgdWYrOEomIQg1TbcOlYvskbCqnOnkrHMGikgaUbWCF7YOTQrE1s0zOrIOujHJez7iIMc0WhUI4LkGdhHttSxxzRHnL3t5JEhOHC0DkLDaRp6ESPs6U4n7hfYtE2ktJDTs_nql39xfDqadfziEPOurEpA3MffHN20mGx3w-8jpIx_pW4mdo41Vi33hHHSa-1l9fbsKRKef2MrI91oNUY9eI7HXNF6Exi3OFR2oFP29TsgA25ZNBUcrEAM1OxAVI","accept":"application/json","content-type":"application/json","content-length":2}

Request body: {}

Here's my project structure:

├── .ask
│   └── config
├── .gitignore
├── lambda
│   ├── custom
│   │   ├── node_modules
│   │   ├── package-lock.json
│   │   ├── package.json
│   │   ├── src
│   │   └── test
├── models
│   └── en-US.json
└── skill.json

The full output from ask-deploy --debug is below. Anybody have any thoughts on why the interaction model can't be validated?

-------------------- Debug Mode -------------------- [2017-12-30T22:21:55.649Z] - DEBUG - UPDATE-SKILL request-id: d89914a8-edaf-11e7-85ba-550bb02f81a7 PUT https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7 status code: 202 Accepted

Request headers: {"User-Agent":"ask-cli/1.0.0-beta.8 Node/v9.3.0","Authorization":"Atza|IwEBIGhOiYYsONdFRcrE8Aapsyzk_O798yl_9FmRyO8BiXdsgo8tjYgq6eIB9323UavV2_U5PA2TkRYTq3Tt9Ui69n-XWyorWgRFpkm0ahl9uBWq5diTyQQIyGTXc_sgJQcjx3_mKiJ-ku5y_CR7cFOg6apqOTMyu4BO6pcC8ejydsne5GfqkbEqDHlwa44cQyxOw9Ir97CB0-WdleRI-IJpsyCoQvZ11Ah2pt_K-PZRtdqE5nUG9tQx49_v1N5apGrNyNxKAICAnJZ0aH3gE1ruAlZc4BUNn7SBM6-sSC1pppSTNVX_8MfwoRfVsdZ-cPbjJIxM3wftjUAah0wPdC-yeEVf-P2JOpTAscLpT-zEzzkEGiZrD1W61YyE0SH04KXqoOS3sgdWYrOEomIQg1TbcOlYvskbCqnOnkrHMGikgaUbWCF7YOTQrE1s0zOrIOujHJez7iIMc0WhUI4LkGdhHttSxxzRHnL3t5JEhOHC0DkLDaRp6ESPs6U4n7hfYtE2ktJDTs_nql39xfDqadfziEPOurEpA3MffHN20mGx3w-8jpIx_pW4mdo41Vi33hHHSa-1l9fbsKRKef2MrI91oNUY9eI7HXNF6Exi3OFR2oFP29TsgA25ZNBUcrEAM1OxAVI","accept":"application/json","content-type":"application/json","content-length":1768}

Request body: {"skillManifest":{"publishingInformation":{"locales":{"en-US":{"summary":"My summary","examplePhrases":["There", "are", "real", "phrases", "here"],"keywords":["choice","random"],"name":"Choose Between","smallIconUri":"https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/images/eyJkIjoiQjRvNFltSDdCQU54Y25DanlKR1ArVFhGZW1ZL1I3NjdpRldXQXltZ2FUVmNZblV6WUE1eU4veVduMHF2WEY2bXdiUmlIZkJ1SFVNbEh0Q3A3K1g4SDc1WnczdDNqR3duT0JubnBhZVhBTkF0UFMzeVl4Q3k4eFQxTlRxeXc0dGYiLCJpdiI6IlZHN1gyb0FqQ2VjMnBEWGtMZ2J0SEE9PSIsInYiOjF9","description":"My description","largeIconUri":"https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/images/eyJkIjoiTkQ5OWd2RkN3UDhoWlJ1eFF5TDNtZytHbStkbFNYcHhqUGNDSG04RjREVUhIVTRVQkpxbjVyTFVWaHFVRDFPbDRtYnlWQUZCMFJRQnpEczRFQnlOckF0N05yZVZDSnhRUHIzZmFoWWRTRjRqZHNIUjUxV3dMekpNZzl0OFhzVFdoQXV0RERPQTBsV3d3b05xVnYxODZRPT0iLCJpdiI6IiszVG9QQ1o2ajA2ZThPVzIxTUh4MXc9PSIsInYiOjF9"}},"isAvailableWorldwide":true,"testingInstructions":"Nothing special","category":"NOVELTY","distributionCountries":[]},"apis":{"custom":{"endpoint":{"uri":"arn:aws:lambda:us-west-2:760655967349:function:randomChoiceAlexaSkill"}}},"manifestVersion":"1.0","permissions":[],"privacyAndCompliance":{"allowsPurchases":false,"isExportCompliant":true,"containsAds":false,"isChildDirected":false,"usesPersonalInfo":false}}}

Response headers: {"server":"Server","date":"Sat, 30 Dec 2017 22:21:56 GMT","content-type":"application/json","content-length":"2","connection":"close","x-amzn-requestid":"d89914a8-edaf-11e7-85ba-550bb02f81a7","x-amz-date":"Sat, 30 Dec 2017 22:21:56 GMT","location":"/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/status","vary":"Accept-Encoding,User-Agent"}

Response body: {} ---------------------------------------- [2017-12-30T22:21:55.941Z] - DEBUG - GET-SKILL-STATUS request-id: d8d4977b-edaf-11e7-a1e2-2df47a70d226 GET https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/status status code: 200 OK

Request headers: {"User-Agent":"ask-cli/1.0.0-beta.8 Node/v9.3.0","Authorization":"Atza|IwEBIGhOiYYsONdFRcrE8Aapsyzk_O798yl_9FmRyO8BiXdsgo8tjYgq6eIB9323UavV2_U5PA2TkRYTq3Tt9Ui69n-XWyorWgRFpkm0ahl9uBWq5diTyQQIyGTXc_sgJQcjx3_mKiJ-ku5y_CR7cFOg6apqOTMyu4BO6pcC8ejydsne5GfqkbEqDHlwa44cQyxOw9Ir97CB0-WdleRI-IJpsyCoQvZ11Ah2pt_K-PZRtdqE5nUG9tQx49_v1N5apGrNyNxKAICAnJZ0aH3gE1ruAlZc4BUNn7SBM6-sSC1pppSTNVX_8MfwoRfVsdZ-cPbjJIxM3wftjUAah0wPdC-yeEVf-P2JOpTAscLpT-zEzzkEGiZrD1W61YyE0SH04KXqoOS3sgdWYrOEomIQg1TbcOlYvskbCqnOnkrHMGikgaUbWCF7YOTQrE1s0zOrIOujHJez7iIMc0WhUI4LkGdhHttSxxzRHnL3t5JEhOHC0DkLDaRp6ESPs6U4n7hfYtE2ktJDTs_nql39xfDqadfziEPOurEpA3MffHN20mGx3w-8jpIx_pW4mdo41Vi33hHHSa-1l9fbsKRKef2MrI91oNUY9eI7HXNF6Exi3OFR2oFP29TsgA25ZNBUcrEAM1OxAVI"}

Response headers: {"server":"Server","date":"Sat, 30 Dec 2017 22:21:57 GMT","content-type":"application/json","content-length":"87","connection":"close","x-amzn-requestid":"d8d4977b-edaf-11e7-a1e2-2df47a70d226","x-amz-date":"Sat, 30 Dec 2017 22:21:57 GMT","vary":"Accept-Encoding,User-Agent"}

Response body: "{\"manifest\":{\"lastModified\":{\"time\":\"2017-12-30T22:21:56.889Z\",\"status\":\"SUCCESSFUL\"}}}" ---------------------------------------- [2017-12-30T22:21:56.292Z] - DEBUG - GET-MODEL-STATUS request-id: d9020ff6-edaf-11e7-b4f4-39c6476092ba GET https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/interactionModel/locales/en-US/status status code: 200 OK

Request headers: {"User-Agent":"ask-cli/1.0.0-beta.8 Node/v9.3.0","Authorization":"Atza|IwEBIGhOiYYsONdFRcrE8Aapsyzk_O798yl_9FmRyO8BiXdsgo8tjYgq6eIB9323UavV2_U5PA2TkRYTq3Tt9Ui69n-XWyorWgRFpkm0ahl9uBWq5diTyQQIyGTXc_sgJQcjx3_mKiJ-ku5y_CR7cFOg6apqOTMyu4BO6pcC8ejydsne5GfqkbEqDHlwa44cQyxOw9Ir97CB0-WdleRI-IJpsyCoQvZ11Ah2pt_K-PZRtdqE5nUG9tQx49_v1N5apGrNyNxKAICAnJZ0aH3gE1ruAlZc4BUNn7SBM6-sSC1pppSTNVX_8MfwoRfVsdZ-cPbjJIxM3wftjUAah0wPdC-yeEVf-P2JOpTAscLpT-zEzzkEGiZrD1W61YyE0SH04KXqoOS3sgdWYrOEomIQg1TbcOlYvskbCqnOnkrHMGikgaUbWCF7YOTQrE1s0zOrIOujHJez7iIMc0WhUI4LkGdhHttSxxzRHnL3t5JEhOHC0DkLDaRp6ESPs6U4n7hfYtE2ktJDTs_nql39xfDqadfziEPOurEpA3MffHN20mGx3w-8jpIx_pW4mdo41Vi33hHHSa-1l9fbsKRKef2MrI91oNUY9eI7HXNF6Exi3OFR2oFP29TsgA25ZNBUcrEAM1OxAVI"}

Response headers: {"server":"Server","date":"Sat, 30 Dec 2017 22:21:57 GMT","content-type":"application/json","content-length":"20","connection":"close","x-amzn-requestid":"d9020ff6-edaf-11e7-b4f4-39c6476092ba","x-amz-date":"Sat, 30 Dec 2017 22:21:57 GMT","vary":"Accept-Encoding,User-Agent"}

Response body: "{\"status\":\"SUCCESS\"}" ---------------------------------------- [2017-12-30T22:21:56.535Z] - DEBUG - UPDATE-MODEL request-id: d9357bc2-edaf-11e7-85ba-550bb02f81a7 POST https://api.amazonalexa.com/v0/skills/amzn1.ask.skill.6eebd8dd-2062-4666-9040-34d103d114c7/interactionModel/locales/en-US status code: 400 Bad Request

Request headers: {"User-Agent":"ask-cli/1.0.0-beta.8 Node/v9.3.0","Authorization":"Atza|IwEBIGhOiYYsONdFRcrE8Aapsyzk_O798yl_9FmRyO8BiXdsgo8tjYgq6eIB9323UavV2_U5PA2TkRYTq3Tt9Ui69n-XWyorWgRFpkm0ahl9uBWq5diTyQQIyGTXc_sgJQcjx3_mKiJ-ku5y_CR7cFOg6apqOTMyu4BO6pcC8ejydsne5GfqkbEqDHlwa44cQyxOw9Ir97CB0-WdleRI-IJpsyCoQvZ11Ah2pt_K-PZRtdqE5nUG9tQx49_v1N5apGrNyNxKAICAnJZ0aH3gE1ruAlZc4BUNn7SBM6-sSC1pppSTNVX_8MfwoRfVsdZ-cPbjJIxM3wftjUAah0wPdC-yeEVf-P2JOpTAscLpT-zEzzkEGiZrD1W61YyE0SH04KXqoOS3sgdWYrOEomIQg1TbcOlYvskbCqnOnkrHMGikgaUbWCF7YOTQrE1s0zOrIOujHJez7iIMc0WhUI4LkGdhHttSxxzRHnL3t5JEhOHC0DkLDaRp6ESPs6U4n7hfYtE2ktJDTs_nql39xfDqadfziEPOurEpA3MffHN20mGx3w-8jpIx_pW4mdo41Vi33hHHSa-1l9fbsKRKef2MrI91oNUY9eI7HXNF6Exi3OFR2oFP29TsgA25ZNBUcrEAM1OxAVI","accept":"application/json","content-type":"application/json","content-length":2}

Request body: {}

Response headers: {"server":"Server","date":"Sat, 30 Dec 2017 22:21:57 GMT","content-type":"application/json","content-length":"139","connection":"close","x-amzn-requestid":"d9357bc2-edaf-11e7-85ba-550bb02f81a7","x-amz-date":"Sat, 30 Dec 2017 22:21:57 GMT","x-amzn-errortype":"BadRequestException:http://internal.amazon.com/coral/com.amazon.alexa.skillmanagement/","vary":"Accept-Encoding,User-Agent"}

Response body: {"message":"The interaction model is not valid.","violations":[{"message":"null: HV000116: The object to be validated must not be null."}]}

Upvotes: 1

Views: 1918

Answers (3)

Brian Merrell
Brian Merrell

Reputation: 1174

I received this error after editing my Interaction Model file (en-US.json)

I was playing with the deployed Alexa skill in the web interface and discovered that my edits there could be exported to a json file which appeared to be in the same structure as my Skills Kit project. So I replaced the contents of my en-US.json file with the generated model. But I received this error when deploying:

{"message":"The interaction model is not valid.","violations":[{"message":"null: HV000116: The object to be validated must not be null."}]}

It turns out that the generated model requires a minor tweak to make it compatible with the Interaction Model file that the ASK CLI is looking for. The generated model is in a structure like this:

{
    "languageModel": {
        "invocationName": "yo mamma",
        "intents": [
            {
                "name": "AMAZON.CancelIntent",
                "slots": [],
                "samples": []
            },
            {
                "name": "AMAZON.HelpIntent",
                "slots": [],
                "samples": []
            },
            {
                "name": "AMAZON.StopIntent",
                "slots": [],
                "samples": []
            }
        ]
    }
}

But the en-US.json model structure looks like this:

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "yo mama",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "slots": [],
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "slots": [],
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "slots": [],
                    "samples": []
                }
            ]
        }
    }
}

I simply wrapped my language model in another object with an "interactionModel" property and the model validated and deployed successfully.

Upvotes: 0

Matt
Matt

Reputation: 3780

I ran into this problem after updating the interaction model in the Alexa developer console and copying the JSON directly from the JSON editor. That should work, and the JSON looked complete, and linted correctly, but for some reason ask deploy barfed on it.

I solved it with:

ask api get-model -s <skillId> -l en-US > models/en-US.json

This uses the API to pull the currently deployed model, and writes to the specified file.

Upvotes: 1

Ron Lisle
Ron Lisle

Reputation: 1164

My guess is that something is wrong with en-US.JSON, but I'm not certain of that.

If you're trying to convert a working skill to use CLI, then I recommend that you start with the working skill, and use "ask clone" to download it into the format needed by CLI.

You should then be able to deploy the skill exactly as downloaded. Check everything into Git, and then work with the downloaded copy going forward. If your changes break something, you can revert back to the working level, etc.

Upvotes: 0

Related Questions