Thanks Jonis, The following log extract captures the error along with a few extra details from tags.py, in particular the timespan being used by the $week.wind.avg call that caused the error
Nov 13 12:31:52 SkyWeather weewx[17639]: ObservationBinder._do_query: timespan=[2018-11-03 00:00:00 -03 (1541214000) -> 2018-11-04 01:00:00 -02 ( 1541300400)] aggregate_type=avg val=None Nov 13 12:31:52 SkyWeather weewx[17639]: ObservationBinder._do_query: data_binding=None Nov 13 12:31:52 SkyWeather weewx[17639]: ObservationBinder._do_query: first_timestamp=1527810600 last_timestamp=1542119400 Nov 13 12:31:52 SkyWeather weewx[17639]: cheetahgenerator: Generate failed with exception '<class 'weedb.NoColumnError'>' Nov 13 12:31:52 SkyWeather weewx[17639]: cheetahgenerator: **** Ignoring template /etc/weewx/skins/Belchertown/NOAA/NOAA-YYYY-MM.txt.tmpl Nov 13 12:31:52 SkyWeather weewx[17639]: cheetahgenerator: **** Reason: ( 1054, "Unknown column 'wind' in 'field list'") Nov 13 12:31:52 SkyWeather weewx[17639]: **** Traceback (most recent call last): Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/cheetahgenerator.py", line 330, in generate Nov 13 12:31:52 SkyWeather weewx[17639]: **** print >> _file, compiled_template Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1005, in __str__ Nov 13 12:31:52 SkyWeather weewx[17639]: **** rc = getattr(self, mainMethName)() Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "_etc_weewx_skins_Belchertown_NOAA_NOAA_YYYY_MM_txt_tmpl.py", line 451, in respond Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "_etc_weewx_skins_Belchertown_NOAA_NOAA_YYYY_MM_txt_tmpl.py", line 224, in __errorCatcher23 Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "<string>", line 1, in <module> Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/tags.py", line 332, in __getattr__ Nov 13 12:31:52 SkyWeather weewx[17639]: **** return self._do_query( aggregate_type) Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/tags.py", line 350, in _do_query Nov 13 12:31:52 SkyWeather weewx[17639]: **** val=val, **self. option_dict) Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/wxmanager.py", line 60, in getAggregate Nov 13 12:31:52 SkyWeather weewx[17639]: **** return weewx.manager. DaySummaryManager.getAggregate(self, timespan, obs_type, aggregateType, ** option_dict) Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/manager.py", line 1249, in getAggregate Nov 13 12:31:52 SkyWeather weewx[17639]: **** **option_dict) Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/manager.py", line 458, in getAggregate Nov 13 12:31:52 SkyWeather weewx[17639]: **** _row = self.getSql(select_stmt % interpolate_dict) Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weewx/manager.py", line 394, in getSql Nov 13 12:31:52 SkyWeather weewx[17639]: **** _cursor.execute(sql, sqlargs) Nov 13 12:31:52 SkyWeather weewx[17639]: **** File "/usr/share/weewx/weedb/mysql.py", line 48, in guarded_fn Nov 13 12:31:52 SkyWeather weewx[17639]: **** raise klass(e) Nov 13 12:31:52 SkyWeather weewx[17639]: **** NoColumnError: (1054, "Unknown column 'wind' in 'field list'") At first glance the timespan appears wrong 00:00:00 -> 00:01:00, but that agrees with the dateTime filed in archive_day_wind (dateTime fields are midnight values calculated by weeWX): MariaDB [weewx]> SELECT dateTime,max FROM archive_day_wind ORDER BY dateTime DESC LIMIT 32; +------------+---------------+ | dateTime | max | +------------+---------------+ | 1542074400 | 27.9085344298 | | 1541988000 | 25.0258600554 | | 1541901600 | 24.9870900035 | | 1541815200 | 27.5289972104 | | 1541728800 | 29.3639762739 | | 1541642400 | 25.3571126701 | | 1541556000 | 25.0108380298 | | 1541469600 | 26.9323996768 | | 1541383200 | 26.3870808852 | | 1541300400 | 24.9563264287 | | 1541214000 | 29.2825768668 | | 1541127600 | 65.639768948 | Unfortunately, when weeWX determines whether to use the daily summaries or archive for an aggregate one of the conditions that is checked (in this case) is whether the start and stop timestamps of that timespan are on midnight boundaries. According to the weeWX isMidnight function the timestamp 1541300400 is not a 'midnight'. Thus weeWX determines that it cannot use the daily summaries for $day.wind.avg for 3 November and tries to hit the archive and consequently we get the field not found error. So that is the mechanism that is occurring in this case, as for a fix that is a little more problematic. Simply rebuilding the daily summaries will have no effect, as weeWX will continue to use 1541300400 as the midnight timestamp on 4 November and at the same time isMidnight will continue to say that 1541300400 is not a 'midnight'. I suspect the issue is tied to the fact that the Brazilian changeover time for daylight saving is midnight and linux/python gets a little confused with the 12:00/01:00 issue. I had hoped that perhaps a linux update tzdata update may solve the issue but my up-to-date Stretch 9.6 VM exhibits the same error when I run the simulator in generator mode over the 3/4 November period. The problem I can't fathom is why has this not happened before, the error is not one that silently disappears in the hour after changeover, this error will continue as long as weeWX is run with data in a database covering 3/4 November. It also doesn't explain why a fresh install suffered the same issue, unless somehow the old database was still being used, though the log extract does not support this. Still confused. TOM !? Gary On Wednesday, 14 November 2018 00:36:12 UTC+10, Jonis Maurin Ceará wrote: > > Gary, I've sent logs direct to you. > > > Em seg, 12 de nov de 2018 às 23:17, gjr80 <gjrod...@gmail.com > <javascript:>> escreveu: > >> Tom is the author/developer, the rest of us just help out where/when we >> can. >> >> I have attached a version of tags.py with some extra logging to >> hopefully give us a clue why things are happening. What I would like you to >> do on your problem install is: >> >> 1. rename /usr/share/weewx/weewx/tags.py as tags_orig.py >> >> $ sudo mv /usr/share/weewx/weewx/tags.py /usr/share/weewx/weewx/tags_orig >> .py >> >> 2. download/copy the attached tags.py to /usr/share/weewx/weewx >> >> 3. restart weeWX. >> >> 4. Post the log from weeWX startup through until the error occurs. >> >> 5. Start a MySQL/Mariadb shell and run the following commands: >> >> > USE weewx; >> > SELECT dateTime,max FROM archive_day_wind ORDER BY dateTime DESC LIMIT >> 32; >> >> 6. Post the output from the above commands. >> >> To revert the tags.py changes just delete tags.py and rename tags_orig.py >> back to tags.py and restart weeWX. >> >> Gary >> >> On Tuesday, 13 November 2018 09:18:48 UTC+10, Jonis Maurin Ceará wrote: >>> >>> I'm not sure who is the mais author/developer, but I can give you access >>> to my station. It's in use right now, but is not imperative to keep online >>> 24/7, so you can access and check/test. The only thing is that I'm using my >>> old mysql database....but. like I said before, I've made tests with clean >>> and new database (sqlite and mysql). If you like, you can test and >>> re-create those databases again......just don't delete my old mysql >>> database :) >>> >>> >>> Em seg, 12 de nov de 2018 às 20:43, gjr80 <gjrod...@gmail.com> escreveu: >>> >>>> Tom, yes knew that was going on as soon as I saw the error message. >>>> Just having a trouble finding out why. Somewhere a timestamp must be >>>> missing a day boundary but I haven't yet worked out which. Particularly >>>> confusing when a clean database exhibits the same problem immediately. >>>> Also >>>> odd that week.html.tmpl throws the error but month.html.tmpl and >>>> year.html.tmpl do not which suggests week.wind is the culprit. Really want >>>> to see some of the timestamps being used to try and work out what is being >>>> used and why. >>>> >>>> Gary >>>> >>>> -- >>>> 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/llOh8p8emYY/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> weewx-user+...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> 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/llOh8p8emYY/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> weewx-user+...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.