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

Crash on request time out #32

Closed
r748 opened this issue Apr 8, 2021 · 5 comments
Closed

Crash on request time out #32

r748 opened this issue Apr 8, 2021 · 5 comments

Comments

@r748
Copy link

r748 commented Apr 8, 2021

Hi and thanks for this adapter!

I've had the following issue multiple times now: The adapter crashes with

error: swiss-weather-api.0 (14348) uncaught exception: getaddrinfo ENOTFOUND api.srgssr.ch
error: swiss-weather-api.0 (14348) Error: getaddrinfo ENOTFOUND api.srgssr.ch at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26)
error: swiss-weather-api.0 (14348) Exception-Code: ENOTFOUND: getaddrinfo ENOTFOUND api.srgssr.ch
debug: swiss-weather-api.0 (14348) cleaned everything up...
info: swiss-weather-api.0 (14348) terminating
error: host.XXXXX.local instance system.adapter.swiss-weather-api.0 terminated with code 6 (UNCAUGHT_EXCEPTION)

Then restart ist initiated

info: host.HOMESERVER.local Restart adapter system.adapter.swiss-weather-api.0 because enabled

but then cancelled immediately afterwards

warn: host.XXXXX.local Do not restart adapter system.adapter.swiss-weather-api.0 because restart loop detected

Could you please fix the adapter to handle the encountered exception?

Thanks,
Rob

@baerengraben
Copy link
Owner

Hi Rob

Here ioBroker seems not to be able to do the DNS resolution. This is strange. "api.srgssr.ch" has never been unreachable for me.
Does this problem exist permanently or only irregularly?

Otherwise I will catch this exception in a next version.

Greetings
Ralph

@r748
Copy link
Author

r748 commented Apr 17, 2021

Hey Ralph

This issue occurs irregularly. As far as I can tell from the logs, it happens mainly during the night, so it might have something to do with my internet reconnecting or so...

I have fixed this temporarily for myself, with a little script which checks system.adapter.swiss-weather-api.0.alive at a regular interval. In case the data point returns false the script restarts the adapter. But in my opinion it would be better if the adapter would catch the exception, so the crash could be avoided in the first place.

Thanks!
Rob

@baerengraben
Copy link
Owner

Hi Rob

But in my opinion it would be better if the adapter would catch the exception, so the crash could be avoided in the first place.

Yes, that's definitely true. I will take that into account in a next release. Thanks for reporting this!

@r748
Copy link
Author

r748 commented Apr 19, 2021

Great, thanks Ralph!!

@baerengraben
Copy link
Owner

resolved with release 0.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants