Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[netatmo] Binding does not reconnect after connection loss #4270

Closed
gletellier opened this issue Nov 23, 2018 · 8 comments · Fixed by #8127
Closed

[netatmo] Binding does not reconnect after connection loss #4270

gletellier opened this issue Nov 23, 2018 · 8 comments · Fixed by #8127
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@gletellier
Copy link

This issues is discussed in the forum here : https://community.openhab.org/t/no-update-of-netatmo-items/57576/13

Context

There has been a lot of connectivity errors on netatmo's side recently.
These connectivity problems are logged as :
2018-11-22 21:49:37.404 [ERROR] [nternal.handler.NetatmoBridgeHandler] - Unable to connect Netatmo API : 502 Bad Gateway" in openhab logs.

The problem is that when the Netatmos server are back online, the binding does not update sensors values.

Just restarting the container does not restore the connection. Deleting and re-creating the container is necessary to have the binding work again.

Your Environment

Openhab 2.4.0.M6 running in docker (amd64-debian)

@Clifford-Foster
Copy link

Seems as if the binding doesn't request a refresh token either.

@tzweistein
Copy link

Hi,
I have same issue.
Checking on Netatmo Forum I found they changed the API, so maybe the OH2.3 Netatmo binding need some update (out of my range)?
https://forum.netatmo.com/viewtopic.php?f=5&t=6912

@wborn wborn changed the title [NetAtmo] Binding does not reconnect after connection loss [netatmo] Binding does not reconnect after connection loss Dec 15, 2018
@davidgraeff davidgraeff added the bug An unexpected problem or unintended behavior of an add-on label Mar 18, 2019
@lolodomo
Copy link
Contributor

lolodomo commented Jul 14, 2020

This issue is now very old, I am not sure whether I already encountered it myself.
@clinique @Novanic : do you think the code is clean and handle reconnecting properly ?
If yes, we can close this issue.

@lolodomo
Copy link
Contributor

@gletellier : do you still encounter this problem with recent versions of the binding ?

@Novanic
Copy link
Contributor

Novanic commented Jul 14, 2020

I have never noticed this problem. But I have only a Presence camera where missing status updates aren't notable.

Actually I can't imagine that it still occurs, because the binding refreshes everything about every 5 minutes. But on the otherside it could be that the whole binding crashed so that there aren't any reconnect attempts.

Maybe someone could try to simulate / force reproduce it by using something like WireMock or by disconnecting the internet connection.

@clinique
Copy link
Contributor

I often see also Bad gateway errors around 00AM and 02AM but it does not seem to affect the binding.

@lolodomo
Copy link
Contributor

I see the refresh token job is run every 90 minutes (by default). The only case that could lead to this job not being rescheduled would be an uncaught exception in scheduleTokenInitAndRefresh. Only RetrofitError exception is currently caught. Are we sure that this is the only possible exception that could be thrown by this code:

                initializeApiClient();
                getPartnerApi().partnerdevices();
                connectionSucceed();

Maybe we could make safer the code by catching Exception in addition to RetrofitError to be sure that the job will not stop to be rescheduled due to an exception other than RetrofitError ?

@lolodomo
Copy link
Contributor

lolodomo commented Jul 14, 2020

I don't know in practice if getPartnerApi() could return null in particular circunstances ? If true, this could lead to a NPE not caught and the job stopping being rescheduled.

When adding null annotations, I didn't manage this case, probably because I didn't know what should be done in case it occurs.

@clinique ?

lolodomo added a commit to lolodomo/openhab-addons that referenced this issue Jul 14, 2020
Fix openhab#4270

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
J-N-K pushed a commit that referenced this issue Jul 20, 2020
Fixes #4270

* [netatmo] Make safe the execution of the refresh token job
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this issue Jul 26, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job

Signed-off-by: CSchlipp <christian@schlipp.de>
MPH80 pushed a commit to MPH80/openhab-addons that referenced this issue Aug 3, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job

Signed-off-by: MPH80 <michael@hazelden.me>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this issue Aug 31, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this issue Sep 1, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job

Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Sep 19, 2020
)

Fixes openhab#4270

* [netatmo] Make safe the execution of the refresh token job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants