Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookkeeper: upgrade from 24.05 to 24.08.1 fails due to ERROR: column "spliced" does not exist #7695

Open
whitslack opened this issue Sep 24, 2024 · 1 comment
Assignees
Milestone

Comments

@whitslack
Copy link
Collaborator

Issue and Steps to Reproduce

  1. Have a working CLN 24.05 node running on a PostgreSQL 15 back end.
  2. Upgrade CLN to 24.08.1.
  3. Attempt to start the node.
  4. CRASH!
    2024-09-24T06:42:43.825Z INFO    plugin-bookkeeper: Killing plugin: exited before replying to init
    2024-09-24T06:42:43.825Z **BROKEN** plugin-bookkeeper: Plugin marked as important, shutting down lightningd!
    

The following error message is emitted on stderr from the lightningd process:

Error executing statement: ERROR:  current transaction is aborted, commands ignored until end of transaction block

The PostgreSQL server error log contains:

2024-09-24 02:42:43.460 EDT [6697] ERROR:  column "spliced" does not exist at character 8
2024-09-24 02:42:43.460 EDT [6697] STATEMENT:  SELECT spliced FROM chain_events
2024-09-24 02:42:43.461 EDT [6697] ERROR:  current transaction is aborted, commands ignored until end of transaction block
2024-09-24 02:42:43.461 EDT [6697] STATEMENT:  ALTER TABLE chain_events ADD spliced INTEGER DEFAULT 0;

It looks like Bookkeeper is trying to access the column spliced in table chain_events before it attempts to alter the table to add the column to it. Because the initial SELECT query fails, the subsequent ALTER TABLE statement in the same transaction is rejected. You need to roll back the failed transaction before you attempt to upgrade the schema.

@whitslack
Copy link
Collaborator Author

I was able to get my node to start by manually executing ALTER TABLE chain_events ADD spliced INTEGER DEFAULT 0; on the Bookkeeper's database. Crisis averted. 😌 Still, the migration ought to be corrected.

@rustyrussell rustyrussell added this to the v24.11 milestone Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants