weewx v4.1 sql db will not rebuild daily

90 views
Skip to first unread message

Neville Davis

unread,
Jun 2, 2020, 9:11:52 AM6/2/20
to weewx-user
Guys

I had quite an issue but luckily I had backed up about 6 hrs before my drama....Now I find that when I attempt to rebuild dailies from the backup it creates the tables then says the following and exits. This last attempt was after shutdown and reboot. 
This happened several times so I dropped weewx created new weewx and imported backup....so daily tables not in existence...when it exits I can see the tables have been created..then it crashes.

Neville


Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 163, in open_with_create

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****      dbmanager = cls(connection, table_name=table_name, schema=schema)

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 818, in __init__

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****      self._initialize_day_tables(schema)

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 867, in _initialize_day_tables

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****      cursor.execute(sql_create_str)

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****      raise klass(e)

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****  weedb.TableExistsError: (1050, "Table 'archive_day_altimeter' already exists")

Jun 02 22:54:50 raspberrypi weewxd[628]: weewx[628] CRITICAL __main__:     ****  Exiting.

~

user log 

Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 163, in open_with_create
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****      dbmanager = cls(connection, table_name=table_name, schema=schema)
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 818, in __init__
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****      self._initialize_day_tables(schema)
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 867, in _initialize_day_tables
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****      cursor.execute(sql_create_str)
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****      raise klass(e)
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****  weedb.TableExistsError: (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:26:34 raspberrypi weewx[26307] CRITICAL __main__:     ****  Exiting.
Jun  2 22:41:28 raspberrypi wee_database[26571] INFO __main__: All daily summaries will be rebuilt.
Jun  2 22:47:12 raspberrypi wee_database[26653] INFO __main__: All daily summaries will be rebuilt.
Jun  2 22:50:50 raspberrypi wee_database[26723] INFO __main__: All daily summaries will be rebuilt.
Jun  2 22:52:05 raspberrypi mtp-probe: checking bus 1, device 5: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5"
Jun  2 22:52:05 raspberrypi mtp-probe: checking bus 1, device 4: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Jun  2 22:52:05 raspberrypi mtp-probe: bus: 1, device: 5 was not an MTP device
Jun  2 22:52:05 raspberrypi mtp-probe: checking bus 1, device 3: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1"
Jun  2 22:52:05 raspberrypi mtp-probe: bus: 1, device: 4 was not an MTP device
Jun  2 22:52:05 raspberrypi mtp-probe: bus: 1, device: 3 was not an MTP device
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Initializing weewx version 4.1.0
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Platform Linux-4.19.97-v7+-armv7l-with-debian-10.4
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Locale is 'en_AU.UTF-8'
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: PID file is /var/run/weewx.pid
Jun  2 22:52:14 raspberrypi weewx[628] INFO __main__: Using configuration file /home/weewx/weewx.conf
Jun  2 22:52:14 raspberrypi weewx[628] INFO __main__: Debug is 0
Jun  2 22:52:14 raspberrypi weewx[628] INFO weewx.engine: Loading station type PiWeather (user.piweather)
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: service version is 0.23.6 (pyownet)
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: binding is loop
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: interface is localhost:4304
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: sensor map is {'rain': '/1D.E3AB0D000000'}
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: sensor type map is {'rain': 'rainwise_bucket'}
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: dallas direction map is {}
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: sensor unit system is metric
Jun  2 22:52:14 raspberrypi /weewxd: Aircon: using /var/ramdisk/aircontemps.csv
Jun  2 22:52:14 raspberrypi weewx[628] INFO weewx.engine: StdConvert target unit is 0x1
Jun  2 22:52:15 raspberrypi weewx[628] CRITICAL __main__: Database connection exception: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
Jun  2 22:52:15 raspberrypi weewx[628] CRITICAL __main__:     ****  Waiting 60 seconds then retrying...
Jun  2 22:54:50 raspberrypi weewx[628] INFO __main__: retrying...
Jun  2 22:54:50 raspberrypi weewx[628] INFO __main__: Using configuration file /home/weewx/weewx.conf
Jun  2 22:54:50 raspberrypi weewx[628] INFO __main__: Debug is 0
Jun  2 22:54:50 raspberrypi weewx[628] INFO weewx.engine: Loading station type PiWeather (user.piweather)
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: service version is 0.23.6 (pyownet)
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: binding is loop
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: interface is localhost:4304
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: sensor map is {'rain': '/1D.E3AB0D000000'}
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: sensor type map is {'rain': 'rainwise_bucket'}
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: dallas direction map is {}
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: sensor unit system is metric
Jun  2 22:54:50 raspberrypi /weewxd: Aircon: using /var/ramdisk/aircontemps.csv
Jun  2 22:54:50 raspberrypi weewx[628] INFO weewx.engine: StdConvert target unit is 0x1
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__: Caught unrecoverable exception:
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 52, in guarded_fn
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      return fn(*args, **kwargs)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 262, in execute
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.cursor.execute(mysql_string, tuple(sql_tuple))
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 250, in execute
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.errorhandler(self, exc, value)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      raise errorvalue
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 247, in execute
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      res = self._query(query)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 411, in _query
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      rowcount = self._do_query(q)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 374, in _do_query
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      db.query(q)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 292, in query
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      _mysql.connection.query(self, query)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  _mysql_exceptions.OperationalError: (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewxd", line 148, in main
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 75, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.loadServices(config_dict)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 138, in loadServices
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/wxservices.py", line 81, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      engine.db_binder)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/wxservices.py", line 124, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      initialize=True)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 530, in get_manager
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 680, in open_manager
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      manager_dict['schema'])
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 163, in open_with_create
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      dbmanager = cls(connection, table_name=table_name, schema=schema)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 818, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self._initialize_day_tables(schema)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 867, in _initialize_day_tables
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      cursor.execute(sql_create_str)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      raise klass(e)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  weedb.TableExistsError: (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  Exiting.

sys log

un  2 22:52:13 raspberrypi weewx[471] INFO __main__: Initializing weewx version 4.1.0
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Using Python 3.7.3 (default, Dec 20 2019, 18:57:59) #012[GCC 8.3.0]
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Platform Linux-4.19.97-v7+-armv7l-with-debian-10.4
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: Locale is 'en_AU.UTF-8'
Jun  2 22:52:13 raspberrypi weewx[471] INFO __main__: PID file is /var/run/weewx.pid
Jun  2 22:52:14 raspberrypi weewx[325]: Starting weewx weather system: weewx.
Jun  2 22:52:14 raspberrypi systemd[1]: Started LSB: weewx weather system.
Jun  2 22:52:14 raspberrypi weewx[628] INFO __main__: Using configuration file /home/weewx/weewx.conf
Jun  2 22:52:14 raspberrypi weewx[628] INFO __main__: Debug is 0
Jun  2 22:52:14 raspberrypi weewx[628] INFO weewx.engine: Loading station type PiWeather (user.piweather)
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: service version is 0.23.6 (pyownet)
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: binding is loop
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: interface is localhost:4304
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: sensor map is {'rain': '/1D.E3AB0D000000'}
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: sensor type map is {'rain': 'rainwise_bucket'}
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: dallas direction map is {}
Jun  2 22:52:14 raspberrypi weewx[628] INFO user.owfs: sensor unit system is metric
Jun  2 22:52:14 raspberrypi /weewxd: Aircon: using /var/ramdisk/aircontemps.csv
Jun  2 22:52:14 raspberrypi weewx[628] INFO weewx.engine: StdConvert target unit is 0x1
Jun  2 22:52:15 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.
Jun  2 22:52:15 raspberrypi weewx[628] CRITICAL __main__: Database connection exception: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
Jun  2 22:52:15 raspberrypi weewx[628] CRITICAL __main__:     ****  Waiting 60 seconds then retrying...
Jun  2 22:52:16 raspberrypi dhcpcd[417]: eth0: fe80::be30:d9ff:fed7:8de6 is reachable again
Jun  2 22:52:16 raspberrypi dhcpcd[417]: eth0: fe80::be30:d9ff:fed7:8de6 is reachable again
Jun  2 22:52:16 raspberrypi systemd[1]: Started MariaDB 10.3.22 database server.
Jun  2 22:52:16 raspberrypi systemd[1]: Reached target Multi-User System.
Jun  2 22:52:17 raspberrypi /etc/mysql/debian-start[665]: Upgrading MySQL tables if necessary.
Jun  2 22:52:17 raspberrypi systemd[1]: Started My sensordata Service.
Jun  2 22:52:17 raspberrypi systemd[1]: Started My fan Service.
Jun  2 22:52:17 raspberrypi systemd[1]: Starting Update UTMP about System Runlevel Changes...
Jun  2 22:52:17 raspberrypi systemd[1]: Started My aircon Service.
Jun  2 22:52:17 raspberrypi systemd[1]: systemd-update-utmp-runlevel.service: Succeeded.
Jun  2 22:52:17 raspberrypi systemd[1]: Started Update UTMP about System Runlevel Changes.
Jun  2 22:52:17 raspberrypi systemd[1]: Startup finished in 7.921s (kernel) + 27.829s (userspace) = 35.750s.
Jun  2 22:52:18 raspberrypi dhcpcd[417]: eth0: leased 192.168.0.190 for 86400 seconds
Jun  2 22:52:18 raspberrypi avahi-daemon[341]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.0.190.
Jun  2 22:52:18 raspberrypi dhcpcd[417]: eth0: adding route to 192.168.0.0/24
Jun  2 22:52:18 raspberrypi avahi-daemon[341]: New relevant interface eth0.IPv4 for mDNS.
Jun  2 22:52:18 raspberrypi avahi-daemon[341]: Registering new address record for 192.168.0.190 on eth0.IPv4.
Jun  2 22:52:18 raspberrypi dhcpcd[417]: eth0: adding default route via 192.168.0.1
Jun  2 22:52:18 raspberrypi /etc/mysql/debian-start[669]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Jun  2 22:52:18 raspberrypi /etc/mysql/debian-start[669]: Looking for 'mysql' as: /usr/bin/mysql
Jun  2 22:52:18 raspberrypi /etc/mysql/debian-start[669]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Jun  2 22:52:18 raspberrypi /etc/mysql/debian-start[669]: This installation of MySQL is already upgraded to 10.3.22-MariaDB, use --force if you still need to run mysql_upgrade
Jun  2 22:52:18 raspberrypi /etc/mysql/debian-start[744]: Checking for insecure root accounts.
Jun  2 22:52:19 raspberrypi /etc/mysql/debian-start[755]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
Jun  2 22:52:31 raspberrypi systemd[1]: systemd-fsckd.service: Succeeded.
Jun  2 22:54:07 raspberrypi systemd-timesyncd[278]: Synchronized to time server for the first time [2001:418:3ff::1:53]:123 (2.debian.pool.ntp.org).
Jun  2 22:54:17 raspberrypi systemd[1]: systemd-hostnamed.service: Succeeded.
Jun  2 22:54:50 raspberrypi weewx[628] INFO __main__: retrying...
Jun  2 22:54:50 raspberrypi weewx[628] INFO __main__: Using configuration file /home/weewx/weewx.conf
Jun  2 22:54:50 raspberrypi weewx[628] INFO __main__: Debug is 0
Jun  2 22:54:50 raspberrypi weewx[628] INFO weewx.engine: Loading station type PiWeather (user.piweather)
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: service version is 0.23.6 (pyownet)
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: binding is loop
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: interface is localhost:4304
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: sensor map is {'rain': '/1D.E3AB0D000000'}
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: sensor type map is {'rain': 'rainwise_bucket'}
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: dallas direction map is {}
Jun  2 22:54:50 raspberrypi weewx[628] INFO user.owfs: sensor unit system is metric
Jun  2 22:54:50 raspberrypi /weewxd: Aircon: using /var/ramdisk/aircontemps.csv
Jun  2 22:54:50 raspberrypi weewx[628] INFO weewx.engine: StdConvert target unit is 0x1
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__: Caught unrecoverable exception:
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 52, in guarded_fn
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      return fn(*args, **kwargs)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 262, in execute
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.cursor.execute(mysql_string, tuple(sql_tuple))
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 250, in execute
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.errorhandler(self, exc, value)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      raise errorvalue
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 247, in execute
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      res = self._query(query)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 411, in _query
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      rowcount = self._do_query(q)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 374, in _do_query
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      db.query(q)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 292, in query
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      _mysql.connection.query(self, query)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  _mysql_exceptions.OperationalError: (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  During handling of the above exception, another exception occurred:
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  Traceback (most recent call last):
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewxd", line 148, in main
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      engine = weewx.engine.StdEngine(config_dict)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 75, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.loadServices(config_dict)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/engine.py", line 138, in loadServices
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      obj = weeutil.weeutil.get_object(svc)(self,config_dict)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/wxservices.py", line 81, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      engine.db_binder)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/wxservices.py", line 124, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      initialize=True)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 530, in get_manager
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 680, in open_manager
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      manager_dict['schema'])
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 163, in open_with_create
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      dbmanager = cls(connection, table_name=table_name, schema=schema)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 818, in __init__
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      self._initialize_day_tables(schema)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weewx/manager.py", line 867, in _initialize_day_tables
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      cursor.execute(sql_create_str)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****    File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****      raise klass(e)
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  weedb.TableExistsError: (1050, "Table 'archive_day_altimeter' already exists")
Jun  2 22:54:50 raspberrypi weewx[628] CRITICAL __main__:     ****  Exiting.
Jun  2 22:54:58 raspberrypi systemd[1]: Created slice User Slice of UID 1000.
Jun  2 22:54:58 raspberrypi systemd[1]: Starting User Runtime Directory /run/user/1000...
Jun  2 22:54:58 raspberrypi systemd[1]: Started User Runtime Directory /run/user/1000.
Jun  2 22:54:58 raspberrypi systemd[1]: Starting User Manager for UID 1000...
Jun  2 22:54:59 raspberrypi systemd[845]: Listening on GnuPG network certificate management daemon.
Jun  2 22:54:59 raspberrypi systemd[845]: Listening on GnuPG cryptographic agent and passphrase cache.
Jun  2 22:54:59 raspberrypi systemd[845]: Reached target Timers.
Jun  2 22:54:59 raspberrypi systemd[845]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Jun  2 22:54:59 raspberrypi systemd[845]: Reached target Paths.
Jun  2 22:54:59 raspberrypi systemd[845]: Starting D-Bus User Message Bus Socket.
Jun  2 22:54:59 raspberrypi systemd[845]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Jun  2 22:54:59 raspberrypi systemd[845]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Jun  2 22:54:59 raspberrypi systemd[845]: Listening on D-Bus User Message Bus Socket.
Jun  2 22:54:59 raspberrypi systemd[845]: Reached target Sockets.
Jun  2 22:54:59 raspberrypi systemd[845]: Reached target Basic System.
Jun  2 22:54:59 raspberrypi systemd[1]: Started User Manager for UID 1000.
Jun  2 22:54:59 raspberrypi systemd[1]: Started Session c1 of user pi.
Jun  2 22:54:59 raspberrypi systemd[845]: Reached target Default.
Jun  2 22:54:59 raspberrypi systemd[845]: Startup finished in 495ms.
Jun  2 22:55:02 raspberrypi CRON[881]: (pi) CMD (~/duckdns/duck.sh >/dev/null 2>&1)
Jun  2 22:56:52 raspberrypi systemd[1]: Started Session c2 of user pi.
Jun  2 22:58:02 raspberrypi systemd[1]: session-c2.scope: Succeeded.
Jun  2 23:00:01 raspberrypi CRON[946]: (pi) CMD (~/duckdns/duck.sh >/dev/null 2>&1)
Jun  2 23:02:29 raspberrypi systemd[1]: Started Session c3 of user pi.
Jun  2 23:02:42 raspberrypi systemd[1]: Started Session c4 of user pi.

gjr80

unread,
Jun 2, 2020, 9:29:28 AM6/2/20
to weewx-user
Have you tried using wee_database to first drop the daily summaries and then rebuild them?

Gary

Neville Davis

unread,
Jun 2, 2020, 9:45:59 AM6/2/20
to weewx-user
yes unfortunately several times.

I have the sql backup on the mac desktop...I have just dropped the db again and created another weewx db from the pi and just started to import about 300Meg of data in archive.

Just reported finished this time I will just fire up weewx and see what happens

Nev

Neville Davis

unread,
Jun 2, 2020, 9:53:57 AM6/2/20
to weewx-user
Just crashed again it's now 11:45 pm so will sleep on it.

I had gone through this process during my build with weewx v4.0 had no problems then, don't think I have done anything other than extend the database...???

I can see the tables generated by using Sequel Pro (my tool to move and backup) 

All the tables seem to be correctly generated with no content.

Neville

gjr80

unread,
Jun 2, 2020, 10:59:18 AM6/2/20
to weewx-user
Ok, just to be very specific, you have run the following two commands exactly:

$ wee_database —drop-daily
$ wee_database —rebuild-daily

You use the phrase ‘drop the database’, that is different to dropping and rebuilding the daily summary tables.

Gary

Neville Davis

unread,
Jun 2, 2020, 4:26:40 PM6/2/20
to weewx-user
Yes these are the exact commandsI use the same as I have used many times before. 
As the issue happened several times I deleted all databases I had in MySQL, created new dB called weewx and imported my backup. This procedure I used as part of my rebuild of system on other occasions. The backupI was using is the one I created before the upgrade to 4.1 from 4.0.
I then have a weewx dB with archive only existing.
I then run rebuild daily...the daily tables are created with their structure and the rebuild fails at this point.

Neville

gjr80

unread,
Jun 2, 2020, 4:34:56 PM6/2/20
to weewx-user
Ok, could you please run those two wee_database commands again one after each other and post the console output making sure you include the commands entered as well as the output.

Gary

Neville Davis

unread,
Jun 2, 2020, 5:01:10 PM6/2/20
to weewx-user
OK here it is

Last login: Tue Jun  2 23:32:02 2020 from 192.168.0.54

pi@raspberrypi:~ $ cd /home/weewx/bin

pi@raspberrypi:/home/weewx/bin $ ./wee_database /home/weewx/weewx.conf --drop-daily

Using configuration file /home/weewx/weewx.conf

Using database binding 'wx_binding', which is bound to database 'archive_mysql'

Proceeding will delete all your daily summaries from database 'weewx'

Are you sure you want to proceed (y/n)? y

Dropping daily summary tables from 'weewx' ... 

No daily summaries found in database 'weewx'. Nothing done.

pi@raspberrypi:/home/weewx/bin $ ./wee_database /home/weewx/weewx.conf --rebuild-daily

Using configuration file /home/weewx/weewx.conf

Using database binding 'wx_binding', which is bound to database 'archive_mysql'

All daily summaries will be rebuilt.

Proceed (y/n)? y

Traceback (most recent call last):

  File "/home/weewx/bin/weedb/mysql.py", line 52, in guarded_fn

    return fn(*args, **kwargs)

  File "/home/weewx/bin/weedb/mysql.py", line 262, in execute

    self.cursor.execute(mysql_string, tuple(sql_tuple))

  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 250, in execute

    self.errorhandler(self, exc, value)

  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler

    raise errorvalue

  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 247, in execute

    res = self._query(query)

  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 411, in _query

    rowcount = self._do_query(q)

  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 374, in _do_query

    db.query(q)

  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 292, in query

    _mysql.connection.query(self, query)

_mysql_exceptions.OperationalError: (1050, "Table 'archive_day_altimeter' already exists")


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "./wee_database", line 974, in <module>

    main()

  File "./wee_database", line 169, in main

    rebuildDaily(config_dict, db_binding, options)

  File "./wee_database", line 264, in rebuildDaily

    with weewx.manager.open_manager_with_config(config_dict, db_binding, initialize=True) as dbmanager:

  File "/home/weewx/bin/weewx/manager.py", line 692, in open_manager_with_config

    return open_manager(manager_dict, initialize)

  File "/home/weewx/bin/weewx/manager.py", line 680, in open_manager

    manager_dict['schema'])

  File "/home/weewx/bin/weewx/manager.py", line 163, in open_with_create

    dbmanager = cls(connection, table_name=table_name, schema=schema)

  File "/home/weewx/bin/weewx/manager.py", line 818, in __init__

    self._initialize_day_tables(schema)

  File "/home/weewx/bin/weewx/manager.py", line 867, in _initialize_day_tables

    cursor.execute(sql_create_str)

  File "/home/weewx/bin/weedb/mysql.py", line 61, in guarded_fn

    raise klass(e)

weedb.TableExistsError: (1050, "Table 'archive_day_altimeter' already exists")

pi@raspberrypi:/home/weewx/bin $ 

Neville Davis

unread,
Jun 2, 2020, 10:01:14 PM6/2/20
to weewx-user
Well I am operational again...but running on 4.0. Managed to get my backup data installed and rebuilt daily...Going to let it run for a few days, to make sure it’s stable.
Going to look at logs to see if anything stands out...

Neville
Reply all
Reply to author
Forward
0 new messages