rosskouk / asknavidrome

An Alexa skill to allow streaming of music from Subsonic API compatible media servers on Amazon Echo devices.
https://rosskouk.github.io/asknavidrome
MIT License
48 stars 7 forks source link

The requested skill did not provide a valid response #26

Open zorbaTheRainy opened 10 months ago

zorbaTheRainy commented 10 months ago

I hate to ask this but I am stumped. While I will take a magic bullet, I am really asking where in the logs I find answers.

I am in the Alexa Developer Testing console. I type "Open Navisonic player" and get "The requested skill did not provide a valid response "

I am using Nginx Proxy Manager and a Lets Encrypt SSL cert. the URLs are: music.mydomain.com -> pointing to Navidrome proper asknavidrome.mydomain.com-> pointing to the Navidrome skill

My skill log is

2023-09-02 19:42:30,290 - root - INFO - AskNavidrome 0.6!
2023-09-02 19:42:30,290 - root - DEBUG - Getting configutration from the environment...
2023-09-02 19:42:30,291 - root - INFO - Skill ID set to: amzn1.ask.skill.<redacted>
2023-09-02 19:42:30,291 - root - INFO - Minimum song count is set to: 50
2023-09-02 19:42:30,291 - root - INFO - The URL for Navidrome is set to: https://music.<redacted>
2023-09-02 19:42:30,291 - root - INFO - The Navidrome user name is set to: <redacted>
2023-09-02 19:42:30,291 - root - INFO - The Navidrome password is set
2023-09-02 19:42:30,291 - root - INFO - The Navidrome port is set to: 443
2023-09-02 19:42:30,291 - root - INFO - The Navidrome API path is set to: /rest
2023-09-02 19:42:30,291 - root - INFO - The Navidrome API version is set to: 1.16.1
2023-09-02 19:42:30,291 - root - DEBUG - Configuration has been successfully loaded
2023-09-02 19:42:30,291 - root - DEBUG - Log level set to DEBUG
2023-09-02 19:42:30,292 - root - DEBUG - MediaQueue object created...
2023-09-02 19:42:30,293 - asknavidrome.subsonic_api - DEBUG - Connected to Navidrome
2023-09-02 19:42:30,293 - asknavidrome.subsonic_api - DEBUG - In function ping()
2023-09-02 19:42:30,910 - asknavidrome.subsonic_api - INFO - Successfully connected to Navidrome
2023-09-02 19:42:30,953 - root - INFO - AskNavidrome Web Service is ready to start!
2023-09-02 19:42:30,957 - root - WARNING - AskNavidrome debugging has been enabled, this should only be used when testing!
2023-09-02 19:42:30,957 - root - WARNING - The /buffer, /queue and /history http endpoints are available publicly!
 * Serving Flask app 'app'
 * Debug mode: off
2023-09-02 19:42:30,961 - werkzeug - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5000
 * Running on http://172.18.0.13:5000
2023-09-02 19:42:30,961 - werkzeug - INFO - Press CTRL+C to quit
2023-09-02 19:43:19,563 - werkzeug - INFO - 172.18.0.14 - - [02/Sep/2023 19:43:19] "GET / HTTP/1.1" 405 -
2023-09-02 19:56:47,429 - werkzeug - INFO - 172.18.0.14 - - [02/Sep/2023 19:56:47] "GET / HTTP/1.1" 405 -
2023-09-02 19:56:52,307 - werkzeug - INFO - 172.18.0.14 - - [02/Sep/2023 19:56:52] "GET /history HTTP/1.1" 200 -

I can access the web page at https://asknavidrome.mydomain.com/history. That is the 200 and https://asknavidrome.mydomain.com is the two 405s.

The Alexa Test console is not helpful, and I guess what I am asking is how to I make it helpful

I get nothing on JSON Output 1 From the Device Log SkillDebugger.CaputureDebugingInfo all I get is

{
    "header": {
        "namespace": "SkillDebugger",
        "name": "CaptureDebuggingInfo",
        "messageId": "784c5b69-5c51-4a04-9435-9dbb58679368"
    },
    "payload": {
        "skillId": "amzn1.ask.skill.<redacted>",
        "timestamp": "2023-09-02T17:59:33.850Z",
        "dialogRequestId": "c4be1249-8abd-4726-a02f-b04300b28726",
        "skillRequestId": "amzn1.echo-api.request.<redacted>",
        "type": "SkillExecutionInfo",
        "content": {
            "invocationRequest": {
                "endpoint": "https://asknavidrome.mydomain.com",
                "body": {
                    "version": "1.0",
                    "session": {
                        "new": true,
                        "sessionId": "amzn1.echo-api.session.36e3b99a-6e36-4a94-8909-32606e1f989e",
                        "application": {
                            "applicationId": "amzn1.ask.skill.<redacted>"
                        },
                        "attributes": {},
                        "user": {
                            "userId": "amzn1.ask.account.<redacted>"
                        }
                    },
                    "context": {
                        "System": {
              ...
                            "application": {
                                "applicationId": "amzn1.ask.skill.<redacted>"
                            },
                            "user": {
                                "userId": "amzn1.ask.account.<redacted>"
                            },
                            "device": {
                                "deviceId": "amzn1.ask.device.<redacted>",
                                "supportedInterfaces": {
                                    "AudioPlayer": {}
                                }
                            },
                            "apiEndpoint": "https://api.amazonalexa.com",
                            "apiAccessToken": "<redacted>"
                        }
                    },
                    "request": {
                        "type": "LaunchRequest",
                        "requestId": "amzn1.echo-api.request.<redacted>",
                        "locale": "en-US",
                        "timestamp": "2023-09-02T17:59:33Z",
                        "shouldLinkResultBeReturned": false
                    }
                }
            }
        }
    }
}

That doesn't give me any information about the error at all.

In SkillDebugger.CaputureError all I get is

...
        "code": "SKILL_ENDPOINT_ERROR",
        "description": "Skill execution returned an exception for requestId amzn1.echo-api.request.<redacted>",
...

And then a final SkillDebugger.CaputureDebugingInfo (~1 sec later) says

...
                    "request": {
                        "type": "SessionEndedRequest",
                        "requestId": "amzn1.echo-api.request.d26881dd-1ed7-41f7-9c4b-03872b6c3e81",
                        "timestamp": "2023-09-02T17:59:34Z",
                        "locale": "en-US",
                        "reason": "ERROR",
                        "error": {
                            "type": "INVALID_RESPONSE",
                            "message": "An exception occurred while dispatching the request to the skill."
                        }

I can only guess that either (a) the request dies internally before making it out of the Amazon server and to my server, or (b) the request makes it to the the reverse proxy and goes no further, but normally it would return a 502 (Bad Gateway).

Neither of which I know how to solve, but I am just guessing. I don't see how to get concrete information out of those logs.

Where do I get more information to debug this?

Thanks

rosskouk commented 10 months ago

Hi,

I'm happy to try and help, I've got a couple of questions first.

Do you have any logs on your Nginx proxy showing connections to the skill?

Have you set the skill debug level to 3?

Have you confirmed that the locale on your skill and Amazon device match?

Debugging these is tricky and I've had issues with the debugger itself Assuming the skill logs you provided were taken while trying to access the skill, it looks like the requests from Amazon are not reaching your skill. The mismatched locale can cause this as responses do not appear to be sent unless locale matches on both ends.

The next thing to check would be logs on the reverse proxy, you should see attempts to access the skill on there.

Let me know how you get on.