Indego icon indicating copy to clipboard operation
Indego copied to clipboard

Connection error bosch indego APi

Open Tacchi1983 opened this issue 1 year ago • 47 comments

The integration became offline too after ha update. I tried to reinstall like u recommended but i cant connect it anymore. I can login but then i get a warning that connection with bosch indego API didnt succeed.

Log: Deze fout is ontstaan door een aangepaste integratie.

Logger: custom_components.indego.config_flow Source: custom_components/indego/config_flow.py:92 Integration: indego (documentation) First occurred: 11:24:49 (1 occurrences) Last logged: 11:24:49

Error while retrieving mower serial in account! Reason: 403, message='Forbidden', url=URL('https://api.indego-cloud.iot.bosch-si.com/api/v1/alms')

Tacchi1983 avatar Nov 04 '23 10:11 Tacchi1983

Same here

michaelmog88 avatar Nov 04 '23 14:11 michaelmog88

Please write: Version of HA Version of the integration When did work correctly last time? (Date and version used then) When did it stop working?

jm-73 avatar Nov 04 '23 19:11 jm-73

It stopped working after latest ha version 2023.11.0 updated at 2nd of november. It worked nicely before. Integration version 5.6.1, the same as before when it still was working. Last working ha version 2023.10.5

Tacchi1983 avatar Nov 04 '23 19:11 Tacchi1983

Hi there, I just wanted to confirm 403 issue after updating to HA from version 2023.10.5 to version 2023.11.1.

TanteFinn avatar Nov 05 '23 14:11 TanteFinn

Hi, Also got the error "failed with HTTP status code: 403" after updating HA to 2023.11.1. Integration version 5.6.1

Tried to reinstall, but that didn't work.

LJvHeck avatar Nov 05 '23 15:11 LJvHeck

Same here

Blackmood667 avatar Nov 05 '23 18:11 Blackmood667

And here

AcciTo avatar Nov 05 '23 20:11 AcciTo

Also here : Integration stopped working once upgraded HA from 10.4 to 11.0. Removed then add HA integration failed with error message : "The connection to the Bosch Indego API failed!" Also tried again after re-installed Chrome extension, same error. From HA Logs :

"Logger: custom_components.indego.config_flow
Source: custom_components/indego/config_flow.py:92
Integration: Bosch Indego Mower ([documentation](https://github.com/jm-73/Indego))
First occurred: 22:27:59 (3 occurrences)
Last logged: 22:31:37"


Error while retrieving mower serial in account! Reason: 403, message='Forbidden', url=URL('https://api.indego-cloud.iot.bosch-si.com/api/v1/alms')

matilbianco avatar Nov 05 '23 21:11 matilbianco

Same here

Core 2023.11.1 Supervisor 2023.10.1 Operating System 11.1

PiotrasHASS avatar Nov 06 '23 12:11 PiotrasHASS

Stopped working for me too, but did not yet update to 2023.11.x

Home Assistant 2023.10.5
Supervisor 2023.10.1
Operating System 11.1

tobaco avatar Nov 06 '23 12:11 tobaco

It stopped working for me too. In openHAB. 😄 Bosch changed something on their side, so it's highly unlikely that it's a regression in the integration.

jlaur avatar Nov 06 '23 13:11 jlaur

I got the following error2:

Logger: pyIndego.indego_base_client Source: custom_components/indego/config_flow.py:85 Integration: Bosch Indego Mower (documentation) First occurred: 08:54:42 (2 occurrences) Last logged: 08:55:39

Request to 'https://api.indego-cloud.iot.bosch-si.com/api/v1/alms' failed with HTTP status code: 403

and

Logger: custom_components.indego.config_flow Source: custom_components/indego/config_flow.py:92 Integration: Bosch Indego Mower (documentation) First occurred: 08:54:42 (2 occurrences) Last logged: 08:55:39

Error while retrieving mower serial in account! Reason: 403, message='Forbidden', url=URL('https://api.indego-cloud.iot.bosch-si.com/api/v1/alms')

Core 2023.11.1 Supervisor 2023.10.1 Operating System 11.1 Frontend 20231030.1

Feldermann avatar Nov 08 '23 08:11 Feldermann

Also the same for me. After a restart for some HACS updates, the Indego integration now returns 'unavailable' for all sensors. I tried to remove and reinstall, but see "The connection to the Bosch Indego API failed!"

Core 2023.11.0 Supervisor 2023.10.1 Operating System 11.0 Frontend 20231030.1

35aportal avatar Nov 08 '23 11:11 35aportal

Same for me

Larnak23 avatar Nov 08 '23 20:11 Larnak23

Also the same for me. After a restart for some HACS updates, the Indego integration now returns 'unavailable' for all sensors. I tried to remove and reinstall, but see "The connection to the Bosch Indego API failed!"

Core 2023.11.0 Supervisor 2023.10.1 Operating System 11.0 Frontend 20231030.1

same here

jipijajay avatar Nov 09 '23 08:11 jipijajay

Same here. Nothing changed in my setup. So I think that something has changed on the Bosch API side. I will debug.

sander1988 avatar Nov 12 '23 13:11 sander1988

The Azure WAF (the Bosch API runs on Azure) was blocking our user-agent for unknown reasons. Similar issue as #119.

I have changed the user-agent to be unique for each HA instance. Now the 403 issue is gone. I have 2 PR containing the changes.

sander1988 avatar Nov 12 '23 14:11 sander1988

@jm-73 - Please wait with merging. I see some 403 errors again over the last few hours. I expect to have some time to debug this next weekend.

sander1988 avatar Nov 13 '23 18:11 sander1988

Thanks in advance

Larnak23 avatar Nov 13 '23 19:11 Larnak23

I'm a little bit afraiding about similar vendor bans will come for reverse engineered unpublished api usages :( https://www.home-assistant.io/blog/2023/11/06/removal-of-myq-integration/

sipossz avatar Nov 13 '23 20:11 sipossz

I'm a little bit afraiding about similar vendor bans will come for reverse engineered unpublished api usages :(

https://www.home-assistant.io/blog/2023/11/06/removal-of-myq-integration/

Possible, but I don't think that's case here...

  • The way it's (temporary) blocked feels more like some autonomous feature in the Microsoft WAF.
  • The user-agent header is identifiable on purpose. So I would expect them to have contacted us if they have questions/concerns.
  • Bosch has several developer programs for IOT devices and encourage developers to use them. So it wouldn't make really sense to block the people using them.

sander1988 avatar Nov 13 '23 21:11 sander1988

I've applied the patch and still got a 403. When I replaced "HomeAssistant" by "Test" in the user agent string, adding my mower worked. Might be a coincidence, might very well not be...

sid3windr avatar Nov 19 '23 01:11 sid3windr

Hi any news

Larnak23 avatar Nov 19 '23 18:11 Larnak23

Hi any news

  • Changing the user agent (again) still seems to work. Like @sid3windr said, a small change like "test" can be enough.
  • I have also changed to user agent again a couple of days back and enabled debug logs. Still works fine here.
  • I did enable the debug logs to be 100% sure there isn't some kind of bug in the integration that could trigger loop making high volume API calls or some thing like that. As that's the only reason I can think of resulting in a 403. But everything works as expected.

At this point I'm look for a way to create a fix, but I don't want to just change the user agent again and see it blocked once more within a couple of days.

Maybe let the user choose the user agent during integration setup? Maybe a bit complex for non-technical users, but the best I can think of.

Any other ideas?

sander1988 avatar Nov 19 '23 19:11 sander1988

I am getting this error message:

Screenshot 2023-11-20 at 00 30 39

Is it related to this issue?

NissarAK84 avatar Nov 19 '23 23:11 NissarAK84

I am getting 403s now, even after my user agent change to Test/Indego 3 days ago.

I did not have any issues with the OpenHAB binding for Indego, is the HA integration more agressive requesting status updates? (OH version has lower refresh, then when the mower is detected to be mowing, it has a different refresh, for example).

sid3windr avatar Nov 21 '23 17:11 sid3windr

is the HA integration more agressive requesting status updates?

I don't think so. I have checked the code, this is what I see:

  • State update every 5 minutes and instant when state changes by using a longpoll. Same way as the app works.
  • Generic info every 10 minutes
  • Alerts every 10 minutes
  • Last completed mow every 10 minutes
  • Next mow every 10 minutes
  • Updates available every 24 hours

= 865 requests a day when the mower is idle. Not that much.

And I don't think this is the issue. You would a expect the API to return status code 429 instead of a 403 when this is the issue.

sander1988 avatar Nov 21 '23 20:11 sander1988

I am getting this error message:

Screenshot 2023-11-20 at 00 30 39

Is it related to this issue?

It might. Check the logs for a 403 error to be sure (see description of this issue for an example).

sander1988 avatar Nov 21 '23 20:11 sander1988

And I don't think this is the issue. You would a expect the API to return status code 429 instead of a 403 when this is the issue.

You would. And I've seen 429 when using OpenHAB with more aggressive timing + the Android app at the same time. But something is tripping up the WAF or Bosch themselves leading to these blocks.... (Indeed the above timings look perfectly normal to me..)

sid3windr avatar Nov 21 '23 20:11 sid3windr

The Azure WAF (the Bosch API runs on Azure) was blocking our user-agent for unknown reasons. Similar issue as #119.

I have changed the user-agent to be unique for each HA instance. Now the 403 issue is gone. I have 2 PR containing the changes.

Sorry for what might be a basic question, but how do I try the patch that you suggested? I have installed the Indego integration via HACS and see the 'Indego' repository files on my HA machine, but not the pyIndego files in which you made changes.

Thanks in advance.

35aportal avatar Nov 22 '23 11:11 35aportal