Upgraded OS to Ubuntu 24.04.1 LTS causes error by Belchertown skin?

228 views
Skip to first unread message

Stefan Gliessmann

unread,
Sep 12, 2024, 8:18:37 AM9/12/24
to weewx-user
Dear All -

I just finished upgrading my weewx server's OS from Ubuntu 24.04. to Ubuntu 24.04.01 LTS.

After the reboot, things booted up just fine.
But no new reports were generated.
Going to the logfile, I found:

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine: Caught unrecoverable exception in generator 'weewx.cheetahgenerator.CheetahGenerator'

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****  module 'locale' has no attribute 'format'

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****  Traceback (most recent call last):

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 248, in run

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      obj.start()

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 465, in start

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      self.run()

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 166, in run

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      ngen = self.generate(gen_dict[section_name], section_name, self.gen_ts)

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 226, in generate

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      ngen += self.generate(section[subsection], subsection, gen_ts)

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 309, in generate

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      searchList = self._getSearchList(encoding, timespan,

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 401, in _getSearchList

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      search_list += obj.get_extension_list(timespan, db_lookup)

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****    File "/etc/weewx/bin/user/belchertown.py", line 612, in get_extension_list

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      locale.format("%g", float(year_outTemp_max_range_total)),

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****      ^^^^^^^^^^^^^

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****  AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?

Sep 12 13:52:49 WXvm weectl[7581]: ERROR weewx.reportengine:         ****  Generator terminated


I read that the upgrade might have changed the installed modules of python3.

Is this really the root cause of this error message? And if so,  how do I fix it? Re-install the belchertown skin?


Anybodyelse did the Ubuntu upgrade recently?

Tom Keffer

unread,
Sep 12, 2024, 8:28:33 AM9/12/24
to weewx...@googlegroups.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.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/7e3bbda4-addd-4ac4-b48b-f31808e42b7dn%40googlegroups.com.

Karen K

unread,
Sep 12, 2024, 8:30:20 AM9/12/24
to weewx-user
I guess you may want to re-install some Python modules. The error message reports an error regarding the "locale" module. I see no connection to the Belchertown skin itself.

Stefan Gliessmann

unread,
Sep 12, 2024, 8:43:54 AM9/12/24
to weewx-user
Thank you Tom!

I need to improve my search skills in this group!

Cheers,
Stefan

Stefan Gliessmann

unread,
Sep 12, 2024, 8:50:36 AM9/12/24
to weewx-user
Actually, the updated belchertown.py (three months ago) is already in place on my server.
Please notice that this is Ubuntu 24.04.01

Before the upgrade, it was running just fine on Ubuntu 24.04.

I did re-install "locales" already:

sudo apt-get update
sudo apt-get install --reinstall locales

A little test script return the correct format, too:

import locale
locale.setlocale(locale.LC_ALL, '')
print(locale.format_string("%g", 12345.6789, grouping=True))

 Hmm ...

Stefan Gliessmann

unread,
Sep 12, 2024, 9:04:49 AM9/12/24
to weewx-user
well - I just did another:

and now, it works ....

Thank you, again, Tom!

Karen K

unread,
Sep 12, 2024, 9:06:51 AM9/12/24
to weewx-user
Could you report what was the difference between the belchertown.py that created the error and the belchertown.py that works?

Stefan Gliessmann

unread,
Sep 12, 2024, 9:15:13 AM9/12/24
to weewx-user
I wish, I could :(

I needed to do a fresh install of my home station on June 23 from scratch.
And belchertown.py was last changed on Jun 21. (specifically for this issue).

So, I am really puzzled what was the issue ...

Reply all
Reply to author
Forward
0 new messages