HAASKA 405 errors

Im endeavouring to install HAASKA on my HA, which is installed in a docker container, on a Synology ds219+. I use a reverse proxy through the sysnolgy application portal to direct my traffic to the docker container.
I have no problems accessing HA via HTTPS using my duckdns address, routed through the reverse proxy. the reverse proxy directs the HTTPS port 443 to my HTTP 8123 port.

my configuration has the following entry to support alexa:

alexa:
  smart_home:

When i run the test script from the part 3 of the wiki, changing to my personal details i get a 405 error.

  "url": "https://ha.myduckaddress.duckdns.org/api",
  "bearer_token": "eyJ0eXAiOiJ**************************************DkxfQ.x9R1svbsxk5mH6gURFo76ZEC_UWJFFFVydyjkrg-5D8",
  "debug": false,
  "ssl_verify": true,
  "ssl_client": []
}

gives me a response as follows:

Response:
{
  "errorMessage": "405 Client Error: Not Allowed for url: https://ha.********.duckdns.org/api/alexa/smart_home",
  "errorType": "HTTPError",
  "stackTrace": [
    [
      "/var/task/haaska.py",
      111,
      "event_handler",
      "return ha.post('alexa/smart_home', event, wait=True)"
    ],
    [
      "/var/task/haaska.py",
      66,
      "post",
      "r.raise_for_status()"
    ],
    [
      "/var/task/requests/models.py",
      940,
      "raise_for_status",
      "raise HTTPError(http_error_msg, response=self)"
    ]
  ]
}

Request ID:
"1af4023b-0a3e-****-****-********"

Function Logs:
START RequestId: 1af4023b-0a3e-4dcb-96e2-4697cfc803e2 Version: $LATEST
405 Client Error: Not Allowed for url: https://ha.**********.duckdns.org/api/alexa/smart_home: HTTPError
Traceback (most recent call last):
  File "/var/task/haaska.py", line 111, in event_handler
    return ha.post('alexa/smart_home', event, wait=True)
  File "/var/task/haaska.py", line 66, in post
    r.raise_for_status()
  File "/var/task/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: Not Allowed for url: https://ha.*************.duckdns.org/api/alexa/smart_home

END RequestId: 1af4023b-0a3e-4dcb-96e2-4697cfc803e2
REPORT RequestId: 1af4023b-0a3e-4dcb-96e2-4697cfc803e2	Duration: 735.98 ms	Billed Duration: 800 ms	Memory Size: 128 MB	Max Memory Used: 53 MB	Init Duration: 274.42 ms	

If anyone has any advice to offer on 405 returns on setups such as mine, it would be much appreciated.

tony

I have the same problem.

have you solved the problem?

Thaks

Not yet, as soon as I do, I’ll post it.
Hopefully someone else has resolved the issue.

1 Like

Maybe you used the new haska 1.1.0?
and changed the info about your ha in the lambda web directly?

I believe so. I’ve just engaged the debug function, and the error i believe is caused by the HTTPS method.

[DEBUG]	2020-04-08T16:02:54.491Z	75abba03-fa05-414c-b642-b6a6ac0f9756	Starting new HTTPS connection (1): ha.myduck.duckdns.org:443
[DEBUG]	2020-04-08T16:02:54.835Z	75abba03-fa05-414c-b642-b6a6ac0f9756	https://ha.myduck.duckdns.org:443 "POST /api/alexa/smart_home HTTP/1.1" 405 150
405 Client Error: Not Allowed for url: https://ha.myduck.duckdns.org/api/alexa/smart_home: HTTPError

Ive read that the POST method being replaced by the GET method may resolve this, but i have no idea where to look.

My haaska / alexa stopped working this morning as well. It’s been working flawlessly for a year or more.

405: Method Not Allowed
When I browse to - https://myHA.duckdns.org/api/alexa/smart_home

I get - 405: Method Not Allowed

Alexa cannot communicate with any of my devices.

What is also weird is that my front end through the browser has seemed to become unavailable for 10-30 seconds a few times today. Also my iPhone app has done the same thing. I feel like there may be something else going on with HA and this is just a symptom.

I have some problem. There is a solution?
Thanks.

Hi to everyone,

I have a similar problem, but in my case i have error 403.

Which version of HA are you using?

In my case i’m using HA in a docker. In version 0.100.3, works perfect, but when i use version 102.3 or higher, then appears this error 403.

I was just tracking down an issue I had with an HTTP 405 Not Allowed message when taking Snapshots. I think I found a solution to my issue and hopefully it may help here.

My configuration includes HA in a VM and I use Synology’s reverse proxy. I used pretty much all the default settings and for the most part everything works fine except when I upgrade components or run snapshots, which is where the 405s come in.

I opened up Dev tools in my browser and I did a compare between the direct IP and reverse proxy address. On the direct IP the snapshot would finish at around 90 seconds. However, using the reverse proxy it would “finish” and generate the 405 at 60-ish seconds. This indicated that I was likely dealing with a timeout setting in the Synology reverse proxy.

I opened the Synology Reverse Proxy settings and looked at the Advanced Settings tab and updated the 3 available timeout settings to 120 seconds instead of 90 and now I’m able to run a snapshot without getting the 405 message.

Long story short - try to figure out how long those messages take to post and update your timeout(s) in your Reverse Proxy to accommodate.

I hope this helps!