csuermann / virtual-smart-home

Virtual Smart Home Skill for Amazon Alexa and Node-RED
27 stars 18 forks source link

provisioning failed! #9

Closed ghost closed 1 year ago

ghost commented 1 year ago

linked code to account, but the node red page changes to this

Screen Shot 2022-10-06 at 9 01 41 pm Screen Shot 2022-10-06 at 9 26 14 pm

do I have to do something once I run serverless with adding to the pallet? or do I just use VSH from the distro?

csuermann commented 1 year ago

Is there anything suspicious in the AWS CloudWatch logs?

ghost commented 1 year ago

I see two lines that might be of use

I am using the latest copy in node-red and from this repo

I can't list the iot thing type

aws iot list-thing-types --thing-type-name "virtual-smart-home-type"
{
    "thingTypes": [
        {
            "thingTypeName": "virtual-smart-home-type",
            "thingTypeArn": "arn:aws:iot:us-east-1:0xxxxxxxxxxxxxx:thingtype/virtual-smart-home-type",
            "thingTypeProperties": {},
            "thingTypeMetadata": {
                "deprecated": false,
                "creationDate": "2022-10-04T10:29:53.301000+00:00"
            }
        }
    ]
}
csuermann commented 1 year ago

Did you create the thing type in the same region as specified in VSH_IOT_REGION (defaults to 'eu-west-1')?

ghost commented 1 year ago

well.. that's now a 64 million dollar question there.... hmmmm

deleting everything and starting again:)

ghost commented 1 year ago

bugger.. still getting error

2022-10-07T11:40:27.368Z    5f90b211-885a-4c7b-902f-4c8887ab9ef6    ERROR   ● /check_version with query: {
    "version": "3.0.1"
}

2022-10-07T11:40:27.387Z    5f90b211-885a-4c7b-902f-4c8887ab9ef6    ERROR   ● RESPONSE: {
    "isAllowedVersion": true,
    "isLatestVersion": true,
    "updateHint": "",
    "allowedDeviceCount": 7
}

2022-10-07T11:41:15.369Z    9e92298d-859c-418b-9b21-c6e9c3ebaaf4    ERROR   ℹ PROVISIONING REQUEST for client with version 3.0.1

2022-10-07T11:41:15.749Z    9e92298d-859c-418b-9b21-c6e9c3ebaaf4    ERROR   ✖ PROVISIONING FAILED: undefined
ghost commented 1 year ago

Screen Shot 2022-10-07 at 10 17 15 pm

csuermann commented 1 year ago

hmm, that "undefined" error message is not very helpful. One of the lines above the error log statement must be failing. You could try to extend the logging to figure out what's going on there.

ghost commented 1 year ago

fails here line 228

const { isBlocked } = await getUserRecord(profile.user_id)

removed all this from the try block

 const { isBlocked } = await getUserRecord(profile.user_id)

    if (isBlocked) {
      throw new Error(
        `found attribute 'isBlocked' for userId ${profile.user_id} / ${profile.email}`
      )
    }

and it now continues and no more errors

is removing the 'isBlocking' dangerous??

still can't use it though as when linking the an item I get user not found

Screen Shot 2022-10-08 at 3 05 53 pm

guessing this now how to do with more error info FETCHING PLAN INFO FAILED: undefined

but I am getting there:)

ghost commented 1 year ago

somewhere there is no user being created

2022-10-08T05:56:14.064Z    6b293b01-31ff-4993-909c-09bcad6223f1    ERROR   ℹ { TableName: 'VSH', Key: { PK: 'USER#amzn1.account.xxxxxxxxremovedxxxx', SK: 'TOKEN' } }

2022-10-08T05:56:14.301Z    6b293b01-31ff-4993-909c-09bcad6223f1    ERROR   ℹ no token record found

VSH table is empty

how are users added?

ghost commented 1 year ago

Screen Shot 2022-10-08 at 4 12 55 pm

csuermann commented 1 year ago

Ah, the node subtext is actually hinting at it: You must first enable your VSH skill in the Alexa app (Skills & Games > Your Skills > Dev > my private vsh). Once you've gone through the account linking process there, a user record should get created.

ghost commented 1 year ago

after much much messing around I finally have it working..

thanks so much !

csuermann commented 1 year ago

Nice! What did the trick in the end?

ghost commented 1 year ago

reset the Security Profile - Web Settings - Client Secret

and kept trying to link the account until it finally worked :)

its not 100% yet.. its enabled, linked etc.. the DynamoDB table lists my devices but the Alexa app does not list or find them..

work in progress :)

ghost commented 1 year ago

seems that items are being added to the ash db table

Screen Shot 2022-10-08 at 10 15 45 pm

but the skill is enabled IMG_0105

but there are still errors

2022-10-08T12:09:10.586Z    bccf6df8-9643-4773-a183-8ac1e86d26a3    ERROR   ✖ proactivelyDiscoverDevices FAILED! Request failed with status code 403. Response body: {
    "header": {
        "namespace": "System",
        "name": "Exception",
        "messageId": "1e0a6bd1-c2ea-4a6c-8924-09b269c5df7b"
    },
    "payload": {
        "code": "SKILL_DISABLED_EXCEPTION",
        "description": "The user does not have a valid enablement for your skill."
    }
}

node-red shows items working and not working

Screen Shot 2022-10-08 at 10 18 29 pm

but Alexa does not list any devices.. saying the device name that is connected Alexa can't find

csuermann commented 1 year ago

I'm guessing this might still have to do with messed up regions...

Found this: https://amazon.developer.forums.answerhub.com/questions/204230/correct-regional-endpoint-to-avoid-skill-disabled.html