I'd say somewhere along the way your sqlite file got damaged. Did you
change from 32-bit to 64-bit when you did the OS upgrade?

Do you have a backup?

If not, you may be able to use the ".recover" command in the
utility sqlite3. See
https://www.sqlite.org/cli.html#recover_data_from_a_corrupted_database

-tk

On Tue, Jul 4, 2023 at 2:04 PM Yves Martin <[email protected]> wrote:

> Hi,
>
> I've upgraded the Debian distribution (from version 7 to 10) and Python
> 2.7 to 3.8.
>
> I've copied the sqlite database in /var/lib/weewx/ to the new distribution.
>
> Unfortunately, when I start weewx, I have this error :
>
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****    File "/usr/share/weewx/weewx/manager.py", line 130, in __init__
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****      self.sqlkeys = self.connection.columnsOf(self.table_name)
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****    File "/usr/share/weewx/weedb/sqlite.py", line 187, in columnsOf
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****      column_list = [row[1] for row in self.genSchemaOf(table)]
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****    File "/usr/share/weewx/weedb/sqlite.py", line 187, in <listcomp>
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****      column_list = [row[1] for row in self.genSchemaOf(table)]
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****    File "/usr/share/weewx/weedb/sqlite.py", line 176, in genSchemaOf
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****      for row in self.connection.execute("""PRAGMA table_info(%s);"""
> % table):
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****  sqlite3.DatabaseError: database disk image is malformed
> Jul 04 15:17:09 weewx4-raspi python3[377]: weewx[377] CRITICAL __main__:
>   ****  Exiting.
>
> I cannot find here this kind of error.
> Any help or suggestion will be appreciated.
>
> Regards,
> Yves
> YMartin.com/meteo
>
> --
> 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/61339c2c-7deb-4c69-88c8-f2e3a0edcfd2n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/61339c2c-7deb-4c69-88c8-f2e3a0edcfd2n%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEA30%3DyKcJxF_%3D5%2BSc7X%2BR7efqQkDaZH7uk%2B2C%3D5S5YiiQ%40mail.gmail.com.

Reply via email to