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
On Wednesday, September 30, 2020 at 9:09:58 AM UTC-6 [email protected] wrote:
> 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
>
> On Wed, Sep 30, 2020 at 8:02 AM Tom Quinn <[email protected]> wrote:
>
>> 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?
>> https://github.com/nose-devs/nose/issues/733
>>
>> On Wednesday, September 30, 2020 at 8:58:31 AM UTC-6 [email protected]
>> wrote:
>>
>>> 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
>>>
>>> On Wed, Sep 30, 2020 at 6:57 AM Tom Quinn <[email protected]> wrote:
>>>
>>>> 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!)
>>>>
>>>> On Wednesday, September 30, 2020 at 5:48:16 AM UTC-6 [email protected]
>>>> wrote:
>>>>
>>>>> The format specifier %(asctime)s is supplied by the Python library,
>>>>> not WeeWX. Documentation
>>>>> <https://docs.python.org/3/library/logging.html#logrecord-attributes>
>>>>> .
>>>>>
>>>>> 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...?
>>>>>
>>>>> On Tue, Sep 29, 2020 at 7:52 PM Tom Quinn <[email protected]> wrote:
>>>>>
>>>>>> 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.
>>>>>>
>>>>>> On Tue, Sep 29, 2020 at 19:31 Tom Keffer <[email protected]> wrote:
>>>>>>
>>>>>>> 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
>>>>>>>
>>>>>>> On Tue, Sep 29, 2020 at 12:31 PM Tom Quinn <[email protected]> wrote:
>>>>>>>
>>>>>>>> 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!
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> 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 [email protected].
>>>>>>>>
>>>>>>>>
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/weewx-user/dd79c7f4-df93-4116-a693-8de6d720f825n%40googlegroups.com
>>>>>>>>
>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/dd79c7f4-df93-4116-a693-8de6d720f825n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>>
>>>>>>> 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
>>>>>>> [email protected].
>>>>>>>
>>>>>>>
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zECaHT9egDROde%3DaHkhQJ7LUq0XmOGC1epL_DpYuLpCTCg%40mail.gmail.com
>>>>>>>
>>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zECaHT9egDROde%3DaHkhQJ7LUq0XmOGC1epL_DpYuLpCTCg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>> ------------------------------------
>>>>>> Tom Quinn
>>>>>>
>>>>>> --
>>>>>> 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 [email protected].
>>>>>>
>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/weewx-user/CAOemRRG%2Bs%2BC%2BjAuXeQxmr-i8W8siTnY-iUPHH53ipdP2R8Spig%40mail.gmail.com
>>>>>>
>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAOemRRG%2Bs%2BC%2BjAuXeQxmr-i8W8siTnY-iUPHH53ipdP2R8Spig%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>> 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 [email protected].
>>>>
>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/weewx-user/be1c1759-8463-4738-99bd-e640e0a1fc6dn%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/weewx-user/be1c1759-8463-4738-99bd-e640e0a1fc6dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> 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 [email protected].
>>
> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/ab83d074-1bd5-440d-bdae-9f49713cdff1n%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/weewx-user/ab83d074-1bd5-440d-bdae-9f49713cdff1n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/13d5a8df-719f-48ef-8d41-ce1cb89a3f22n%40googlegroups.com.