Image Generator crash after update

99 views
Skip to first unread message

Liz Dodd

unread,
Jan 2, 2024, 2:56:33 PM1/2/24
to weewx-user
On 1/1/24 I updated my Debian server to trixie, finishing the update
about 1620.
My last images on my Weewx web page are dated 1/1/24 1700.

I found a few errors in my logs, and looked for previous posts
concerning these but didn't find anything that fixed my errors.

Weewx v4.10.2
Debian Testing "Trixie" kernel 6.5.0-5-amd64
Davis weather station

Personalised skin in use - made from the standard skin 'some time' back

Error in Image Generator reported as follows in logs
2024-01-03T06:10:17.266785+11:00 boronia weewx[1184] ERROR
weewx.reportengine: Caught unrecoverable exception in generator
'weewx.imagegenerator.ImageGenerator' 2024-01-03T06:10:17.266919+11:00
boronia weewx[1184] ERROR weewx.reportengine: **** type object
'ImageDraw' has no attribute 'textsize'
2024-01-03T06:10:17.267369+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** Traceback (most recent call last):
2024-01-03T06:10:17.267452+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weewx/reportengine.py", line 197, in run
2024-01-03T06:10:17.267580+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** obj.start()
2024-01-03T06:10:17.267720+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weewx/reportengine.py", line 385, in start
2024-01-03T06:10:17.267828+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** self.run()
2024-01-03T06:10:17.267917+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weewx/imagegenerator.py", line 42, in run
2024-01-03T06:10:17.268001+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** self.gen_images(self.gen_ts)
2024-01-03T06:10:17.268077+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weewx/imagegenerator.py", line 114, in gen_images
2024-01-03T06:10:17.268163+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** image = plot.render()
2024-01-03T06:10:17.268261+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** ^^^^^^^^^^^^^
2024-01-03T06:10:17.268348+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weeplot/genplot.py", line 212, in render
2024-01-03T06:10:17.268429+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** self._renderBottom(draw)
2024-01-03T06:10:17.268498+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weeplot/genplot.py", line 404, in _renderBottom
2024-01-03T06:10:17.268589+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** bottom_label_size =
draw.textsize(self.bottom_label, font=bottom_label_font)
2024-01-03T06:10:17.268667+11:00 boronia weewx[1184] ERROR
weewx.reportengine: ****
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024-01-03T06:10:17.268746+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** File
"/usr/share/weewx/weeplot/genplot.py", line 646, in textsize
2024-01-03T06:10:17.268827+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** return
ImageDraw.ImageDraw.textsize(self, string, **options)
2024-01-03T06:10:17.268912+11:00 boronia weewx[1184] ERROR
weewx.reportengine: ****
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-01-03T06:10:17.268988+11:00 boronia
weewx[1184] ERROR weewx.reportengine: **** AttributeError:
type object 'ImageDraw' has no attribute 'textsize'
2024-01-03T06:10:17.269066+11:00 boronia weewx[1184] ERROR
weewx.reportengine: **** Generator terminated

I thought I would try reinstalling the package as I had not examined
the diffs for any of the conf files when updating the server.
This was unsuccessful
Setting up weewx (4.10.2-1) ...
using debconf configuration values from previous install
Traceback (most recent call last):
File "/usr/share/weewx/wee_config", line 128, in <module>
main()
File "/usr/share/weewx/wee_config", line 122, in main
config_mgr.run(args, options)
File "/usr/share/weewx/weecfg/config.py", line 125, in run
weecfg.modify_config(config_dict, stn_info, self.logger,
options.debug) File "/usr/share/weewx/weecfg/__init__.py", line 313, in
modify_config config_dict['StdReport']['Defaults']['unit_system'] =
stn_info['unit_system'] ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/configobj/__init__.py", line
554, in __getitem__ val = dict.__getitem__(self, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'Defaults'
dpkg: error processing package weewx (--configure):
installed weewx package post-installation script subprocess returned
error exit status 1 Errors were encountered while processing:
weewx

This leaves me with the error
AttributeError: type object 'ImageDraw' has no attribute 'textsize'

Can someone advise where I can specify 'textsize' ?

Liz
skin.conf

vince

unread,
Jan 2, 2024, 3:21:54 PM1/2/24
to weewx-user
Always always always search the forums for your AttributeError message. 

Look at https://groups.google.com/g/weewx-user/c/XmKEPTN1L_g/m/GUWqcdaQCQAJ and see if that helps any.  You might also try using the v5 beta as well, although it is still seemingly not finalized.

Running old software on a bleeding edge os can sometimes come with adventures.  Geez I can barely find any references to debian trixie (deb13 to-be it seems).  No vagrant boxes.  No docker images.  Nothing easily findable.  You're way out on the bleeding edge....

vince

unread,
Jan 2, 2024, 3:48:55 PM1/2/24
to weewx-user
I did find a debian:trixie docker image and gave the v5 beta a quick test.  The pip method seems to work.  The rc2 dpkg looks like it has some issues so I'd hold off on trying that.

Or do the v4 workaround in the thread I mentioned earlier.

L B

unread,
Jan 2, 2024, 4:19:21 PM1/2/24
to weewx-user
Indeed, V5.0.0rc2 declines to start
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****      if StrictVersion(weewx.__version__) < StrictVersion(REQUIRED_WEEWX):
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/setuptools/_distutils/version.py", line 54, in __init__
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****      self.parse(vstring)
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/setuptools/_distutils/version.py", line 157, in parse
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****      raise ValueError("invalid version number '%s'" % vstring)
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****  ValueError: invalid version number '5.0.0rc2'
Jan 03 08:03:09 boronia weewxd[236273]: CRITICAL __main__:     ****  Exiting.
Jan 03 08:03:09 boronia systemd[1]: weewx.service: Main process exited, code=exited, status=1/FAILURE
Jan 03 08:03:09 boronia systemd[1]: weewx.service: Failed with result 'exit-code'.

My weewx is now running on weewx v5.0.0b17
Thanks for your time

Tom Keffer

unread,
Jan 2, 2024, 6:49:56 PM1/2/24
to weewx...@googlegroups.com
Some extensions use "StrictVersion" from distutils to test the version number of weewx. It fails for anything with an "rc" in the version number. You didn't show enough of the log to see what extension did this, but if you comment out the version check, things will probably work.

--
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/562902bd-e32a-4a83-80d2-45d3be104fa6n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages