weewxctl debug error

63 views
Skip to first unread message

Chris Eidem

unread,
Apr 6, 2024, 4:14:43 PM4/6/24
to weewx-user
I'm trying to find out why rsync isn't sending to my web server and while attempting to debug that, i tried running 'weewxctl debug' and got the following output:

[weewx@rocky1 ~]$ weectl debug
Using configuration file /etc/weewx/weewx.conf
Traceback (most recent call last):
  File "/usr/share/weewx/weectl.py", line 74, in <module>
    main()
  File "/usr/share/weewx/weectl.py", line 66, in main
    namespace.func(namespace)
  File "/usr/share/weewx/weectllib/__init__.py", line 121, in dispatch
    namespace.action_func(config_dict, namespace)
  File "/usr/share/weewx/weectllib/debug_cmd.py", line 54, in debug
    weectllib.debug_actions.debug(config_dict, output=namespace.output)
  File "/usr/share/weewx/weectllib/debug_actions.py", line 52, in debug
    sink = contextlib.nullcontext(sys.stdout)
AttributeError: module 'contextlib' has no attribute 'nullcontext'
[weewx@rocky1 ~]$

The /var/log/messages that showed up at the time:

Apr  6 15:08:38 rocky1 weectl[17297]: INFO weectllib: Initializing weectl version 5.0.2
Apr  6 15:08:38 rocky1 weectl[17297]: INFO weectllib: Command line: /usr/share/weewx/weectl.py debug

I have no clue why it's failing. This is from an upgraded weewx on a Rocky Linux server.

Tom Keffer

unread,
Apr 6, 2024, 4:38:33 PM4/6/24
to weewx...@googlegroups.com
What version of Python are you using? The nullcontext requires v3.7 or greater (which breaks our supposed claim of supporting v3.6 or later).

If you are using v3.6, you can specify an explicit path and get the results you need:

weectl debug --output=/tmp/debug.txt




--
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/235d7bad-0802-4ccf-be89-d3029b8f4308n%40googlegroups.com.

Chris Eidem

unread,
Apr 6, 2024, 4:56:33 PM4/6/24
to weewx-user
That was the issue - running 3.6:

[weewx@rocky1 ~]$ python --version
Python 3.6.8

[weewx@rocky1 ~]$ weectl debug --output=/tmp/debug.txt
Using configuration file /etc/weewx/weewx.conf

Thank you for the solution,
 - chris
Reply all
Reply to author
Forward
0 new messages