MySql Create tables crash

30 views
Skip to first unread message

Jaap de Munck

unread,
Jan 7, 2020, 4:16:20 PM1/7/20
to weewx-development
Hello,

Problem with MySql and create new table.

weewx.manager: Created and initialized table 'archive5' in database 'weewx'
weewx.engine: Caught unrecoverable exception:
  (1050, "Table 'archive_day_barometer' already exists")
  Traceback (most recent call last):
    File "/home/weewx/bin/weedb/mysql.py", line 51, in guarded_fn
      return fn(*args, **kwargs)
    File "/home/weewx/bin/weedb/mysql.py", line 261, 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_barometer' already exists")

Its from a new test system. (Installed with install-weewx.sh).
At first start an Sqlite database is created (can all be seen in attached logging). Stopped.
Configuration was then changed to a MySql database: The current MySql database schema/user (for the 'production' system) but with a new tablename archive5.
Tabel archive5 is created ok.

Regards,
Jaap
syslog.txt

Thomas Keffer

unread,
Jan 7, 2020, 7:59:39 PM1/7/20
to weewx-development
Yup. That's a bug! Fixed in commit 6ad9870.

Thanks, Jaap.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/a9eb77ce-82f9-44e2-9bd1-6d21c4323add%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages