CounterpartyXCP / counterparty-core

Counterparty Protocol Reference Implementation
http://counterparty.io
MIT License
284 stars 206 forks source link

API db not closed correctly #2011

Closed ouziel-slama closed 1 day ago

ouziel-slama commented 4 days ago
ERROR:root:SQLITE_LOG: recovered 270 frames from WAL file /data/counterparty/counterparty.api.db-wal (283) SQLITE_NOTICE_RECOVER_WAL

on startup

adamkrellenstein commented 4 days ago

Got this with the apidb branch:

2024-07-04T18:01:52.830370000+02:00 - [    INFO] - Adding transaction_count column to blocks table...
ERROR:root:SQLITE_LOG: statement aborts at 3: [
        CREATE TABLE IF NOT EXISTS addresses(
            address TEXT,
            options INTEGER,
            block_index INTEGER
        )
    ] database schema has changed (17) SQLITE_SCHEMA
ouziel-slama commented 1 day ago

For some unknown reason the WAL file is not deleted even though all connections are closed. I suspect this is due to a sub-process authorization problem but I'm not sure. So far I have found this workaround which works well: https://github.com/CounterpartyXCP/counterparty-core/pull/2031/commits/92390cd9da89a67e63f70c0d8f1c1be7fc3e36ff The WAL and SHM files are deleted.

ouziel-slama commented 1 day ago

ok I understood the problem: the last closed connection must not be read-only to be able to correctly delete the WAL and SHM files..