martin@raspberrypi:~ $ sudo echo "PRAGMA integrity_check;" | sudo sqlite3 /var/lib/weewx/weedb.sdb
ok
martin@raspberrypi:~ $

------ Original Meddelelse ------
Fra: "Thomas Keffer" <tkef...@gmail.com>
Til: "weewx-user" <weewx-user@googlegroups.com>
Sendt: 14-11-2019 21:04:48
Emne: Re: [weewx-user] corrupt database

You can do an integrity check on the database. You may have to install the command line utility sqlite3 first:

sudo apt-get install sqlite3

then

echo "PRAGMA integrity_check;" | sqlite3 /var/lib/weewx/weedb.sdb

-tk

On Thu, Nov 14, 2019 at 11:51 AM Paolo Benvenuto <paolobe...@gmail.com> wrote:
Hi! following a power failure I cannot start weewx any more:

 $ sudo service weewx status
● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated; vendor preset: enabled)
   Active: active (exited) since Thu 2019-11-14 20:17:02 CET; 13min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1530 ExecStop=/etc/init.d/weewx stop (code=exited, status=0/SUCCESS)
  Process: 1542 ExecStart=/etc/init.d/weewx start (code=exited, 
status=0/SUCCESS)

nov 14 20:17:02 raspberrypi weewx[1558]:     ****    File 
"/usr/share/weewx/weewx/manager.py", line 1157, in __init__
nov 14 20:17:02 raspberrypi weewx[1558]:     ****      super(DaySummaryManager, 
self).__init__(connection, table_name, schema)
nov 14 20:17:02 raspberrypi weewx[1558]:     ****    File 
"/usr/share/weewx/weewx/manager.py", line 73, in __init__
nov 14 20:17:02 raspberrypi weewx[1558]:     ****      self.sqlkeys = 
self.connection.columnsOf(self.table_name)
nov 14 20:17:02 raspberrypi weewx[1558]:     ****    File 
"/usr/share/weewx/weedb/sqlite.py", line 167, in columnsOf
nov 14 20:17:02 raspberrypi weewx[1558]:     ****      column_list = [row[1] 
for row in self.genSchemaOf(table)]
nov 14 20:17:02 raspberrypi weewx[1558]:     ****    File 
"/usr/share/weewx/weedb/sqlite.py", line 156, in genSchemaOf
nov 14 20:17:02 raspberrypi weewx[1558]:     ****      for row in 
self.connection.execute("""PRAGMA table_info(%s);""" % table):
nov 14 20:17:02 raspberrypi weewx[1558]:     ****  DatabaseError: malformed 
database schema (?)
nov 14 20:17:02 raspberrypi weewx[1558]:     ****  Exiting.

The sqlite db seems corrupted. Any hint?


--
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. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/90ea9a7b-01aa-48e8-96c1-f660d0e5d951%40googlegroups.com <https://groups.google.com/d/msgid/weewx-user/90ea9a7b-01aa-48e8-96c1-f660d0e5d951%40googlegroups.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 weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEBTX15hCEu8g8-OGUS2-qsoJGwpD3-%2BnOg73cvtNi1NWQ%40mail.gmail.com <https://groups.google.com/d/msgid/weewx-user/CAPq0zEBTX15hCEu8g8-OGUS2-qsoJGwpD3-%2BnOg73cvtNi1NWQ%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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/em180a6958-41db-4aaf-bd61-67714f14f9f8%40desktop-sudekda.

Reply via email to