CRITICAL __main__: **** must be real number, not NoneType OR CRITICAL __main__:*** %x formatpe or : an integer is required, not float

75 views
Skip to first unread message

Co van der lee

unread,
Jan 2, 2021, 8:47:10 AM1/2/21
to weewx...@googlegroups.com

Hi all,

 

Ik hope someone can help me to automate errorhandling……….

 

The Rpi with SDR (weewx 4.2 / Mysql / apache) runs well, at inexplicable moments the loop is interrupted, see parts op the logfile.

 

the weewx.service remains active only sub-processes have been stopped. a /etc/init.d./weewx restart reactivate the loop until the next error.

 

Question: my idea is a workaround, does anyone know how I can read out the last 6 minutes of / var / log / syslog using a cron job (or script) and if a text CRITICAL __main occurs that /etc/init.d./weewx restart will be executed.

 

or is there an easier way for a workaround.

or will it cause other problems in the long term?

 

Thnx a lot, in the meantime I'm going to consider a reinstall on another Rpi ....

 

(29-12-202) @7:50 

·         weewx.engine: Main loop exiting. Shutting engine down.

·         weewx.engine: Shutting down StdReport thread

·         user.rtldavis: shutdown process /home/pi/work/bin/rtldavis -ex 200 -tf EU -tr 1

·         user.rtldavis: rtldavis with pid 1166 killed

·         CRITICAL __main__: Caught unrecoverable exception:

·         CRITICAL __main__:     ****  must be real number, not NoneType

 

earlier error (27-11-2020)

·         CRITICAL __main__:     ****  %x format: an integer is required, not float

 

 

 

 

 

LOGFILES -> ---------------------------------------------------

 

Dec 29 02:05:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 02:05:00 CET (1609203900) to database 'weewx'

Dec 29 02:05:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 02:05:00 CET (1609203900) to daily summary in 'weewx'

Dec 29 02:10:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 02:10:00 CET (1609204200) to database 'weewx'

Dec 29 02:10:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 02:10:00 CET (1609204200) to daily summary in 'weewx'

Dec 29 02:10:16 wsb-meteo weewx[1162] INFO weewx.engine: Garbage collected 21556 objects in 0.09 seconds

Dec 29 02:15:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 02:15:00 CET (1609204500) to database 'weewx'

Dec 29 02:15:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 02:15:00 CET (1609204500) to daily summary in 'weewx'

----------------------    loop still runs well ------------------------------

Dec 29 07:45:16 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 07:45:00 CET (1609224300) to database 'weewx'

Dec 29 07:45:17 wsb-meteo weewx[1162] INFO weewx.manager: Added record 2020-12-29 07:45:00 CET (1609224300) to daily summary in 'weewx'

 

Error started

 

Dec 29 07:50:16 wsb-meteo weewx[1162] INFO weewx.engine: Main loop exiting. Shutting engine down.

Dec 29 07:50:16 wsb-meteo weewx[1162] INFO weewx.engine: Shutting down StdReport thread

Dec 29 07:50:16 wsb-meteo weewx[1162] INFO user.rtldavis: shutdown process /home/pi/work/bin/rtldavis -ex 200 -tf EU -tr 1

Dec 29 07:50:16 wsb-meteo weewx[1162] INFO user.rtldavis: rtldavis with pid 1166 killed

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__: Caught unrecoverable exception:

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  must be real number, not NoneType

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  Traceback (most recent call last):

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 210, in run

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.CHECK_LOOP, packet=packet))

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 241, in dispatchEvent

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      callback(event)

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 630, in check_loop

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      raise BreakLoop

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  weewx.engine.BreakLoop

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     **** 

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     **** 

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  Traceback (most recent call last):

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 646, in post_loop

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      self._catchup(self.engine.console.genArchiveRecords)

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 690, in _catchup

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      for record in generator(lastgood_ts):

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/drivers/__init__.py", line 30, in genArchiveRecords

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      raise NotImplementedError("Method 'genArchiveRecords' not implemented")

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  NotImplementedError: Method 'genArchiveRecords' not implemented

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     **** 

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     **** 

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  Traceback (most recent call last):

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "./bin/weewxd", line 154, in main

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 217, in run

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      self.dispatchEvent(weewx.Event(weewx.POST_LOOP))

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 241, in dispatchEvent

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      callback(event)

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 648, in post_loop

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      self._software_catchup()

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 710, in _software_catchup

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      origin='software'))

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 241, in dispatchEvent

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      callback(event)

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 949, in new_archive_record

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      self._update_summaries()  # calculate summaries

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 938, in _update_summaries

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****      (total_max_count, total_count, total_missed, self.stats['pct_good_all']))

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  TypeError: must be real number, not NoneType

Dec 29 07:50:16 wsb-meteo weewx[1162] CRITICAL __main__:     ****  Exiting.

 

 

Earlier error:

 

Nov 27 00:35:22 wsb-meteo weewx[2352] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html

Nov 27 00:40:17 wsb-meteo weewx[2352] INFO weewx.manager: Added record 2020-11-27 00:40:00 CET (1606434000) to database 'weewx'

Nov 27 00:40:17 wsb-meteo weewx[2352] INFO weewx.manager: Added record 2020-11-27 00:40:00 CET (1606434000) to daily summary in 'weewx'

Nov 27 00:40:17 wsb-meteo weewx[2352] INFO weewx.restx: WindGuru: Published record 2020-11-27 00:40:00 CET (1606434000)

Nov 27 00:40:17 wsb-meteo weewx[2352] INFO weewx.restx: Windy: Published record 2020-11-27 00:40:00 CET (1606434000)

Nov 27 00:40:20 wsb-meteo weewx[2352] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 2.97 seconds

Nov 27 00:40:21 wsb-meteo weewx[2352] INFO weewx.imagegenerator: Generated 15 images for report SeasonsReport in 1.52 seconds

Nov 27 00:40:21 wsb-meteo weewx[2352] INFO weewx.reportengine: Copied 0 files to /home/weewx/public_html

Nov 27 00:44:02 wsb-meteo weewx[2352] INFO weewx.engine: Main loop exiting. Shutting engine down.

Nov 27 00:44:02 wsb-meteo weewx[2352] INFO weewx.engine: Shutting down StdReport thread

Nov 27 00:44:02 wsb-meteo weewx[2352] INFO user.rtldavis: shutdown process /home/pi/work/bin/rtldavis -ex 200 -tf EU -tr 1

Nov 27 00:44:02 wsb-meteo weewx[2352] INFO user.rtldavis: rtldavis with pid 2358 killed

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__: Caught unrecoverable exception:

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****  %x format: an integer is required, not float

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****  Traceback (most recent call last):

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "./bin/weewxd", line 154, in main

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 203, in run

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****      for packet in self.console.genLoopPackets():

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 995, in genLoopPackets

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****      for data in PacketFactory.create(self, lines):

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 616, in create

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****      pkt = PacketFactory.parse_text(self, lines)

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 628, in parse_text

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****      pkt = parser.parse_text(self, payload, lines)

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 529, in parse_text

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****      pkt = self.parse_raw(self, raw_pkt)

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****    File "/home/weewx/bin/user/rtldavis.py", line 1200, in parse_raw

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****      % (temp_raw, temp_c))

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****  TypeError: %x format: an integer is required, not float

Nov 27 00:44:02 wsb-meteo weewx[2352] CRITICAL __main__:     ****  Exiting.

Tom Keffer

unread,
Jan 2, 2021, 9:30:59 AM1/2/21
to weewx-user
These are both simple errors in the driver rtldavis. Ask the driver's author to fix the problem. 

--
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/CABQzV8ztcp37LWirGbRXcv9R5E6L2juQ%2BRb83_1%2B-%2BATviDxbg%40mail.gmail.com.

Co van der lee

unread,
Jan 2, 2021, 10:19:25 AM1/2/21
to weewx...@googlegroups.com
Thanks for your quick response Tom, I posted it on lheist's Git. I hope he can fix it? 
The crazy thing is the spontaneous occurrence, every 5 minutes the loop runs, some days without error and then suddenly this happend ....

As a workaround for the time to fix .....
- appear there other errors if i restart the weewx.server each hour preventive? technicly possible with Cron.
- do you have an idea to automate when this occours (if message is CRITICAL than ......) at script / tool? (read last 6 min. from syslog for CRITICAL sign)

thanks! And keep up the good work! compliments for your work!

Op za 2 jan. 2021 om 15:30 schreef Tom Keffer <tke...@gmail.com>:

Luc Heijst

unread,
Jan 2, 2021, 11:22:08 AM1/2/21
to weewx-user
The errors are fixed in version 0.20

these are the changes:
line 935
            if total_max_count > 0:
            if total_max_count > 0 and self.stats['pct_good_all'] is not None:
line 941
                if self.stats['curr_cnt'][i] > 0 and self.stats['count'][i] > 0:
                if self.stats['curr_cnt'][i] > 0 and self.stats['count'][i] > 0 and self.stats['pct_good'] is not None:

line 1199
                        dbg_parse(2, "thermistor temp_raw=0x%03x temp_c=%s"
                        dbg_parse(2, "thermistor temp_raw=%s temp_c=%s"

Op zaterdag 2 januari 2021 om 10:47:10 UTC-3 schreef covan...@gmail.com:

Luc Heijst

unread,
Jan 2, 2021, 11:38:42 AM1/2/21
to weewx-user
Hi Co,

The error on line 938 occurs when no single message is received from the Davis station during an archive interval (typical 5 minutes).
The error on line 1200 occurs when data is reveived from an analog temperature sensor. The 12-bit raw data is converted to 10 bits causing the integer type to be changed to a float.
(This type of sensor is seldom used with Davis stations.)

Luc

Op zaterdag 2 januari 2021 om 10:47:10 UTC-3 schreef covan...@gmail.com:

Hi all,

Co van der lee

unread,
Jan 2, 2021, 3:47:36 PM1/2/21
to weewx...@googlegroups.com
Hi Luc,
Thanks a lot for your quick action, great! I found v0.20, brand new :)
I will update the driver with the following commands on the Rpi

is this the procedure or do I miss something? 

For this update I need to go to the lake (Setup with 4g mobile connection) no remote management.

i will report the results.

Compliments for your work to make 868Mhz SDR communication possible and thanks again!

/Co


Op za 2 jan. 2021 om 17:38 schreef Luc Heijst <ljm.h...@gmail.com>:
--
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.
Reply all
Reply to author
Forward
0 new messages