MYSQL2 is a second MYSQL connection to an off-site server:
[[MySQL2]]
driver = weedb.mysql
host = (secret host)
user = weewx
password = (secret password)
The database is there, and weewx pulls the information correctly earlier in
my HTML with a call to the main table "sensor_gamma" (i.e.: <td
class="stats_data">$latest($data_binding='well_binding').wellTemp</td>).
The database also contains the table "sensor_gamma_day_wellTemp" but
wee_database doesn't seem to be able to populate it, even though it
originally created it. The only day summary table with information is
metadata specifying Version 1.0. If I drop any of the daily summary
tables, weewx doesn't seem to recreate them, I assume because of the
ongoing error.
What's really odd if I have this exact same setup at a different location
(though it uses pondTemp).
-JZ
On Thu, Sep 10, 2020 at 7:00 AM Tom Keffer <[email protected]> wrote:
> 1. Looking through your [[sensors]] section we see
>
> [[sensors]]
> database_type = MySQL2
> database_name = z_sensors_ranch
>
> I don't know what a database type of MySQL2 is. Your choices are normally
> SQLite or MySQL. What is MySQL2?
>
> 2. This matters because well_binding is bound to the database 'sensors'.
> In turn, 'sensors' specifies that it will contain a database named
> 'z_sensors_ranch', which, apparently, is missing. Double check that.
>
> -tk
>
> On Wed, Sep 9, 2020 at 4:58 PM Jonathan Zitelman <[email protected]>
> wrote:
>
>> I apologize as I didn't include the V4 schema I tried along with it's
>> error message. The syslog notation was the same: ERROR weewx.manager:
>> Cannot get columns of table archive, and no schema specified
>>
>> V4 schema:
>>
>> """The extended wview schema."""
>>
>> table= [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'),
>> ('usUnits', 'INTEGER NOT NULL'),
>> ('interval', 'INTEGER NOT NULL'),
>> ('wellTemp', 'REAL'),
>> ('wellFlow', 'REAL'),
>> ('battery', 'INTEGER'),
>> ('sigLevel', 'INTEGER'),
>> ('transID', 'INTEGER')]
>>
>>
>> day_summaries = [(e[0], 'scalar') for e in table
>> if e[0] not in ('dateTime', 'usUnits', 'interval')]
>>
>> schema = {
>> 'table': table,
>> 'day_summaries' : day_summaries
>> }
>>
>>
>> Error produced from: sudo /usr/share/weewx/wee_database --rebuild-daily
>> --binding=well_binding (looks to be the same)
>>
>> Using configuration file /etc/weewx/weewx.conf
>> Using database binding 'well_binding', which is bound to database
>> 'sensors'
>> Traceback (most recent call last):
>> File "/usr/share/weewx/wee_database", line 974, in <module>
>> main()
>> File "/usr/share/weewx/wee_database", line 169, in main
>> rebuildDaily(config_dict, db_binding, options)
>> File "/usr/share/weewx/wee_database", line 225, in rebuildDaily
>> with weewx.manager.Manager.open(manager_dict['database_dict']) as
>> dbmanager:
>> File "/usr/share/weewx/weewx/manager.py", line 131, in open
>> dbmanager = cls(connection, table_name)
>> File "/usr/share/weewx/weewx/manager.py", line 83, in __init__
>> self.sqlkeys = self.connection.columnsOf(self.table_name)
>> File "/usr/share/weewx/weedb/mysql.py", line 61, in guarded_fn
>> raise klass(e)
>> weedb.NoTableError: (1146, "Table 'z_sensors_ranch.archive' doesn't
>> exist")
>>
>>
>> -JZ
>>
>> On Wed, Sep 9, 2020 at 5:52 PM Jonathan Zitelman <[email protected]>
>> wrote:
>>
>>> 1. I reverted user/wellTemp.py back to the V3 schema as follows:
>>>
>>> """The wview schema, which is also used by weewx."""
>>>
>>> schema = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY
>>> KEY'),
>>> ('usUnits', 'INTEGER NOT NULL'),
>>> ('interval', 'INTEGER NOT NULL'),
>>> ('wellTemp', 'REAL'),
>>> ('wellFlow', 'REAL'),
>>> ('battery', 'INTEGER'),
>>> ('sigLevel', 'INTEGER'),
>>> ('transID', 'INTEGER')]
>>>
>>>
>>> 2. The associated sections from weewx.conf:
>>>
>>> [DataBindings]
>>>
>>> [[wx_binding]]
>>> database = archive_mysql
>>> table_name = archive
>>> manager = weewx.manager.DaySummaryManager
>>> schema = schemas.wview_extended.schema
>>>
>>> [[well_binding]]
>>> database = sensors
>>> table_name = sensor_gamma
>>> manager = weewx.wxmanager.WXDaySummaryManager
>>> schema = user.wellTemp.schema
>>>
>>> [[HPt_binding]]
>>> database = sensors
>>> table_name = sensor_HPtank
>>> manager = weewx.wxmanager.WXDaySummaryManager
>>> schema = user.hpTank.schema
>>>
>>> [Databases]
>>>
>>> [[archive_mysql]]
>>> database_name = weewx
>>> database_type = MySQL
>>>
>>> [[sensors]]
>>> database_type = MySQL2
>>> database_name = z_sensors_ranch
>>>
>>>
>>> 3a. The full error text when trying to backfill the daily summaries:
>>>
>>> $ /usr/share/weewx/wee_database --rebuild-daily --binding=well_binding
>>>
>>> Using configuration file /etc/weewx/weewx.conf
>>> Using database binding 'well_binding', which is bound to database
>>> 'sensors'
>>> Traceback (most recent call last):
>>> File "/usr/share/weewx/wee_database", line 974, in <module>
>>> main()
>>> File "/usr/share/weewx/wee_database", line 169, in main
>>> rebuildDaily(config_dict, db_binding, options)
>>> File "/usr/share/weewx/wee_database", line 225, in rebuildDaily
>>> with weewx.manager.Manager.open(manager_dict['database_dict']) as
>>> dbmanager:
>>> File "/usr/share/weewx/weewx/manager.py", line 131, in open
>>> dbmanager = cls(connection, table_name)
>>> File "/usr/share/weewx/weewx/manager.py", line 83, in __init__
>>> self.sqlkeys = self.connection.columnsOf(self.table_name)
>>> File "/usr/share/weewx/weedb/mysql.py", line 61, in guarded_fn
>>> raise klass(e)
>>> weedb.NoTableError: (1146, "Table 'z_sensors_ranch.archive' doesn't
>>> exist")
>>>
>>> 3b. Having stopped weewx completely to run the above command, I only
>>> get one update to syslog, so not much to skimp on here:
>>>
>>> Sep 9 17:48:58 derby wee_database[23747] ERROR weewx.manager: Cannot
>>> get columns of table archive, and no schema specified
>>>
>>> This may be the error I posted a separate issue about in the forum as I
>>> typically have weewx running and have a cron job to update the external
>>> sensor databases, so the syslog may have been muddying up the information
>>> by combining everything.
>>>
>>> -JZ
>>>
>>> On Wed, Sep 9, 2020 at 5:37 PM Tom Keffer <[email protected]> wrote:
>>>
>>>> Could you post:
>>>>
>>>> 1. The exact schema you are using.
>>>> 2. The [DataBindings] section of weewx.conf.
>>>> 3. More context on what is causing this error. I can't tell what
>>>> program was running, nor what it was doing when the error occurred. The log
>>>> would be best. Don't skimp!
>>>>
>>>> On Wed, Sep 9, 2020 at 3:09 PM Jonathan Zitelman <[email protected]>
>>>> wrote:
>>>>
>>>>> The user schema is using the V3.x spec. When I update it to follow
>>>>> the V4.x spec, specifying as table= instead of schema= and adding the
>>>>> daily
>>>>> summary section it creates a new error:
>>>>> AttributeError: Module 'user.wellTemp' has no attribute
>>>>> 'schema' when searching for 'user.wellTemp.schema'
>>>>>
>>>>> As this table was empty, it looks like this issue existed when I was
>>>>> running 3.8 as I just upgraded this past weekend. Otherwise maybe there
>>>>> is
>>>>> a setting in weewx.conf that maybe I didn't change when I upgraded? Maybe
>>>>> this relates to the other issue I have posted about the error in the main
>>>>> packet loop? I didn't see a need for wee_database --update as was listed
>>>>> for some of the older upgrades.
>>>>>
>>>>> -JZ
>>>>>
>>>>> On Wed, Sep 9, 2020 at 4:51 PM Tom Keffer <[email protected]> wrote:
>>>>>
>>>>>> Double check your schema, user.wellTemp.schema. Does it use the
>>>>>> old-style V3.x schema spec, or the new-style V4.x schema spec? If you
>>>>>> compare schemas/wview.py (old-style) and schemas/wview_extended.py
>>>>>> (new-style) you can see the difference.
>>>>>>
>>>>>> If you are using new-style schemas, then you must explicitly list
>>>>>> what types should appear in the daily summaries.
>>>>>>
>>>>>> -tk
>>>>>>
>>>>>> On Wed, Sep 9, 2020 at 2:46 PM Jonathan Zitelman <
>>>>>> [email protected]> wrote:
>>>>>>
>>>>>>> Thanks for the direction! I checked the daily summary table and it
>>>>>>> exists but is empty, so that's likely the issue. When I ran "sudo
>>>>>>> wee_database --rebuild-daily --binding=well_binding" I receive an error
>>>>>>> that the table archive does not exist, though I specify a different
>>>>>>> table
>>>>>>> name in weewx.conf.
>>>>>>>
>>>>>>> pertinent section from weewx.conf:
>>>>>>>
>>>>>>> [[well_binding]]
>>>>>>> database = sensors
>>>>>>> table_name = sensor_gamma
>>>>>>> manager = weewx.wxmanager.WXDaySummaryManager
>>>>>>> schema = user.wellTemp.schema
>>>>>>>
>>>>>>> Specific error from wee_database:
>>>>>>>
>>>>>>> Using configuration file /etc/weewx/weewx.conf
>>>>>>> Using database binding 'well_binding', which is bound to database
>>>>>>> 'sensors'
>>>>>>> Traceback (most recent call last):
>>>>>>> File "/usr/share/weewx/wee_database", line 974, in <module>
>>>>>>> main()
>>>>>>> File "/usr/share/weewx/wee_database", line 169, in main
>>>>>>> rebuildDaily(config_dict, db_binding, options)
>>>>>>> File "/usr/share/weewx/wee_database", line 225, in rebuildDaily
>>>>>>> with weewx.manager.Manager.open(manager_dict['database_dict'])
>>>>>>> as dbmanager:
>>>>>>> File "/usr/share/weewx/weewx/manager.py", line 131, in open
>>>>>>> dbmanager = cls(connection, table_name)
>>>>>>> File "/usr/share/weewx/weewx/manager.py", line 83, in __init__
>>>>>>> self.sqlkeys = self.connection.columnsOf(self.table_name)
>>>>>>> File "/usr/share/weewx/weedb/mysql.py", line 61, in guarded_fn
>>>>>>> raise klass(e)
>>>>>>> weedb.NoTableError: (1146, "Table 'sensors.archive' doesn't exist")
>>>>>>>
>>>>>>>
>>>>>>> Apologies about the garbled code. I copied and pasted from the
>>>>>>> shell and didn't catch that it cut the line off. The correct code is:
>>>>>>> #if
>>>>>>> $day($data_binding='well_binding').wellTemp.has_data
>>>>>>> <tr>
>>>>>>> <td class="stats_label">
>>>>>>> High Well Temperature<br/>
>>>>>>> Low Well Temperature
>>>>>>> </td>
>>>>>>> <td class="stats_data">
>>>>>>> $day($data_binding='well_binding').wellTemp.max at
>>>>>>> $day($data_binding='well_binding').wellTemp.maxtime<br/>
>>>>>>> $day($data_binding='well_binding').wellTemp.min at
>>>>>>> $day($data_binding='well_binding').wellTemp.mintime
>>>>>>> </td>
>>>>>>> </tr>
>>>>>>> #end if
>>>>>>>
>>>>>>> On Wed, Sep 9, 2020 at 4:27 PM Tom Keffer <[email protected]> wrote:
>>>>>>>
>>>>>>>> I'm assuming that the #if statement is evaluating True. That is,
>>>>>>>> you're seeing the <tr>...</tr> HTML elements.
>>>>>>>>
>>>>>>>> Things to try:
>>>>>>>>
>>>>>>>> 1. Does the 'well_binding' database have a daily summary? That is
>>>>>>>> normally what the $day tag uses.
>>>>>>>>
>>>>>>>> 2. Have you checked the values in the database? In particular, the
>>>>>>>> values in the daily summary? Maybe they are all null?
>>>>>>>>
>>>>>>>> 3. Maybe it's just a typo, but the template snippet you included is
>>>>>>>> garbled. The expression "$day($data_binding='well_bindi$" is not valid.
>>>>>>>>
>>>>>>>> -tk
>>>>>>>>
>>>>>>>> On Wed, Sep 9, 2020 at 12:53 PM [email protected] <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I have an extra temperature system logging to a different
>>>>>>>>> database. I can pull the current temperature in my html.tmpl file
>>>>>>>>> with the
>>>>>>>>> code:
>>>>>>>>> <td
>>>>>>>>> class="stats_data">$latest($data_binding='well_binding').wellTemp</td>
>>>>>>>>> and it shows just fine. But when I try to pull my max/min values
>>>>>>>>> the page shows "N/A at N/A". I placed it in an if statement which
>>>>>>>>> allows
>>>>>>>>> it to run, so I'm not sure why it won't show the appropriate
>>>>>>>>> information.
>>>>>>>>> My code is:
>>>>>>>>>
>>>>>>>>> #if
>>>>>>>>> $day($data_binding='well_binding').wellTemp.has_data
>>>>>>>>> <tr>
>>>>>>>>> <td class="stats_label">
>>>>>>>>> High Well Temperature<br/>
>>>>>>>>> Low Well Temperature
>>>>>>>>> </td>
>>>>>>>>> <td class="stats_data">
>>>>>>>>> $day($data_binding='well_binding').wellTemp.max
>>>>>>>>> at $day($data_binding='well_bindi$
>>>>>>>>> $day($data_binding='well_binding').wellTemp.min
>>>>>>>>> at $day($data_binding='well_bindi$
>>>>>>>>> </td>
>>>>>>>>> </tr>
>>>>>>>>> #end if
>>>>>>>>>
>>>>>>>>> Thanks for any direction.
>>>>>>>>>
>>>>>>>>> -Jonathan
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> 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 [email protected].
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/d/msgid/weewx-user/5a263ab5-96d2-4c00-9b25-27a30a9efd5bn%40googlegroups.com
>>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/5a263ab5-96d2-4c00-9b25-27a30a9efd5bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>>
>>>>>>>> --
>>>>>>>> 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/vNlqslTsCs4/unsubscribe
>>>>>>>> .
>>>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>>>> [email protected].
>>>>>>>> To view this discussion on the web visit
>>>>>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEBLiqRn%3DCW5Yg2jEsbdL5u9UgHc_m1gNw_-PTdwTM_trw%40mail.gmail.com
>>>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEBLiqRn%3DCW5Yg2jEsbdL5u9UgHc_m1gNw_-PTdwTM_trw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>>> .
>>>>>>>>
>>>>>>> --
>>>>>>> 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 [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/weewx-user/CAFwS2r2Yydv3-55EwU8cCFAiF01pggp1-Fu6CGJ8eMwUP_9ePw%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAFwS2r2Yydv3-55EwU8cCFAiF01pggp1-Fu6CGJ8eMwUP_9ePw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> 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/vNlqslTsCs4/unsubscribe.
>>>>>> To unsubscribe from this group and all its topics, send an email to
>>>>>> [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zECGYP4CtP-aJKqTQvxPw9nQbNHfnXXYx6N6%2B-LE2Nm1Wg%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zECGYP4CtP-aJKqTQvxPw9nQbNHfnXXYx6N6%2B-LE2Nm1Wg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> 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 [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/weewx-user/CAFwS2r02xBwMt_jsWLWW4qgEVahsvDJrjb%3Dm332BpTU5KkuL9g%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/weewx-user/CAFwS2r02xBwMt_jsWLWW4qgEVahsvDJrjb%3Dm332BpTU5KkuL9g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> 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/vNlqslTsCs4/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEALbwJ_48z5GFBo-ROdLuzHx%3DZioew1J1hUYVgfy1px5w%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEALbwJ_48z5GFBo-ROdLuzHx%3DZioew1J1hUYVgfy1px5w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CAFwS2r2yz8ZE-gKUq0Jhqf-v2LSogj8_PhGhm7tcU3-7X5%2BEYw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/weewx-user/CAFwS2r2yz8ZE-gKUq0Jhqf-v2LSogj8_PhGhm7tcU3-7X5%2BEYw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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/vNlqslTsCs4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPq0zEDBwO1Z02ADsb2UfM%3DF-aZLi8uX_CfHHYpF7aOw0N2z5w%40mail.gmail.com
> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEDBwO1Z02ADsb2UfM%3DF-aZLi8uX_CfHHYpF7aOw0N2z5w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/CAFwS2r0yhU6WN7MuK7mg0eQc-iiBdSsi-Sz4HS8OmUJkNC8J-w%40mail.gmail.com.