Logging Modifications in weewx.conf

141 views
Skip to first unread message

Tom Quinn

unread,
Sep 29, 2020, 3:31:12 PM9/29/20
to weewx-user
Hello,
I've put the below into my weewx.conf file to modify the logging since I'm running this in a docker container:

[Logging]
    # Root logger
    [[root]]
      handlers = rotate,                    # 1
    [[loggers]]
        [[[weewx.restx]]]
            level = WARNING
    [[handlers]]
        # Log to a set of rotating files    
        [[[rotate]]]
            level = DEBUG                   # 2
            formatter = standard            # 3
            class = logging.handlers.RotatingFileHandler  # 4
            filename = /home/weewx/bin/user/weewx.log   # 5
            maxBytes = 5000000             # 6
            backupCount = 1                 # 7
    [[formatters]]
        [[[standard]]]
            format = "%(asctime)s {process_name}[%(process)d] %(levelname)s %(name)s: %(message)s" 


Everything works great! except, I get the following in the log when the archive runs:

2020-09-29 13:25:20,887 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-29 13:25:20,887 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-29 13:25:20,958 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-29 13:25:20,959 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-29 13:25:20,994 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-29 13:25:20,994 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-29 13:25:21,010 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-29 13:25:21,010 weewx[1] ERROR weewx.reportengine:    ****       Report ignored

Any thoughts on how to resolve that error? it seems to be misinterpreting the config options as something it should do something with....

Thanks!

Tom Keffer

unread,
Sep 29, 2020, 9:25:03 PM9/29/20
to weewx-user
Putting aside the wisdom of putting the log in the user subdirectory, this worked for me and results in log entries that look like:

2020-09-29 18:16:32,402 wee_reports[16734] DEBUG weewx.engine: Loading service weewx.restx.StdCWOP
2020-09-29 18:16:32,402 wee_reports[16734] DEBUG weewx.engine: Finished loading service weewx.restx.StdCWOP
2020-09-29 18:16:32,402 wee_reports[16734] DEBUG weewx.engine: Loading service weewx.restx.StdWOW
2020-09-29 18:16:32,402 wee_reports[16734] DEBUG weewx.engine: Finished loading service weewx.restx.StdWOW
2020-09-29 18:16:32,402 wee_reports[16734] DEBUG weewx.engine: Loading service weewx.restx.StdAWEKAS
2020-09-29 18:16:32,402 wee_reports[16734] DEBUG weewx.engine: Finished loading service weewx.restx.StdAWEKAS
etc.

What platform are you running on?

-tk

--
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/dd79c7f4-df93-4116-a693-8de6d720f825n%40googlegroups.com.

Tom Quinn

unread,
Sep 29, 2020, 10:52:34 PM9/29/20
to weewx...@googlegroups.com
I’m on Alpine Linux inside a docker container... the reason the log goes in the user directory is because syslog  doesn’t work properly in python 3 under alpine... for some reason that’s  beyond my ability to fix...

Everything works fine if I remove the format deceleration... but if it’s there, the archive process never seems to complete successfully. 

You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.


To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/qpIkYTTegwo/unsubscribe.


To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zECaHT9egDROde%3DaHkhQJ7LUq0XmOGC1epL_DpYuLpCTCg%40mail.gmail.com.


--
------------------------------------
Tom Quinn

Tom Keffer

unread,
Sep 30, 2020, 7:48:16 AM9/30/20
to weewx-user
The format specifier %(asctime)s is supplied by the Python library, not WeeWX. Documentation

Looks like there's a bug in either your copy of the library, or in the OS. I don't know what version of Python you are using, but perhaps you could upgrade to a later version...?

Tom Quinn

unread,
Sep 30, 2020, 9:57:18 AM9/30/20
to weewx-user
I'm running Python 3.8.5.

I'm slightly confused though, because the format specifier %(asctime)s is doing exactly what it should.... 
it seems to me, that weewx.reportengine: Syntax error: missing option "asctime" in interpolation. would be the report engine trying to do something with a bit of weewx.conf that it shouldn't be... that's also the only thing that stops working (no reports are generated, but data is still logged and MQTT still operates) when I uncomment those 3 lines in my weewx.conf file.
am I wrong? (I totally could be!)

Tom Keffer

unread,
Sep 30, 2020, 10:58:31 AM9/30/20
to weewx-user
A bit of explanation of how logging works: each module in weewx uses a different 'logger.'  If you look at the top of reportengine.py, you'll see 

log = logging.getLogger(__name__)

This sets the logger for the module reportengine.py to __name__, or 'weewx.reportengine'. That's why the error is marked as weewx.reportengine. That's just who is making the log entry. It does not necessarily reflect where the error occurred.

The exception was actually raised deeper down the call stack. To see exactly where, we'd have to ask for a stack trace. The log entry is being made by weewx.reportengine because that's where the exception was caught.

The report engine runs in its own thread. It can crash, as it did, without bringing down the rest of WeeWX. That's why MQTT and the rest of the program continue to run.

-tk

Tom Quinn

unread,
Sep 30, 2020, 11:02:11 AM9/30/20
to weewx-user
What's the best way to get that stack trace? 

I did find this bug, not at all related to weewx, but is it possible that the config parser for the report engine is not pleased with that config syntax?

Tom Keffer

unread,
Sep 30, 2020, 11:09:58 AM9/30/20
to weewx-user
Try this simple patch:

diff --git a/bin/weewx/reportengine.py b/bin/weewx/reportengine.py
index c3b45977..c0ee375c 100644
--- a/bin/weewx/reportengine.py
+++ b/bin/weewx/reportengine.py
@@ -141,6 +141,7 @@ class StdReportEngine(threading.Thread):
                 skin_dict = self._build_skin_dict(report)
             except SyntaxError as e:
                 log.error("Syntax error: %s", e)
+                weeutil.logger.log_traceback(log.error, "        ****  ")
                 log.error("   ****       Report ignored")
                 continue
 
It just adds a call to weeutil.logger.log_traceback().

-tk

Tom Quinn

unread,
Sep 30, 2020, 11:32:48 AM9/30/20
to weewx-user
I stuck that line in there:

/home/weewx/bin/weewx # diff reportengine.py reportengine.py.bak                                                                   
--- reportengine.py                                                                                                                
+++ reportengine.py.bak                                                                                                            
@@ -142,7 +142,6 @@                                                                                                                
                 skin_dict = self._build_skin_dict(report)                                                                         
             except SyntaxError as e:                                                                                              
                 log.error("Syntax error: %s", e)                                                                                  
-                weeutil.logger.log_traceback(log.error, "        ****  ")                                                         
                 log.error("   ****       Report ignored")                                                                         
                 continue                                  

but it doesn't seem to be performing that activity.
2020-09-30 09:25:18,413 weewx[1] INFO weewx.manager: Added record 2020-09-30 09:25:00 MDT (1601479500) to daily summary in 'weewx.sdb'
2020-09-30 09:25:19,242 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:25:19,242 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:25:19,287 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:25:19,288 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:25:19,307 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:25:19,308 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:25:19,334 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:25:19,334 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:30:16,154 weewx[1] INFO weewx.manager: Added record 2020-09-30 09:30:00 MDT (1601479800) to database 'weewx.sdb'
2020-09-30 09:30:16,169 weewx[1] INFO weewx.manager: Added record 2020-09-30 09:30:00 MDT (1601479800) to daily summary in 'weewx.sdb'
2020-09-30 09:30:17,018 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:30:17,018 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:30:17,063 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:30:17,064 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:30:17,082 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:30:17,082 weewx[1] ERROR weewx.reportengine:    ****       Report ignored
2020-09-30 09:30:17,102 weewx[1] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 09:30:17,103 weewx[1] ERROR weewx.reportengine:    ****       Report ignored

vince

unread,
Sep 30, 2020, 2:24:32 PM9/30/20
to weewx-user
Have you confirmed your python isn't messed up ?

Perhaps try a simple test something like:

import time
print(time.localtime())
print(time.asctime(time.localtime()))



Tom Quinn

unread,
Sep 30, 2020, 2:50:45 PM9/30/20
to weewx-user
that seems to work just fine... I think. this looks like I think it should.

/home/weewx/bin/user # python timetest.py                                                                                          
time.struct_time(tm_year=2020, tm_mon=9, tm_mday=30, tm_hour=12, tm_min=49, tm_sec=35, tm_wday=2, tm_yday=274, tm_isdst=1)         
Wed Sep 30 12:49:35 2020                                                                                                           
/home/weewx/bin/user #                                                                                                             
/home/weewx/bin/user # cat timetest.py                                                                                             
import time                                                                                                                        
print(time.localtime())                                                                                                            
print(time.asctime(time.localtime()))
/home/weewx/bin/use

Tom Quinn

unread,
Sep 30, 2020, 3:35:30 PM9/30/20
to weewx-user
okay, I didn't have debug logging on, because it's bonkers chatty.... my apologies

Here's what I believe to be the entire stack trace for that call:

2020-09-30 13:29:01,824 wee_reports[22] ERROR weewx.reportengine: Syntax error: missing option "asctime" in interpolation.
2020-09-30 13:29:01,826 wee_reports[22] ERROR weewx.reportengine:         ****  Traceback (most recent call last):

2020-09-30 13:29:01,826 wee_reports[22] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 142, in run

2020-09-30 13:29:01,826 wee_reports[22] ERROR weewx.reportengine:         ****      skin_dict = self._build_skin_dict(report)

2020-09-30 13:29:01,826 wee_reports[22] ERROR weewx.reportengine:         ****    File "/home/weewx/bin/weewx/reportengine.py", line 249, in _build_skin_dict

2020-09-30 13:29:01,826 wee_reports[22] ERROR weewx.reportengine:         ****      merge_dict = copy.deepcopy(self.config_dict['StdReport']['Defaults'])

2020-09-30 13:29:01,827 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 172, in deepcopy

2020-09-30 13:29:01,827 wee_reports[22] ERROR weewx.reportengine:         ****      y = _reconstruct(x, memo, *rv)

2020-09-30 13:29:01,827 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 270, in _reconstruct

2020-09-30 13:29:01,827 wee_reports[22] ERROR weewx.reportengine:         ****      state = deepcopy(state, memo)

2020-09-30 13:29:01,827 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,827 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,828 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in _deepcopy_tuple

2020-09-30 13:29:01,828 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,828 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in <listcomp>

2020-09-30 13:29:01,828 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,828 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,828 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 230, in _deepcopy_dict

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****      y[deepcopy(key, memo)] = deepcopy(value, memo)

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 172, in deepcopy

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****      y = _reconstruct(x, memo, *rv)

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 270, in _reconstruct

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****      state = deepcopy(state, memo)

2020-09-30 13:29:01,829 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,830 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,830 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in _deepcopy_tuple

2020-09-30 13:29:01,830 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,830 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in <listcomp>

2020-09-30 13:29:01,830 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,830 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,831 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,831 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 230, in _deepcopy_dict

2020-09-30 13:29:01,831 wee_reports[22] ERROR weewx.reportengine:         ****      y[deepcopy(key, memo)] = deepcopy(value, memo)

2020-09-30 13:29:01,831 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 172, in deepcopy

2020-09-30 13:29:01,831 wee_reports[22] ERROR weewx.reportengine:         ****      y = _reconstruct(x, memo, *rv)

2020-09-30 13:29:01,831 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 270, in _reconstruct

2020-09-30 13:29:01,832 wee_reports[22] ERROR weewx.reportengine:         ****      state = deepcopy(state, memo)

2020-09-30 13:29:01,832 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,832 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,832 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in _deepcopy_tuple

2020-09-30 13:29:01,832 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,832 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in <listcomp>

2020-09-30 13:29:01,833 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,833 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,833 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,833 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 230, in _deepcopy_dict

2020-09-30 13:29:01,833 wee_reports[22] ERROR weewx.reportengine:         ****      y[deepcopy(key, memo)] = deepcopy(value, memo)

2020-09-30 13:29:01,833 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 172, in deepcopy

2020-09-30 13:29:01,834 wee_reports[22] ERROR weewx.reportengine:         ****      y = _reconstruct(x, memo, *rv)

2020-09-30 13:29:01,834 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 270, in _reconstruct

2020-09-30 13:29:01,834 wee_reports[22] ERROR weewx.reportengine:         ****      state = deepcopy(state, memo)

2020-09-30 13:29:01,834 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,834 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,835 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in _deepcopy_tuple

2020-09-30 13:29:01,836 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,836 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in <listcomp>

2020-09-30 13:29:01,836 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,836 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,836 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,836 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 230, in _deepcopy_dict

2020-09-30 13:29:01,837 wee_reports[22] ERROR weewx.reportengine:         ****      y[deepcopy(key, memo)] = deepcopy(value, memo)

2020-09-30 13:29:01,837 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 172, in deepcopy

2020-09-30 13:29:01,837 wee_reports[22] ERROR weewx.reportengine:         ****      y = _reconstruct(x, memo, *rv)

2020-09-30 13:29:01,837 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 270, in _reconstruct

2020-09-30 13:29:01,838 wee_reports[22] ERROR weewx.reportengine:         ****      state = deepcopy(state, memo)

2020-09-30 13:29:01,838 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,838 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,838 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in _deepcopy_tuple

2020-09-30 13:29:01,838 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,838 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in <listcomp>

2020-09-30 13:29:01,839 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,839 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,839 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,839 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 230, in _deepcopy_dict

2020-09-30 13:29:01,839 wee_reports[22] ERROR weewx.reportengine:         ****      y[deepcopy(key, memo)] = deepcopy(value, memo)

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 172, in deepcopy

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****      y = _reconstruct(x, memo, *rv)

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 270, in _reconstruct

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****      state = deepcopy(state, memo)

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,840 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in _deepcopy_tuple

2020-09-30 13:29:01,841 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,841 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 210, in <listcomp>

2020-09-30 13:29:01,841 wee_reports[22] ERROR weewx.reportengine:         ****      y = [deepcopy(a, memo) for a in x]

2020-09-30 13:29:01,841 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 146, in deepcopy

2020-09-30 13:29:01,841 wee_reports[22] ERROR weewx.reportengine:         ****      y = copier(x, memo)

2020-09-30 13:29:01,841 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 230, in _deepcopy_dict

2020-09-30 13:29:01,842 wee_reports[22] ERROR weewx.reportengine:         ****      y[deepcopy(key, memo)] = deepcopy(value, memo)

2020-09-30 13:29:01,842 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/copy.py", line 161, in deepcopy

2020-09-30 13:29:01,842 wee_reports[22] ERROR weewx.reportengine:         ****      rv = reductor(4)

2020-09-30 13:29:01,842 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 482, in __reduce__

2020-09-30 13:29:01,842 wee_reports[22] ERROR weewx.reportengine:         ****      state = (dict(self), self.__dict__)

2020-09-30 13:29:01,842 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 557, in __getitem__

2020-09-30 13:29:01,843 wee_reports[22] ERROR weewx.reportengine:         ****      return self._interpolate(key, val)

2020-09-30 13:29:01,843 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 549, in _interpolate

2020-09-30 13:29:01,843 wee_reports[22] ERROR weewx.reportengine:         ****      return engine.interpolate(key, value)

2020-09-30 13:29:01,843 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 352, in interpolate

2020-09-30 13:29:01,843 wee_reports[22] ERROR weewx.reportengine:         ****      value = recursive_interpolate(key, value, self.section, {})

2020-09-30 13:29:01,843 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 330, in recursive_interpolate

2020-09-30 13:29:01,844 wee_reports[22] ERROR weewx.reportengine:         ****      k, v, s = self._parse_match(match)

2020-09-30 13:29:01,844 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 417, in _parse_match

2020-09-30 13:29:01,844 wee_reports[22] ERROR weewx.reportengine:         ****      value, section = self._fetch(key)

2020-09-30 13:29:01,844 wee_reports[22] ERROR weewx.reportengine:         ****    File "/usr/local/lib/python3.8/site-packages/configobj.py", line 386, in _fetch

2020-09-30 13:29:01,844 wee_reports[22] ERROR weewx.reportengine:         ****      raise MissingInterpolationOption(key)

2020-09-30 13:29:01,844 wee_reports[22] ERROR weewx.reportengine:         ****    File "<string>", line None

2020-09-30 13:29:01,845 wee_reports[22] ERROR weewx.reportengine:         ****  configobj.MissingInterpolationOption: missing option "asctime" in interpolation.

2020-09-30 13:29:01,845 wee_reports[22] ERROR weewx.reportengine:    ****       Report ignored

vince

unread,
Sep 30, 2020, 5:47:50 PM9/30/20
to weewx-user
On Wednesday, September 30, 2020 at 11:50:45 AM UTC-7, Tom Quinn wrote:
that seems to work just fine... I think. this looks like I think it should.

/home/weewx/bin/user # python timetest.py                                                                                          


Can you verify 'python' there is python3 specifically ?

python -V

(just in case you have both python2 and python3 installed and your system default isn't the python you think weewx is running)

Tom Keffer

unread,
Sep 30, 2020, 6:03:26 PM9/30/20
to weewx-user
I have seen something like this before (issue #579).

The problem is being caused by the deep copying of a ConfigObj structure. ConfigObj tries to fill in the interpolations during the copy but, of course, 'asctime' is not available --- it's only available when logging something.

This was fixed, but not released yet. In the meantime, you have two choices:
  1. You can work around the problem by changing the values in weeutil/logger.py to what you need; or
  2. You can use the current (totally runable) version in GitHub.

-tk

--
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.

Tom Quinn

unread,
Oct 1, 2020, 11:10:20 AM10/1/20
to weewx-user
Awesome! thank you for that!
Reply all
Reply to author
Forward
0 new messages