Trying to configure the logging to be non-privileged

139 views
Skip to first unread message

David Barto

unread,
Aug 27, 2023, 3:30:03 PM8/27/23
to weewx...@googlegroups.com
Following the instructions found in http://weewx.com/docs.html/latest/macos.htm under Logging, I added (copy/pasted) the alternative to log to /var/tmp/weewx.log and get this error when starting up.

Is it not possible to log to an alternative location?

David

Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 565, in configure
handler = self.configure_handler(handlers[name])
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 723, in configure_handler
klass = self.resolve(cname)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 383, in resolve
name = s.split('.')
AttributeError: 'NoneType' object has no attribute 'split'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/Shared/weewx/bin/weewxd", line 249, in <module>
main()
File "/Users/Shared/weewx/bin/weewxd", line 98, in main
weeutil.logger.setup(options.log_label, config_dict)
File "/Users/Shared/weewx-4.10.2/bin/weeutil/logger.py", line 139, in setup
logging.config.dictConfig(log_dict)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 811, in dictConfig
dictConfigClass(config).configure()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/config.py", line 572, in configure
raise ValueError('Unable to configure handler '
ValueError: Unable to configure handler 'rotate'


Never ascribe to malice that which is adequately explained by incompetence
--Napoleon Bonaparte
David Barto
ba...@kdbarto.org


Tom Keffer

unread,
Aug 27, 2023, 6:52:01 PM8/27/23
to weewx...@googlegroups.com
Which version of WeeWX? It's possible your version of WeeWX does not have a rotating logger defined for the Mac.

Try following the instructions in the wiki article Logging to rotating files



--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/E5347A3B-8C00-488A-A3A6-314148758F7C%40kdbarto.org.

David Barto

unread,
Aug 28, 2023, 1:24:24 PM8/28/23
to weewx...@googlegroups.com

On Aug 27, 2023, at 3:51 PM, Tom Keffer <tke...@gmail.com> wrote:

Which version of WeeWX? It's possible your version of WeeWX does not have a rotating logger defined for the Mac.

Try following the instructions in the wiki article Logging to rotating files



Version 4.10.2, and the link you provided works perfectly. Now running and logging to non-root directory.

Yet even with the upgrade to 4.10.2 and to macOS Monterey (12.6.7) I’ve still got the stupid certificate error for posting to PWSweather and getting Forecasts from the NWS and WU:

2023-08-28 10:13:16  weewx[31551] DEBUG weewx.restx: PWSWeather: Failed upload attempt 1: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1007)>

2023-08-28 10:13:16  weewx[31551] ERROR user.forecast: WUThread: WU: failed attempt 1 to download forecast: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1007)>

2023-08-28 10:13:16  weewx[31551] DEBUG weewx.restx: StationRegistry: Failed upload attempt 1: HTTP Error 429: TOO MANY REQUESTS

2023-08-28 10:13:16  weewx[31551] ERROR user.forecast: NWSThread: NWS: failed attempt 1 to download NWS forecast: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1007)>

2023-08-28 10:13:16  weewx[31551] ERROR user.forecast: WUThread: WU: failed attempt 2 to download forecast: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:1007)>

2


It doesn’t tell me the certificate that is out of date however.


So two things:


1 - the document http://weewx.com/docs.html/latest/macos.htm needs to be updated to redirect the logging information to the wiki article https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging#logging-to-rotating-files


2 - How would I figure out which certificate is out of date and needs update for the forecast and PWS updates?


David


Do the right thing. It will gratify some people and astonish the rest.
        --Mark Twain.
David Barto
ba...@kdbarto.org





vince

unread,
Aug 28, 2023, 2:54:01 PM8/28/23
to weewx-user
For (2) I'd open the URLs weewx uses in a browser and click the 'lock' icon and see what a browser says.  Works in either Safari or Chrome.

For forecast, you'd need to look in that extension's code to see what it's using.

ba...@kdbarto.org

unread,
Aug 28, 2023, 3:05:14 PM8/28/23
to weewx-user
https://stackoverflow.com/questions/44649449/brew-installation-of-python-3-6-1-ssl-certificate-verify-failed-certificate/44649450#44649450

After installing the certificates as noted here, PWS is updating, WU forecasts are working, etc. etc.

This may be something to add to the documentation for Mac users when installing python.
Along with the logging changes from the wiki, https://github.com/weewx/weewx/wiki/WeeWX-v4-and-logging#logging-to-rotating-files everything works as a non-privileged user.

My path to a new Mac (12.6.6) with a fully updated Weewx (4.10.2) and the forecast extension update is complete.

Thanks for all the assistance, and the work of those who make this the best weather system in the world.

    David
Reply all
Reply to author
Forward
0 new messages