Hey George, Have you ever run into this one? My raspberry pi was unresponsive this morning so I power cycled it and when it came back up it looked at the syslog and this is what it is doing when it tries to start weewx.
Jun 6 13:47:01 weatherpi /USR/SBIN/CRON[2775]: (root) CMD (/home/ipwx/./watchdog)
Jun 6 13:47:02 weatherpi weewx[2793]: engine: Initializing weewx version 3.1.0
Jun 6 13:47:02 weatherpi weewx[2793]: engine: Using Python 2.7.3 (default, Mar 18 2014, 05:13:23) #012[GCC 4.6.3]
Jun 6 13:47:02 weatherpi weewx[2793]: engine: pid file is /var/run/weewx.pid
Jun 6 13:47:02 weatherpi weewx[2795]: engine: Using configuration file /etc/weewx/weewx.conf
Jun 6 13:47:02 weatherpi weewx[2795]: engine: Loading station type Simulator (weewx.drivers.simulator)
Jun 6 13:47:02 weatherpi weewx[2795]: engine: StdConvert target unit is 0x1
Jun 6 13:47:02 weatherpi /USR/SBIN/CRON[2774]: (CRON) info (No MTA installed, discarding output)
Jun 6 13:47:02 weatherpi weewx[2795]: engine: Archive will use data binding wx_binding
Jun 6 13:47:02 weatherpi weewx[2795]: engine: Record generation will be attempted in 'hardware'
Jun 6 13:47:02 weatherpi weewx[2795]: engine: Using archive interval of 60 seconds
Jun 6 13:47:02 weatherpi weewx[2795]: engine: Caught unrecoverable exception in engine:
Jun 6 13:47:02 weatherpi weewx[2795]: **** database disk image is malformed
Jun 6 13:47:02 weatherpi weewx[2795]: **** Traceback (most recent call last):
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/engine.py", line 831, in main
Jun 6 13:47:02 weatherpi weewx[2795]: **** engine = EngineClass(config_dict)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/engine.py", line 77, in __init__
Jun 6 13:47:02 weatherpi weewx[2795]: **** self.loadServices(config_dict)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/engine.py", line 141, in loadServices
Jun 6 13:47:02 weatherpi weewx[2795]: **** self.service_obj.append(weeutil.weeutil._get_object(svc)(self, config_dict))
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/engine.py", line 504, in __init__
Jun 6 13:47:02 weatherpi weewx[2795]: **** self.setup_database(config_dict)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/engine.py", line 602, in setup_database
Jun 6 13:47:02 weatherpi weewx[2795]: **** dbmanager = self.engine.db_binder.get_manager(self.data_binding, initialize=True)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/manager.py", line 833, in get_manager
Jun 6 13:47:02 weatherpi weewx[2795]: **** self.manager_cache[data_binding] = open_manager(manager_dict, initialize)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/manager.py", line 915, in open_manager
Jun 6 13:47:02 weatherpi weewx[2795]: **** manager_dict['schema'])
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/manager.py", line 139, in open_with_create
Jun 6 13:47:02 weatherpi weewx[2795]: **** dbmanager = cls(connection, table_name=table_name, schema=schema)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/manager.py", line 1052, in __init__
Jun 6 13:47:02 weatherpi weewx[2795]: **** super(DaySummaryManager, self).__init__(connection, table_name, schema)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weewx/manager.py", line 71, in __init__
Jun 6 13:47:02 weatherpi weewx[2795]: **** self.sqlkeys = self.connection.columnsOf(self.table_name)
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weedb/sqlite.py", line 151, in columnsOf
Jun 6 13:47:02 weatherpi weewx[2795]: **** column_list = [row[1] for row in self.genSchemaOf(table)]
Jun 6 13:47:02 weatherpi weewx[2795]: **** File "/usr/share/weewx/weedb/sqlite.py", line 140, in genSchemaOf
Jun 6 13:47:02 weatherpi weewx[2795]: **** for row in self.connection.execute("""PRAGMA table_info(%s);""" % table):
Jun 6 13:47:02 weatherpi weewx[2795]: **** DatabaseError: database disk image is malformed
Jun 6 13:47:02 weatherpi weewx[2795]: **** Exiting.
I saw someone said you may be able to fix this by using sqlite to dump to a text file then reimporting. I tryed that but it would bnot dump. Here's what I got. Any clue how to repair this db? Or what may have caused the corruption in the first place? It happened this morning at about 6:30. No power hits or anything, the box just locked up at that time.
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
/****** CORRUPTION ERROR *******/
/****** database disk image is malformed ******/
/****** ERROR: database disk image is malformed ******/
/**** ERROR: (11) database disk image is malformed *****/
ROLLBACK; -- due to errors