Coder Social home page Coder Social logo

Comments (4)

jsetton avatar jsetton commented on July 18, 2024 1

I am able to replicate. This response is coming directly from the Alexa SMAPI and appears to be a false negative. This only happens when the skill is created and not when it is updated.

If you run the below commands, you can see the import error.

$ ask smapi get-import-status --import-id <importId>
{
  "skill": {
    "eTag": "fbaf92666ce631293fd965a9f835460a",
    "resources": [
      {
        "action": "CREATE",
        "errors": [
          {
            "message": "Skill not found with id: <skillId>, stage: development"
          }
        ],
        "name": "Manifest",
        "status": "FAILED"
      }
    ],
    "skillId": "<skillId>"
  },
  "status": "FAILED"
}

However, the skill ends up being created with no error.

$ ask smapi get-skill-status -s <skillId>
{
  "manifest": {
    "eTag": "854f2987e27a51e6fdc67c2ec756b757",
    "lastUpdateRequest": {
      "status": "SUCCEEDED"
    }
  }
}

As a workaround, I would recommend manually adding the newly created skill ID to the ASK CLI states file as mentioned in this section, and run the deploy command again.

As a side note, you may want to check your Alexa developer console and delete the skills created from these "failed" requests.

I have raised this issue with the Alexa Developer Support team.

from openhab-alexa.

lion24 avatar lion24 commented on July 18, 2024

For more context, here's my ask-resources.json file:

{
  "askcliResourcesVersion": "2020-03-31",
  "profiles": {
    "default": {
      "skillMetadata": {
        "src": "./skill-package"
      },
      "code": {
        "default": {
          "src": "./lambda"
        }
      },
      "skillInfrastructure": {
        "type": "@ask-cli/cfn-deployer",
        "userConfig": {
          "awsRegion": "eu-west-1",
          "runtime": "nodejs20.x",
          "handler": "index.handler",
          "templatePath": "./infrastructure/cfn-deployer/skill-stack.json",
          "cfn": {
            "parameters": {
              "LambdaFunctionName": "alexa-openhab",
              "LambdaLogLevel": "debug",
              "OpenHABBaseURL": "https://myopenhab.<custom_domain>.be/"
            }
          }
        }
      }
    }
  }
}

from openhab-alexa.

lion24 avatar lion24 commented on July 18, 2024

Thanks @jsetton

I managed to deploy the stack and the lamdba function successfully following the instruction you pointed out.
I just had a warning at the end:

==================== Enable Skill ====================
[Warn]: Skill api domain "smartHome" cannot be enabled. Skipping the enable process.

I don't know if I need to worry or not, should I redeploy everything?

Also another issue futher down when I try the account linking step I got an error:

 ask smapi update-account-linking-info -s amzn1.ask.skill.abaf006f-4eb9-4b48-9812-d8922c5fe27e --account-linking-request file:accountLinking.json
[Error]: {
  "message": "Call to service failed: The request to https://api.amazonalexa.com/v1/skills/amzn1.ask.skill.abaf006f-4eb9-4b48-9812-d8922c5fe27e/stages/development/accountLinkingClient failed. Client Error: AxiosError: Request failed with status code 400",
  "stack": "Error: Call to service failed: The request to https://api.amazonalexa.com/v1/skills/amzn1.ask.skill.abaf006f-4eb9-4b48-9812-d8922c5fe27e/stages/development/accountLinkingClient failed. Client Error: AxiosError: Request failed with status code 400\n    at /usr/local/node-v20.10.0-linux-x64/lib/node_modules/ask-cli/dist/lib/clients/smapi-client/smapiApiClient.js:72:35\n    at /usr/local/node-v20.10.0-linux-x64/lib/node_modules/ask-cli/dist/lib/clients/http-client.js:81:16\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
  "detail": {}
}

Maybe this cause be the object of another issue, I can create another if needed.
And my account-linking json file (I followed the guide when using a custom openhab-cloud instance because this is my case here):

{
    "accountLinkingRequest": {
      "skipOnEnablement": "false",
      "type": "AUTH_CODE",
      "authorizationUrl": "https://myopenhab.<custom_domain>.be/oauth2/authorize",
      "accessTokenUrl": "https://myopenhab.<custom_domain>.be/oauth2/token",
      "accessTokenScheme": "HTTP_BASIC",
      "clientId": "alexa-skill",
      "scopes": [
        "alexa"
      ]
    }
  }

from openhab-alexa.

jsetton avatar jsetton commented on July 18, 2024

I just had a warning at the end

This is expected since smart home skills cannot be enabled without going through the account linking process.

And my account-linking json file (I followed the guide when using a custom openhab-cloud instance because this is my case here)

Did you omit the clientSecret property intentionally? If so, it must be specified.

from openhab-alexa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.