How to debug cheetah report not reporting

74 views
Skip to first unread message

sbar...@gmail.com

unread,
Jun 16, 2021, 12:50:10 AM6/16/21
to weewx-development
Hello, 

Thank to a wipe of my RPI3 sd card, I am reinstalling my station from scratch.
Weewx with SDR has restarted fine, and I am currently fighting with cheetah to try figure what I messed in my templates.

I am using the forecast skin with a varation to have the iconic template with the new WU icons.
That setup WAS working but I obviously did not properly commit all files to the repo.

cloning repo, installing the extension goes fine. Upon the 1st report run, all the files except 'iconic-color.html' get generated to the forecast target folder. (All templates from the standard forecast template are filled with proper data using WU forecast data)

I have tried running cheetah3 compile index.tmpl (after renaming my iconic-color.html.tmpl to index.tmpl) and it compiles an index.py fine. running the py file with pyhton3 output html looking consistent with my expected template.

I have set debug = 1 (even 2) in weewx, run in daemon or cli, I do not get any cheetah error when generating the reports. It just seems ignored.

Is there something obvious I forgot to get this running? (or to get runtime information from cheetah that would point to the problem)

Regards,

gjr80

unread,
Jun 16, 2021, 7:35:35 PM6/16/21
to weewx-development
First thing is the WeeWX log, sometimes it is not the error you are looking for in the log but rather what is missing from the log. What does the log show with debug = 1

Second thing, the iconic-color.html.tmpl is pretty basic with the majority of the 'work' being done via an include. Chances are the issue is in the include file, but what happens if you comment out the include? Is iconic-color.html generated ?

Troubleshooting Cheetah template issues can be notoriously tricky. It generally comes down to where the error is and how much (or how helpful) error output you get. Common runtime errors are a variable/tag being None and the code being unable to handle that, though these types of errors generally provide an error message. I don't know whether using an include can mask some error output, I have never had to troubleshoot any includes, perhaps try (temporarily) adding the include code into iconic-color.html.tmpl.

You may have to resort temporarily removing portions of the template code until you find the portion that causes the error, then progressively restore the code until you find the portion that causes the error. Slow and tedious but can be sped up if you can temporarily shorten your archive interval and if you systematically work through your code.

Gary

sbar...@gmail.com

unread,
Jun 18, 2021, 12:33:07 AM6/18/21
to weewx-development
Hi Gjr80,

Thank you for the answer.

As far a log go, they do not  show errors, and just give the list count of reports generated and copied. Log debug 1 does the same. 

Running wihthout the inc generates the file, and a series of : 
here
#stop

has helped me pin identify the loop where the report breaks. I will give a bit more time to this, and should be able to figure what is missing from the forecast that kills the output.

The debug method is quite crude, but it should get me going. But I guess that next time I start something on a skin, I'll limit the cheetah process to generating a json file. and use more modern ways of building and debugging the output side of the thing.

Thanks again

Regards,

sbar...@gmail.com

unread,
Jun 20, 2021, 11:10:56 AM6/20/21
to weewx-development
For the record using the following try catch statement across a #include or across the whole page juste saved my debugging life:



It just bring meaningful information (sometimes without the line #), but I could fix my 2 templates now.

Regards,

Reply all
Reply to author
Forward
0 new messages