Error with user.jsonengine

58 views
Skip to first unread message

Yves Martin

unread,
Jul 13, 2023, 8:14:37 AM7/13/23
to weewx-user
Hi,

I have this recurent error :

Jul 13 08:11:47 weewx4-raspi weewx[7143] DEBUG user.jsonengine: Generating history for obs_name maxSolarRad and column_name maxSolarRad with binding None
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine: Caught unrecoverable exception in generator 'user.jsonengine.JSONGenerator'
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****  'maxSolarRad'
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****  Traceback (most recent call last):
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 197, in run
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****      obj.start()
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/reportengine.py", line 385, in start
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****      self.run()
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/user/jsonengine.py", line 51, in run
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****      self.gen_data()
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/user/jsonengine.py", line 128, in gen_data
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****      ret, category_history = self.gen_history_data(category, data_type, live_$
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/user/jsonengine.py", line 210, in gen_history_data
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****      db_value_tuple = weewx.units.as_value_tuple(rec, column_name)
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****    File "/usr/share/weewx/weewx/units.py", line 1644, in as_value_tuple
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****      val = record_dict[obs_type]
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****  KeyError: 'maxSolarRad'
Jul 13 08:11:47 weewx4-raspi weewx[7143] ERROR weewx.reportengine:         ****  Generator terminated

Any idea?

Yves,
YMartin.com/meteo

michael.k...@gmx.at

unread,
Jul 13, 2023, 9:21:45 AM7/13/23
to weewx-user
If I remember correctly, you migrate from a rather old installation that most likely didn't use the extended database schema. My best guess is, that you didn't upgrade your database to  schemas.wview_extended.schema 
See: https://github.com/weewx/weewx/blob/master/bin/schemas/wview.py => doesn't contain "maxSolarRad" vs. https://github.com/weewx/weewx/blob/master/bin/schemas/wview_extended.py => conains "maxSolarRad"

The skin's configuration is assuming having the extended schema, so now your options are:



Yves Martin

unread,
Jul 13, 2023, 9:41:16 AM7/13/23
to weewx-user
Mi Michael,

For now I've disabled "maxSolarRad" but my live gauge and Live charts still do not work.
I've restarted weewx with the same issue.

(...)

    [[radiation]]
        [[[radiation]]]
            payload_key = radiation
            #convertFunction = "function(value) { return value / 126.7; }" #you can do value conversions if needed
            showMaxMarkPoint = true
            showMinMarkPoint = false
            showAvgMarkLine = false
            lineColor = '#ffcd56'
            decimals = 0
#        [[[maxSolarRad]]]
#            plotType = line  #optional plot type, "line" is default
#            payload_key = maxSolarRad
#            showMaxMarkPoint = false
#            showMinMarkPoint = false
#            showAvgMarkLine = false
#            lineColor = '#ffcd5677'
#            decimals = 0
        [[[UV]]]
            yAxisIndex = 1  #to assign UV to the 2nd yAxis
            plotType = bar  #plot type, "line" is default
            aggregateType = avg
            aggregateInterval = 3600
            payload_key = UV
            showMaxMarkPoint = false
            showMinMarkPoint = false

But I also have this error (not critical) :

Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
Jul 13 09:35:43 weewx4-raspi weewx[9408] DEBUG user.jsonengine: JSONGenerator: Cannot decode reading of 'None' for column 'windDir'
(...)

Yves
YMartin.com/meteo

michael.k...@gmx.at

unread,
Jul 13, 2023, 9:53:38 AM7/13/23
to weewx-user
Looking at https://ymartin.com/meteo/and https://ymartin.com/meteo/en, The gauges and charts l look just fine, with up-to-date data. The only thing: the radiation chart is not the. did you enable it in the live_chart_items = outTemp, barometer, rain, outHumidity, wind, windDir, radiation ?

But there is an other issue: if you check the errors (depending on the browser, press F12 on a Desktop) some files are not uploaded:
index.html:190          GET https://ymartin.com/meteo/en/js/jquery-3.6.3.min.js net::ERR_ABORTED 404 (Not Found)
index.html:192          GET https://ymartin.com/meteo/en/js/bootstrap.bundle.min.js net::ERR_ABORTED 404 (Not Found)
index.html:193          GET https://ymartin.com/meteo/en/js/mqtt.min.js net::ERR_ABORTED 404 (Not Found)
index.html:198          GET https://ymartin.com/meteo/en/js/lang.js net::ERR_ABORTED 404 (Not Found)

Are these files in ../skins/Bootstrap/js?
Reply all
Reply to author
Forward
0 new messages