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

Brief connectivity interruption causes Weewx exit #2

Open
hikeonpast opened this issue Jun 22, 2022 · 1 comment
Open

Brief connectivity interruption causes Weewx exit #2

hikeonpast opened this issue Jun 22, 2022 · 1 comment

Comments

@hikeonpast
Copy link

hikeonpast commented Jun 22, 2022

It appears that socket errors (such as would be experienced when rebooting an attached switch or briefly unplugging an Ethernet cable) cause weatherflow-udp to throw errors that aren't handled gracefully by WeeWx, resulting in an immediate process exit.

Given that WeeWx is typically operated in home environments, where internet/network connectivity can be intermittent, most folks don't run WeeWx under a supervisor that will restart it automatically, and most folks don't have process monitoring/alerting configured to catch an unexpected exit, gracefully handling connectivity issues seems highly desirable over a panic (silent) exit.

`Apr 25 13:28:36 pooppi weewx[450] INFO user.weatherflowudp: driver version is 1.13

Apr 25 13:28:36 pooppi weewx[450] ERROR weewx.engine: Import of driver failed: HTTPSConnectionPool(host='swd.weatherflow.com', port=443): Max retries exceeded with url: /swd/rest/stations?token= (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x75e361a8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')
) (<class 'requests.exceptions.ConnectionError'>)

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** Traceback (most recent call last):

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** conn = connection.create_connection(

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** for res in _socket.getaddrinfo(host, port, family, type, proto, flags):

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** socket.gaierror: [Errno -3] Temporary failure in name resolution

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: ****

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: **** During handling of the above exception, another exception occurred:

Apr 25 13:28:36 pooppi weewx[450] CRITICAL weewx.engine: ****
`

@jjvdgeer
Copy link
Owner

jjvdgeer commented Jan 9, 2023

Sorry, I just recently became aware of this and another issue having been registered here. As far as I can see I wasn't notified for them. Maybe they ended up in the spam or maybe I should look into some settings...

Anyway, regarding the issue you reported. The URL noted is one that should only be called while starting. As the driver needs to check the environment, what devices you have and stuff like that, it really needs to do that in order to start up. After that's done it will fetch observations, but again, this should only happen in startup. After it has successfully started, it will go over to UDP and there should not be a problem. I think it is OK to require the internet to be functional when weewx starts up.

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