Issue with reports for Belchertown skin.

77 views
Skip to first unread message

O S

unread,
Feb 15, 2026, 5:05:41 PM (3 days ago) Feb 15
to weewx-user
Hello all,

i have been experimenting with adding new observations and graphs today and everything has worked as expected. I just noticed that the Belchertown skin is not updating so I ran a report manually and I'm getting the errors below - I have no idea why, Can anyone help?

The Seasons skin is still working fine. The only other thing i did today was to set up a few scripts and cron jobs to make hourly, weekly, monthly backups using rsync.

Thanks,
Nick.

Using configuration file /etc/weewx/weewx.conf
All enabled reports will be run.
Generating as of last timestamp in the database.
Traceback (most recent call last):
File “/usr/share/weewx/weewx/reportengine.py”, line 248, in run
obj.start()
File “/usr/share/weewx/weewx/reportengine.py”, line 465, in start
self.run()
File “/usr/share/weewx/weewx/cheetahgenerator.py”, line 166, in run
ngen = self.generate(gendict[sectionname], sectionname, self.gents)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/share/weewx/weewx/cheetahgenerator.py”, line 226, in generate
ngen += self.generate(section[subsection], subsection, gents)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/share/weewx/weewx/cheetahgenerator.py”, line 226, in generate
ngen += self.generate(section[subsection], subsection, gents)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/share/weewx/weewx/cheetahgenerator.py”, line 309, in generate
searchList = self.getSearchList(encoding, timespan,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/share/weewx/weewx/cheetahgenerator.py”, line 401, in getSearchList
searchlist += obj.getextensionlist(timespan, dblookup)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/etc/weewx/bin/user/belchertown.py”, line 403, in get_extension_list
chart_dict = configobj.ConfigObj(chart_config_path, file_error=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/configobj/__init
.py”, line 1229, in __init

self._load(infile, configspec)
File “/usr/lib/python3/dist-packages/configobj/__init
.py”, line 1318, in _load
raise error
configobj.DuplicateError: Duplicate section name at line 350.
Traceback (most recent call last):
File “/usr/share/weewx/weewx/reportengine.py”, line 248, in run
obj.start()
File “/usr/share/weewx/weewx/reportengine.py”, line 465, in start
self.run()
File “/etc/weewx/bin/user/belchertown.py”, line 2308, in run
self.chart_dict = configobj.ConfigObj(chart_config_path, file_error=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/configobj/__init
.py”, line 1229, in __init

self._load(infile, configspec)
File “/usr/lib/python3/dist-packages/configobj/__init
.py”, line 1318, in _load
raise error
configobj.DuplicateError: Duplicate section name at line 350

Vince Skahan

unread,
Feb 15, 2026, 5:21:00 PM (3 days ago) Feb 15
to weewx-user
> configobj.DuplicateError: Duplicate section name at line 350

Doesn't get much more obvious than this one....

O S

unread,
Feb 16, 2026, 4:40:49 PM (2 days ago) Feb 16
to weewx-user
Many thanks and is there any chance that you would be able to offer something a little less cryptic? Perhaps you'd explain how you arrived at the conclusion you did and how I might go about fixing it?

This group is where you have directed me to more than once when I have posted on the wxforum, saying that if I "... want quality help the best place to ask is in the place where the thousands of users and the sw devs hang out, which is in the google group for this particular piece of software." So, here I am.

The error output that I posted above appears to the untrained eye to have lots of errors, but you have only highlighted the last one, so I wonder why this is and what those other messages mean. I have navigated to /usr/lib/python3/dist-packages/configobj and executed: sudo nano -l __init.py and I find this at line 350:

         # Back in interpolate(), all we have to do is kick off the recursive

It appears to exist only once.

So, as it turns out, not really that obvious at all, unless you know markedly more than I do, which it appears that you do, and which makes me wonder why you'd not be a little more forthcoming with some assistance.

Not trying to be obtuse here, just a genuine question and i apologise if what appear to be basic questions irritate you.

Thanks,
Nick.
Message has been deleted

O S

unread,
Feb 16, 2026, 4:49:39 PM (2 days ago) Feb 16
to weewx-user
Sorry, that should have been: sudo nano -l __init__.py

Tom Keffer

unread,
Feb 16, 2026, 4:54:53 PM (2 days ago) Feb 16
to weewx...@googlegroups.com
What you are looking at is an exception stack. The actual error is the last entry "Duplicate section name." The entries above it are the stack trace: which function called which function which ended up causing the error. They are useful for figuring out how the software got into its predicament, but for the moment you can ignore them. You just need to focus on the last item, the duplicate section name error.

The duplicate section name is in the configuration file, not the function reading it. Belchertown has its own way of doing things, but one of your configuration files, probably the one you last edited, has a duplicate section name at line 350. This means it looks something like:

[SomeEntry]
  [[SubEntry]]
    ...
  [[SubEntry]]

Note how "SubEntry" appears twice. For a configuration file, it can only appear once. 

By convention, configuration files end in the suffix ".conf". Check line 350 of all of them. You'll find the culprit.

Hope this helps.

-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 visit https://groups.google.com/d/msgid/weewx-user/c65cf470-cd04-4833-af03-78a23addf88fn%40googlegroups.com.

O S

unread,
Feb 16, 2026, 5:04:56 PM (2 days ago) Feb 16
to weewx-user
Hello Tom,

Many thanks and that is very helpful indeed - and I have learned something new regarding the exception stack and stack trace. Good to know that the salient piece (for me) is at the end of these.

OK, I reckon this is the skin.conf or weewx.conf file, so will go and have a look.

Thank you again and I'll let you know...

Nick.

O S

unread,
Feb 16, 2026, 5:20:17 PM (2 days ago) Feb 16
to weewx-user
Hello again, Tom,

OK, that worked! It ended up that it was in graphs.conf, which makes sense when you look at my first post here :) Brilliant - thank you again.

One issue, I now have this when generating a report with: sudo weectl report run Belchertown:

Traceback (most recent call last):
File “/usr/share/weewx/weewx/reportengine.py”, line 248, in run
obj.start()
File “/usr/share/weewx/weewx/reportengine.py”, line 465, in start
self.run()

File “/etc/weewx/bin/user/belchertown.py”, line 2948, in run
series_data = self.get_observation_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/etc/weewx/bin/user/belchertown.py”, line 3722, in get_observation_data
time_start_vt, time_stop_vt, obs_vt, start_ts, end_ts, aggregate_interval
^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable ‘time_start_vt’ where it is not associated with a value

So, I will try to figure this one out now!

Cheers :)

Vince Skahan

unread,
Feb 16, 2026, 5:51:40 PM (2 days ago) Feb 16
to weewx-user
Nick - I know this stuff can be frustrating.

Less cryptic answer follows......

1. When you edit a file and then immediately a problem occurs I'd suggest you might perhaps take a breath and (re)read the error messages like these when you see them...because they really 'do' tell you where you need to look to find the cause of the problem you're running into.

> Using configuration file /etc/weewx/weewx.conf
> [...]
> configobj.DuplicateError: Duplicate section name at line 350

So a reasonable thing is to look around line 350 in weewx.conf for a [section] that exists above in that file.

==> That's the file you touched.
==> That's almost certainly the file you typo'd within.

2. If the error messages don't make sense, take a minute to use google search.  Just search for your error message.
  • A Google search for "configobj.DuplicateError: Duplicate section name at line 350" returned the following:
configobj.DuplicateError: Duplicate section name at line 350 indicates that the configuration file you are trying to read has two or more sections with the exact same name, and the configobj library is running in a mode where this is not allowed.

[...]

Edit the configuration file: Open the configuration file (usually an INI file) in a text editor. Go to line 350 and the original line with the same section name. You will need to either rename one of the sections to be unique or remove the duplicate if it is unnecessary.

==> so it's saying you have a duplicate [something] around line 350, which is almost certainly in the area you were hand-editing.

3. Alternately leverage the nice search capability of the google group here....
  • A search in this google group for "configobj.DuplicateError: Duplicate section name at line" (omitting the line number) returns a number of hits dating back over a decade including at least a couple that were identical and had answers saying basically 'you have [whatever] twice in your file'.

Bottom line is that most of this stuff isn't 'that' difficult usually if you just use the search capabilities and a little common sense (or coffee, or walking away for a bit rather than getting frustrated).

==> If you edit file XYZ and break something, it is pretty likely that file XYZ is where the typo/error is located. 

==> Do things one step at a time in an orderly manner.  Save the previous version so you can go back to the last working copy,  Learn to use the 'diff' utility to compare two versions of a particular file.  It really does help.


Vince Skahan

unread,
Feb 16, 2026, 5:53:49 PM (2 days ago) Feb 16
to weewx-user
I might add that if you're fiddling with skin.conf files and .tmpl files for skins that it can be 'very' frustrating trying to battle Cheetah errors, which can give you bogus line numbers.  Again, if you touched file XYZ and stuff broke, go back to the file(s) you touched as the likely suspects.

jterr...@gmail.com

unread,
Feb 17, 2026, 1:05:10 PM (yesterday) Feb 17
to weewx-user
Concerning the error with local variable ‘time_start_vt’ , I am not 100% sure, but it may indicate that the  belchertown script try to generate a chart of an observation that is not in your weewx database.

Could you share your graph.conf file as well as your weewx.conf file ?   
Reply all
Reply to author
Forward
0 new messages