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
54 stars 7 forks source link

Skill endpoint returned an invalid response. #46

Open Rupie17 opened 2 months ago

Rupie17 commented 2 months ago

Describe the issue I have followed the instructions and set everything up. All endpoints are accessible and have valid certificates. I have went through the troubleshooting steps to ensure my locale matches, the endpoints are available, certificate is valid, intents are copied from alexa.json.

The skill builds properly, I have NOT published it and it shows up as a dev skill in alexa app. However, it shows it by the skill name but it says Start by saying "Alexa open hello world' and I am not sure if that's the default or something is incorrect because I have no hello world intents in the skill.

Operating System Docker

To Reproduce In the developer test console issue the command 'Alexa open navi sonic'

Logs This is the output JSON (truncated) when trying the manual JSON testing in dev console:

    },
                "request": {
                    "type": "LaunchRequest",
                    "requestId": "amzn1.echo-api.request.b35babb7-9cee-4718-90dc-ed605259269e",
                    "locale": "en-CA",
                    "timestamp": "2024-08-07T20:13:31Z",
                    "shouldLinkResultBeReturned": false
                }
            }
        },
        "metrics": {
            "skillExecutionTimeInMilliseconds": 42
        }
    },
    "error": {
        "message": "Skill endpoint returned an invalid response."
    }
}

}

Comments Add any other context about the problem here.

eagle-phoenix commented 1 month ago

Hi, same here. localization: es-ES Asking alexa on test window: "Open navi sonic" or "abre navi sonic"

Running "AskNavidrome Web Service" on docker. It's https accesible, and Navidrome too. Both on using reverse proxy with valid certificates. I can see the debug pages (queue, buffer and history) but they are always empty. In the log of the AskNavidrome docker I can't see nothing after sending a request from Alexa developer's test window, but I see in the developer window, that playlists or artists are accesible.

Example:

"request": {
        "type": "IntentRequest",
        "requestId": "amzn1.echo-api.request.2b783cfa-d7ea-4f83-8677-9c62793176f2",
        "locale": "es-ES",
        "timestamp": "2024-09-21T18:24:49Z",
        "intent": {
            "name": "NaviSonicPlayPlaylist",
            "confirmationStatus": "NONE",
            "slots": {
                "playlist": {
                    "name": "playlist",
                    "value": "vertigo",
                    "resolutions": {
                        "resolutionsPerAuthority": [
                            {
                                "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.***********************.playlist_names",
                                "status": {
                                    "code": "ER_SUCCESS_MATCH"
                                },
                                "values": [
                                    {
                                        "value": {
                                            "name": "mas vertigo",
                                            "id": "2eafe5c8c258d176ef67e3f8d97b339d"
                                        }
                                    },
                                    {
                                        "value": {
                                            "name": "Vértigo",
                                            "id": "a681cbb9e36bc1b4e1fdae919ace90ca"
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    "confirmationStatus": "NONE",
                    "source": "USER",
                    "slotValue": {
                        "type": "Simple",
                        "value": "vertigo",
                        "resolutions": {
                            "resolutionsPerAuthority": [
                                {
                                    "authority": "amzn1.er-authority.echo-sdk.amzn1.ask.skill.******************************playlist_names",
                                    "status": {
                                        "code": "ER_SUCCESS_MATCH"
                                    },
                                    "values": [
                                        {
                                            "value": {
                                                "name": "mas vertigo",
                                                "id": "2eafe5c8c258d176ef67e3f8d97b339d"
                                            }
                                        },
                                        {
                                            "value": {
                                                "name": "Vértigo",
                                                "id": "a681cbb9e36bc1b4e1fdae919ace90ca"
                                            }

I share two fragments of the output JSON: The intent is "open navi sonic" or "abre navi sonic"

"request": {
        "type": "LaunchRequest",
        "requestId": "amzn1.echo-api.request.fa916516-1c3f-4a9e-b34c-840c2618bf6b",
        "locale": "es-ES",
        "timestamp": "2024-09-21T18:18:25Z",
        "shouldLinkResultBeReturned": false
    }

It's similar with other intents like "play random music" or "play music from ". At the end, always the same end part with an "invalid_response" type.

"request": {
        "type": "SessionEndedRequest",
        "requestId": "amzn1.echo-api.request.0fa52a5f-07b2-40b3-a2b9-4fcbd8c90375",
        "timestamp": "2024-09-21T18:18:25Z",
        "locale": "es-ES",
        "reason": "ERROR",
        "error": {
            "type": "INVALID_RESPONSE",
            "message": "An exception occurred while dispatching the request to the skill."
        }

Thank you for this great idea.

iCanHazSkillz commented 3 weeks ago

I have the same invalid response issue. Haven't been able to play anything through the alexa skill in quite some time.

2024-09-27 14:44:03,034 - root - DEBUG - Request received: {'error': {'message': 'The URL specified in the Play directive is invalid', 'object_type': 'INVALID_RESPONSE'}, 2024-09-27 15:06:10,529 - root - DEBUG - Request received: {'error': {'message': 'An exception occurred while dispatching the request to ' 'the skill.', 'object_type': 'INVALID_RESPONSE'},

But when using the navidrome URL in a browser, I'm able to access the stream no problem.

I don't think this project is getting support anymore though. Haven't seen activity from the dev in quite some time. It's too bad, this was a great tool to interface with navidrome when it worked.

rosskouk commented 3 weeks ago

Hi @Rupie17 If the skill needs to be invoked with the phrase "Alexa Open Hello World" something is incorrectly set up in your skill on the Amazon side. If you look at the alexa.json file in the respository you will see the following on line 4

"invocationName": "navisonic",

This is the phrase used to launch the skill. You are free to change it to anything you like, I believe that Amazon requires this to be two words to meet their standards. I'd check your skill configuration against the one in the repository and hopefully you will see a problem.

rosskouk commented 3 weeks ago

Hi @eagle-phoenix I suspect this is a different issue to the one originally logged. If you are not seeing any logs at all on the skill when debugging is enabled there is a connectivity issue and Amazon is unable to reach your skill. I'd normally expect a URL or certificate issue to be the cause of this.

rosskouk commented 3 weeks ago

Hi @iCanHazSkillz, In your comment you mention that you've not been able to play music for some time. Can you confirm if the skill has ever worked for you? If it did work then stopped, did something change for example a Navidrome upgrade?

iCanHazSkillz commented 3 weeks ago

Hi @rosskouk,

It's hard to say exactly when the skill stopped working as I don't use it daily, but I want to say the 'invalid response' issue started a few months back.

I used to be able to work around it by opening the skill from Alexa, and saying 'play' after it says 'ready'; however, this work around stopped working a couple weeks ago.

There has been a couple navidrome updates since my issue begun, so it's possible navidrome is the culprit. Do you suggest I revert back to a specific navidrome version?

Thanks for taking the time to reply by the way. It's very much appreciated!

rosskouk commented 3 weeks ago

Thanks for getting back to me. Can you hold off for now, I'm currently running Navidrome 0.47.5 and that is working with no issues. I'm planning on upgrading to the latest version this week as that's long overdue. I'll let you know if I end up with the same issue and see about getting a fix from there if I do. I use the skill daily so I should see if that's the issue quite quickly. Thanks for your patience.

iCanHazSkillz commented 3 weeks ago

Hi @rosskouk,

I was just thinking to look into my nginx configurations since most of my logged errors gravitate around URL issues. If time allows, would you be able to advise if anything looks wrong or out of place in comparison with yours? I'd really appreciate it.

asknavidrome conf file:

server {

    server_name redacted.duckdns.org;

    location / {
        proxy_pass http://192.168.0.163:5000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

    listen [::]:443 ssl; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/redacted.duckdns.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/redacted.duckdns.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    listen 80;
    listen [::]:80;
    server_name redacted.duckdns.org;

    # Redirect HTTP to HTTPS
    return 301 https://$host$request_uri;
}

Navidrome conf file:

server {
    server_name redacted.duckdns.org;

    location / {
        proxy_pass http://localhost:4533/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;
    }

    listen [::]:443 ssl http2; # managed by Certbot
    listen 443 ssl http2; # managed by Certbot

    ssl_certificate /etc/letsencrypt/live/redacted.duckdns.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/redacted.duckdns.org/privkey.pem; # managed by Certbot
    ssl_trusted_certificate /etc/letsencrypt/live/redacted.duckdns.org/chain.pem;
    ssl_stapling on;
    ssl_stapling_verify on;

    add_header Strict-Transport-Security "max-age=31536000" always;

    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    listen 80;
    listen [::]:80;
    server_name redacted.duckdns.org;

    return 301 https://$host$request_uri; # Redirect all HTTP to HTTPS
}
rosskouk commented 3 weeks ago

Hi @iCanHazSkillz

Those configs look fine to me, unfortunately I can't give you a direct comparison as I run the skill inside of a Kubernetes cluster so the config is quite different, no special options were required though. One other thing you could check is accessing the URL of your skill in a regular browser. If everything is working you should see a 405 Method Not Allowed error in the browser. This is normal and a sign the skill is waiting for commands from Amazon.

iCanHazSkillz commented 3 weeks ago

@rosskouk, yes I do get the 405 method not allowed. I guess that's not the issue then. Thanks for the reply!

rosskouk commented 2 weeks ago

@iCanHazSkillz I've now completed the update to Navidrome 0.53.3 and everything continues to work fine, unfortunately I can't explain why the skill has stopped working for you. let me know if there is anything else you'd like me to look at otherwise I'll close off this issue as I can't recreate the problem.

iCanHazSkillz commented 2 weeks ago

@rosskouk You can go ahead and close this issue as it is most likely related to a network and/or DNS issue within my environment and not Asknavidrome per say. I appreciate the help you've offered and I'm happy to see you're still active on the repo.

I'll continue my investigation on my end as the issue appears to be intermittent. If you want to leave this case open, I'll report back if/when I determine the root cause. Might help someone else.

rosskouk commented 2 weeks ago

No worries, I'll mark it and leave it open. If you do find the issue it would be great if you could post your solution to help others.

iCanHazSkillz commented 1 week ago

Hi @rosskouk, I'm still encountering the same issue. I think what drives me absolutely insane is that the issue will self-resolve and reoccur randomly at times.

Here's a failed request to play my piano playlist which throws a General Exception: <urlopen error [Errno -3] Try again>:

2024-10-14 18:47:29,200 - root - DEBUG - Request received: {'dialog_state': None,
 'intent': {'confirmation_status': 'NONE',
            'name': 'NaviSonicPlayPlaylist',
            'slots': {'playlist': {'confirmation_status': 'NONE',
                                   'name': 'playlist',
                                   'resolutions': {'resolutions_per_authority': [{'authority': 'amzn1.er-authority.echo-sdk.amzn1.ask.skill.[redacted].playlist_names',
                                                                                  'status': {'code': 'ER_SUCCESS_MATCH'},
                                                                                  'values': [{'value': {'id': '060e8e88876d796e83c5201d70e45661',
                                                                                                        'name': 'Piano'}}]}]},
                                   'slot_value': {'object_type': 'Simple',
                                                  'resolutions': {'resolutions_per_authority': [{'authority': 'amzn1.er-authority.echo-sdk.amzn1.ask.skill.[redacted].playlist_names',
                                                                                                 'status': {'code': 'ER_SUCCESS_MATCH'},
                                                                                                 'values': [{'value': {'id': '060e8e88876d796e83c5201d70e45661',
                                                                                                                       'name': 'Piano'}}]}]},
                                                  'value': 'piano'},
                                   'value': 'piano'}}},
 'locale': 'en-CA',
 'object_type': 'IntentRequest',
 'request_id': 'amzn1.echo-api.request.ec9d5bed-8647-4c17-9e4f-b4a1bce51b35',
 'timestamp': datetime.datetime(2024, 10, 14, 18, 47, 28, tzinfo=tzlocal())}
2024-10-14 18:47:29,200 - root - DEBUG - In NaviSonicPlayPlaylist
2024-10-14 18:47:29,201 - asknavidrome.subsonic_api - DEBUG - In function search_playlist()
2024-10-14 18:47:31,378 - asknavidrome.subsonic_api - DEBUG - Found playlist c0312235-e709-494a-89cb-cb18f9881391
2024-10-14 18:47:31,378 - asknavidrome.subsonic_api - DEBUG - In function build_song_list_from_playlist()
2024-10-14 18:47:31,464 - asknavidrome.media_queue - DEBUG - In clear()
2024-10-14 18:47:31,464 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:47:31,528 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:47:31,528 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:47:31,528 - asknavidrome.media_queue - DEBUG - In add_track() - there are 1 tracks in the queue
2024-10-14 18:47:31,528 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:47:36,543 - root - DEBUG - In GeneralExceptionHandler
2024-10-14 18:47:36,543 - root - ERROR - General Exception: <urlopen error [Errno -3] Try again>
2024-10-14 18:47:36,543 - root - ERROR - Request Type Was: IntentRequest
2024-10-14 18:47:36,543 - root - ERROR - Intent Name Was: NaviSonicPlayPlaylist
2024-10-14 18:47:36,547 - werkzeug - INFO - 192.168.0.163 - - [14/Oct/2024 18:47:36] "POST / HTTP/1.0" 200 -

Here's the same request made successfully just a couple minutes later:

2024-10-14 18:48:50,704 - werkzeug - INFO - 192.168.0.163 - - [14/Oct/2024 18:48:50] "POST / HTTP/1.0" 200 -
2024-10-14 18:49:47,885 - root - DEBUG - Request received: {'dialog_state': None,
 'intent': {'confirmation_status': 'NONE',
            'name': 'NaviSonicPlayPlaylist',
            'slots': {'playlist': {'confirmation_status': 'NONE',
                                   'name': 'playlist',
                                   'resolutions': {'resolutions_per_authority': [{'authority': 'amzn1.er-authority.echo-sdk.amzn1.[redacted].playlist_names',
                                                                                  'status': {'code': 'ER_SUCCESS_MATCH'},
                                                                                  'values': [{'value': {'id': '060e8e88876d796e83c5201d70e45661',
                                                                                                        'name': 'Piano'}}]}]},
                                   'slot_value': {'object_type': 'Simple',
                                                  'resolutions': {'resolutions_per_authority': [{'authority': 'amzn1.er-authority.echo-sdk.amzn1.ask.skill.[redacted].playlist_names',
                                                                                                 'status': {'code': 'ER_SUCCESS_MATCH'},
                                                                                                 'values': [{'value': {'id': '060e8e88876d796e83c5201d70e45661',
                                                                                                                       'name': 'Piano'}}]}]},
                                                  'value': 'piano'},
                                   'value': 'piano'}}},
 'locale': 'en-CA',
 'object_type': 'IntentRequest',
 'request_id': 'amzn1.echo-api.request.b211eb28-2c96-48de-9ae4-4dee8616a374',
 'timestamp': datetime.datetime(2024, 10, 14, 18, 49, 47, tzinfo=tzlocal())}
2024-10-14 18:49:47,885 - root - DEBUG - In NaviSonicPlayPlaylist
2024-10-14 18:49:47,885 - asknavidrome.subsonic_api - DEBUG - In function search_playlist()
2024-10-14 18:49:52,502 - asknavidrome.subsonic_api - DEBUG - Found playlist c0312235-e709-494a-89cb-cb18f9881391
2024-10-14 18:49:52,502 - asknavidrome.subsonic_api - DEBUG - In function build_song_list_from_playlist()
2024-10-14 18:49:52,603 - asknavidrome.media_queue - DEBUG - In clear()
2024-10-14 18:49:52,603 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:52,673 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:52,673 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:52,673 - asknavidrome.media_queue - DEBUG - In add_track() - there are 1 tracks in the queue
2024-10-14 18:49:52,673 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:52,738 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:52,739 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:52,739 - asknavidrome.media_queue - DEBUG - In add_track() - there are 2 tracks in the queue
2024-10-14 18:49:52,739 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:52,804 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:52,804 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:52,804 - asknavidrome.media_queue - DEBUG - In add_track() - there are 3 tracks in the queue
2024-10-14 18:49:52,804 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:52,870 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:52,870 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:52,870 - asknavidrome.media_queue - DEBUG - In add_track() - there are 4 tracks in the queue
2024-10-14 18:49:52,871 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:52,944 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:52,944 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:52,944 - asknavidrome.media_queue - DEBUG - In add_track() - there are 5 tracks in the queue
2024-10-14 18:49:52,944 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,000 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,000 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,000 - asknavidrome.media_queue - DEBUG - In add_track() - there are 6 tracks in the queue
2024-10-14 18:49:53,000 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,056 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,056 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,056 - asknavidrome.media_queue - DEBUG - In add_track() - there are 7 tracks in the queue
2024-10-14 18:49:53,056 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,112 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,112 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,112 - asknavidrome.media_queue - DEBUG - In add_track() - there are 8 tracks in the queue
2024-10-14 18:49:53,112 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,163 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,163 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,163 - asknavidrome.media_queue - DEBUG - In add_track() - there are 9 tracks in the queue
2024-10-14 18:49:53,163 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,217 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,217 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,217 - asknavidrome.media_queue - DEBUG - In add_track() - there are 10 tracks in the queue
2024-10-14 18:49:53,217 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,268 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,268 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,268 - asknavidrome.media_queue - DEBUG - In add_track() - there are 11 tracks in the queue
2024-10-14 18:49:53,268 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,329 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,329 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,329 - asknavidrome.media_queue - DEBUG - In add_track() - there are 12 tracks in the queue
2024-10-14 18:49:53,329 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,394 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,394 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,394 - asknavidrome.media_queue - DEBUG - In add_track() - there are 13 tracks in the queue
2024-10-14 18:49:53,394 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,463 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,463 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,463 - asknavidrome.media_queue - DEBUG - In add_track() - there are 14 tracks in the queue
2024-10-14 18:49:53,463 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,521 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,522 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,522 - asknavidrome.media_queue - DEBUG - In add_track() - there are 15 tracks in the queue
2024-10-14 18:49:53,522 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,581 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,582 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,582 - asknavidrome.media_queue - DEBUG - In add_track() - there are 16 tracks in the queue
2024-10-14 18:49:53,582 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,640 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,640 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,640 - asknavidrome.media_queue - DEBUG - In add_track() - there are 17 tracks in the queue
2024-10-14 18:49:53,640 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,695 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,695 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,695 - asknavidrome.media_queue - DEBUG - In add_track() - there are 18 tracks in the queue
2024-10-14 18:49:53,695 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,782 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,783 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,783 - asknavidrome.media_queue - DEBUG - In add_track() - there are 19 tracks in the queue
2024-10-14 18:49:53,783 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,864 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,864 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,864 - asknavidrome.media_queue - DEBUG - In add_track() - there are 20 tracks in the queue
2024-10-14 18:49:53,864 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,918 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,918 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,918 - asknavidrome.media_queue - DEBUG - In add_track() - there are 21 tracks in the queue
2024-10-14 18:49:53,918 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:53,979 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:53,979 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:53,979 - asknavidrome.media_queue - DEBUG - In add_track() - there are 22 tracks in the queue
2024-10-14 18:49:53,979 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,035 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,035 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,035 - asknavidrome.media_queue - DEBUG - In add_track() - there are 23 tracks in the queue
2024-10-14 18:49:54,035 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,090 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,090 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,090 - asknavidrome.media_queue - DEBUG - In add_track() - there are 24 tracks in the queue
2024-10-14 18:49:54,090 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,149 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,149 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,149 - asknavidrome.media_queue - DEBUG - In add_track() - there are 25 tracks in the queue
2024-10-14 18:49:54,149 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,209 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,209 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,209 - asknavidrome.media_queue - DEBUG - In add_track() - there are 26 tracks in the queue
2024-10-14 18:49:54,209 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,261 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,261 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,261 - asknavidrome.media_queue - DEBUG - In add_track() - there are 27 tracks in the queue
2024-10-14 18:49:54,261 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,309 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,309 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,309 - asknavidrome.media_queue - DEBUG - In add_track() - there are 28 tracks in the queue
2024-10-14 18:49:54,309 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,356 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,356 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,357 - asknavidrome.media_queue - DEBUG - In add_track() - there are 29 tracks in the queue
2024-10-14 18:49:54,357 - asknavidrome.subsonic_api - DEBUG - In function get_song_details()
2024-10-14 18:49:54,415 - asknavidrome.subsonic_api - DEBUG - In function get_song_uri()
2024-10-14 18:49:54,416 - asknavidrome.media_queue - DEBUG - In add_track()
2024-10-14 18:49:54,416 - asknavidrome.media_queue - DEBUG - In add_track() - there are 30 tracks in the queue
2024-10-14 18:49:54,416 - root - INFO - Playing playlist piano
2024-10-14 18:49:54,416 - asknavidrome.media_queue - DEBUG - In get_next_track()
2024-10-14 18:49:54,417 - asknavidrome.controller - DEBUG - In start_playback() - play mode
2024-10-14 18:49:54,417 - asknavidrome.controller - DEBUG - In add_screen_background()
2024-10-14 18:49:54,417 - asknavidrome.controller - DEBUG - Track ID: 0926996fe9327bfdf84865097fc2a453
2024-10-14 18:49:54,417 - asknavidrome.controller - DEBUG - Track Previous ID: None
2024-10-14 18:49:54,417 - asknavidrome.controller - INFO - Playing track: Danse des Fleurs by: Patrick Hamilton
2024-10-14 18:49:54,419 - root - DEBUG - Response sent: {'api_response': None,
 'can_fulfill_intent': None,
 'card': {'image': None,
          'object_type': 'Standard',
          'text': 'Playing playlist piano',
          'title': 'AskNavidrome'},
 'directives': [{'audio_item': {'metadata': {'art': {'content_description': 'AskNavidrome',
                                                     'sources': [{'height_pixels': None,
                                                                  'size': None,
                                                                  'url': 'https://github.com/navidrome/navidrome/raw/master/resources/logo-192x192.png',
                                                                  'width_pixels': None}]},
                                             'background_image': {'content_description': 'AskNavidrome',
                                                                  'sources': [{'height_pixels': None,
                                                                               'size': None,
                                                                               'url': 'https://github.com/navidrome/navidrome/raw/master/resources/logo-192x192.png',
                                                                               'width_pixels': None}]},
                                             'subtitle': 'Playing playlist '
                                                         'piano',
                                             'title': 'AskNavidrome'},
                                'stream': {'caption_data': None,
                                           'expected_previous_token': None,
                                           'offset_in_milliseconds': 0,
                                           'token': '0926996fe9327bfdf84865097fc2a453',
                                           'url': 'https://[redacted]:443/rest/stream.view?f=json&v=1.16.1&c=AskNavidrome&u=michel&s=f6ad2daf231a528daf4e1755c1b716ef&t=e687e2ecb85cb765b0b077de4673e4ca&id=0926996fe9327bfdf84865097fc2a453'}},
                 'object_type': 'AudioPlayer.Play',
                 'play_behavior': 'REPLACE_ALL'}],
 'experimentation': None,
 'output_speech': {'object_type': 'SSML',
                   'play_behavior': None,
                   'ssml': '<speak>Playing playlist piano</speak>'},
 'reprompt': None,
 'should_end_session': True}
2024-10-14 18:49:54,420 - werkzeug - INFO - 192.168.0.163 - - [14/Oct/2024 18:49:54] "POST / HTTP/1.0" 200 -

My question to you is, do you know of any way I could get more debugging details from the following error? root - ERROR - General Exception: <urlopen error [Errno -3] Try again>

Would really love to get to the bottom of this, but this is a hard one to troubleshoot given the sporadic nature of the error. I'm comfortable modifying the app.py and or subsonic_api to get to the bottom of this. Just need a little guidance. Appreciate the help - thanks!

rosskouk commented 5 days ago

I've done some checking, it looks like this is being raised by the urllib library, although I can't find a complete list of exits codes from looking at other posts it looks like -3 indicates a temporary failure in name resolution.

Is it possible there is any intermittent DNS issue that is causing the issue?

Rupie17 commented 1 day ago

Hi @Rupie17 If the skill needs to be invoked with the phrase "Alexa Open Hello World" something is incorrectly set up in your skill on the Amazon side. If you look at the alexa.json file in the respository you will see the following on line 4

"invocationName": "navisonic",

This is the phrase used to launch the skill. You are free to change it to anything you like, I believe that Amazon requires this to be two words to meet their standards. I'd check your skill configuration against the one in the repository and hopefully you will see a problem.

Hey, thanks for the reply. I've had time to go through this again and just tried starting from the beginning and rebuilding everything. Still have the same issue. My invocation name is navi sonic. When I add the skill to my alexa app it shows the name as navi sonic and then below that it says "Alexa open hello world" I can't find hello world anywhere and not sure what is going on. My container is deployed and accessible on an endpoint, the skill builds according to your instructions but for the life of me I cannot get it to invoke this skill.

Any other insight would be great.

Cheers, John

Rupie17 commented 9 hours ago

Hi @Rupie17 If the skill needs to be invoked with the phrase "Alexa Open Hello World" something is incorrectly set up in your skill on the Amazon side. If you look at the alexa.json file in the respository you will see the following on line 4

"invocationName": "navisonic",

This is the phrase used to launch the skill. You are free to change it to anything you like, I believe that Amazon requires this to be two words to meet their standards. I'd check your skill configuration against the one in the repository and hopefully you will see a problem.

Hey, thanks for the reply. I've had time to go through this again and just tried starting from the beginning and rebuilding everything. Still have the same issue. My invocation name is navi sonic. When I add the skill to my alexa app it shows the name as navi sonic and then below that it says "Alexa open hello world" I can't find hello world anywhere and not sure what is going on. My container is deployed and accessible on an endpoint, the skill builds according to your instructions but for the life of me I cannot get it to invoke this skill.

Any other insight would be great.

Cheers, John

Ok,

Because I have insane OCD I had keep investigating and see what is going on here. I'll try to keep this short, there are a few other things to check, maybe you want to include them in the troubleshooting section but helped me to get this working, finally.

In short, my issue was with SSL certificates. Some of this you covered already, so apologies for any repetition, but I kinda missed this.

When you build the skill you set your endpoint and have a couple options for certs. I chose the option in the documentation (my dev server has a cert) but in my setup, I have all my exposed services on a subdomain of my main domain and i use cloudflare origin certs for this and its a wildcard cert.

When i did some manual json testing I found an error saying the certificate in use contains a wildcard in its subject or cname.

That's where it led me to the endpoint certificate options! I tried using the second option that says my domain uses a wildcard cert and tried that config. rebuilt the skill, deployed and tried but i still got an error, a different one - something like the response is invalid.

So I went back to the first certificate option 'My development endpoints has a certificate from a trusted certificate authority'. I issued a cert from lets encrypt for the specific navi endpoint I use. This was the original way I configured it but still got a cert error so what I had to do was add a specific dns entry in cloudflare for my navi endpoint (navi.domain.com), turn off proxying and then attach the specific named cert to this endpoint and this is what got a successful response in the developer console and i could see it in the logs.

However, another minor point, I had this asknavi container connecting to navidrome on the docker network using its internal name, and while i could see in the logs song playing, there was no audio output anywhere so there was still an issue, probably with the connection between the containers. I ended up changing the env variable for navi_url to the external url I use for music, and voila, everything now works!

Anyway, moral of the story, check your cert set up. who knew amazon wouldn't like a wildcard cert when you select named cert. I used to use specific certs for every endpoint but its easier to manage with a wildcard so changed that up a while again and basically didnt connect the two when I got this issue so it obviously makes sense now.

Hope this helps anyone else.

Cheers, John

rosskouk commented 8 hours ago

Hi John,

Thanks so much for sharing this information, I'll leave this open for now to review updating the docs. People using cloud flare have had issues in the past and I've never been able to assist as I don't / never have used it. I suspect your process may well others, thanks again!