Something funny with NOAA-YYYY-MM.txt.tmpl

95 views
Skip to first unread message

WindnFog

unread,
Jun 1, 2021, 11:03:37 AM6/1/21
to weewx-user
Hi gurus,

It's me again with a head-scratcher.  I had a hardware failure, rebuilt my Pi 4 from scratch, reloaded the latest Raspberry Pi OS, and installed weewx 4.5.1.  I had backups of index.html.tmpl, skin.conf, weewx.conf and weewx.sdb . . . which I restored, and it all works as before.  Except something is up with /etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl . . . here's the log extract - pages of this:

Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'FileNotFoundError'>'
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: **** Reason: [Errno 2] No such file or directory: '/etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl'
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      filtersLib=weewx.cheetahgenerator)
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1336, in __init__
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      self._compile(source, file, compilerSettings=compilerSettings)
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1630, in _compile
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      self._fileMtime = os.path.getmtime(file)
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3.7/genericpath.py", line 55, in getmtime
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      return os.stat(filename).st_mtime
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****  FileNotFoundError: [Errno 2] No such file or directory: '/etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl'
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'FileNotFoundError'>'
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl



      >snipped for brevity<

      
 Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: Generate failed with exception '<class 'FileNotFoundError'>'
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: **** Ignoring template /etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: **** Reason: [Errno 2] No such file or directory: '/etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl'
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****  Traceback (most recent call last):
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/cheetahgenerator.py", line 322, in generate
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      filtersLib=weewx.cheetahgenerator)
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1336, in __init__
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      self._compile(source, file, compilerSettings=compilerSettings)
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1630, in _compile
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      self._fileMtime = os.path.getmtime(file)
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****    File "/usr/lib/python3.7/genericpath.py", line 55, in getmtime
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****      return os.stat(filename).st_mtime
Jun 01 11:13:43 rhubarb python3[23648]: wee_reports[23648] ERROR weewx.cheetahgenerator: ****  FileNotFoundError: [Errno 2] No such file or directory: '/etc/weewx/skins/Standard/NOAA/NOAA-YYYY-MM.txt.tmpl'
Jun 01 11:13:45 rhubarb python3[23648]: wee_reports[23648] INFO weewx.cheetahgenerator: Generated 13 files for report StandardReport in 2.10 seconds
Jun 01 11:13:45 rhubarb python3[23648]: wee_reports[23648] INFO weewx.imagegenerator: Generated 13 images for report StandardReport in 0.53 seconds
Jun 01 11:13:45 rhubarb python3[23648]: wee_reports[23648] INFO weewx.reportengine: Copied 14 files to /var/www/html/weewx

As you can see, after the errors, it chugs along fine, but it's filling my log with these warnings.  Searching this user's group, I found a couple of somewhat similar problems (and their solutions), but they didn't seem to apply to my situation.  I don't think it's a permissions error, and I tried cleaning the files out of /etc/weewx/skins/Standard//NOAA as one thread suggested.  Didn't help.  I went to Github found and replaced NOAA-YYYY.txt.tmpl from this repository:

https://github.com/instantlinux/weewx-WeeGreen/blob/master/NOAA/NOAA-YYYY.txt.tmpl

That didn't help.  Here's the relevant directories:

pdunphy@rhubarb:/var/www/html/weewx/NOAA $ ls -la
total 36
drwxr-xr-x 2 pdunphy pdunphy 4096 Jun  1 11:40 .
drwxr-xr-x 7 pdunphy pdunphy 4096 Jun  1 11:40 ..
-rw-r--r-- 1 pdunphy pdunphy 2266 Jun  1 02:50 NOAA-2015.txt
-rw-r--r-- 1 pdunphy pdunphy 3538 Jun  1 02:50 NOAA-2016.txt
-rw-r--r-- 1 pdunphy pdunphy 3538 Jun  1 02:50 NOAA-2017.txt
-rw-r--r-- 1 pdunphy pdunphy 3538 Jun  1 02:50 NOAA-2018.txt
-rw-r--r-- 1 pdunphy pdunphy 3538 Jun  1 02:50 NOAA-2019.txt
-rw-r--r-- 1 pdunphy pdunphy 3538 Jun  1 02:50 NOAA-2020.txt
-rw-r--r-- 1 pdunphy pdunphy 2584 Jun  1 11:40 NOAA-2021.txt
pdunphy@rhubarb:/var/www/html/weewx/NOAA $ cd /etc/weewx/skins/Standard//NOAA
pdunphy@rhubarb:/etc/weewx/skins/Standard/NOAA $ ls -la
total 28
drwxr-xr-x 2 pdunphy pdunphy 4096 Jun  1 02:45 .
drwxr-xr-x 6 pdunphy pdunphy 4096 May 31 16:51 ..
-rw-r--r-- 1 pdunphy pdunphy 2591 Apr  2 17:15 NOAA-%Y-%m.txt.tmpl
-rw-r--r-- 1 pdunphy pdunphy 5364 Apr  2 17:15 NOAA-%Y.txt.tmpl
-rw-r--r-- 1 pdunphy pdunphy 4852 Jun  1 02:45 NOAA-YYYY.txt.tmpl
pdunphy@rhubarb:/etc/weewx/skins/Standard/NOAA $

I'm at a loss after fighting this for 18-20 hours!  It seems to be working in that it generates the NOOA files, but I'd like to get rid of the pages or warnings/errors. Is there a pip3 installable addition I'm missing?  Something else?  I'd sure appreciate it if someone would point me in the right direction.

- Paul VE1DX

vince

unread,
Jun 1, 2021, 12:06:46 PM6/1/21
to weewx-user
Looks like the filenames changed in weewx if you did a clean installation.

Your skin.conf needs editing to use the newer %Y filenames.   You can delete the YYYY file you copied into place.

I have two 4.5.1 setup.py systems and compared them.  The one installed from scratch has the newer %Y filenames for the templates.  The one that was 'upgraded' from a previous version still has the old YYYY filenames for those templates.   My 'guess' is that you restored an old skin.conf onto your new system and that caused the mismatch.  Maybe.

vince

unread,
Jun 1, 2021, 12:10:40 PM6/1/21
to weewx-user
Github commits say this change was made two years ago :-)


Wow.

WindnFog

unread,
Jun 1, 2021, 1:43:16 PM6/1/21
to weewx-user
You nailed it, Vince.  I did what you suspected - copied the old skin.conf file from a backup.  Changing from the old names to the new ones resolved the errors and generated all the NOAA
files:

    [[SummaryByMonth]]
        # Reports that summarize "by month"
        [[[NOAA_month]]]
            encoding = strict_ascii
            template = NOAA/NOAA-%Y-%m.txt.tmpl

    [[SummaryByYear]]
        # Reports that summarize "by year"
        [[[NOAA_year]]]
            encoding = strict_ascii
            template =  NOAA/NOAA-%Y-%m.txt.tmpl

I still have a few odds and ends to tidy up on the rebuild, but that one was beyond me.  I try not to ask here unless I'm stumped, and I sure was.  Thanks for the assistance!

- Paul VE1DX 

Tom Keffer

unread,
Jun 1, 2021, 4:22:59 PM6/1/21
to weewx-user
The new template naming scheme is backwards compatible with the old one. But, of course, you can't tell WeeWX that a template is named X, when it's really named Y. The names can use either the old or new scheme, but they have to match.

--
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/92eab653-e7ad-4b8f-be4f-189cd6350124n%40googlegroups.com.

HRM Resident

unread,
Jun 1, 2021, 8:49:03 PM6/1/21
to weewx...@googlegroups.com
That makes perfect sense, Tom.  I erroneously implied in my initial post that the NOAA files were being created anyway, in spite of the mistake I made. They were not, and obviously couldn’t be because the relevant part of the code wasn’t running.  

What I was seeing was the historical NOAA files on my VPS web server that were created and put there before the rebuild.  These are the kind of errors one misses when trying to get something working for 20-22 hours.  

All is good now.  Thanks you both for the clear explanation, and for the assistance in resolving this. 

- Paul VE1DX 

On Jun 1, 2021, at 5:23 PM, Tom Keffer <tke...@gmail.com> wrote:


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/oI0rsDED7jQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zECNV8O4d8P61O0UED%3D61AXsPPi9H7RbFDaEZC7LaDRMKg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages