Skip to content

sqlite crash when --daemon flag used #1420

Closed

Description

@kirtixs

lightnind crashes after pulling the latest master (89ff46f).
The error is sqlite3_close: unable to close due to unfinalized statements or unfinished backups.

This also happens with a completely new sqlite database: I made a backup of the current sqlite db and removed it, started lightningd again with --port 0.

Activity

  1. ZmnSCPxj commented on Apr 25, 2018

    @ZmnSCPxj
    Contributor

    You are using --daemon?

  2. kirtixs commented on Apr 25, 2018

    @kirtixs
    Author

    Yes, this is the command I use to start lightningd:
    ./lightningd/lightningd --network bitcoin --log-level debug --alias [hidden] --log-file /home/bitcoin/lightning.log --daemon

    There is no additional information in the log, the last line is just Listening on 'lightning-rpc'

  3. ZmnSCPxj commented on Apr 25, 2018

    @ZmnSCPxj
    Contributor

    It seems some of the recent code rearrangement around db close-fork-db reopen process for --daemon failed.

    Without --daemon I suspect highly it will succeed to start, so if you need to keep your node up then try running without --daemon in the meantime. We will need to investigate this further, please wait.

  4. kirtixs commented on Apr 25, 2018

    @kirtixs
    Author

    Thanks, that works

  5. 9735dev commented on Apr 25, 2018

    @9735dev

    Starting without --daemon gets me past this crash too.

    Here are the last debug log entries before the crash at startup that I see:

    2018-04-25T19:05:19.153Z lightningd(31089): Loaded 0 HTLC signatures from DB
    2018-04-25T19:05:19.153Z lightningd(31089): Loaded 1 channels from DB
    2018-04-25T19:05:19.153Z lightningd(31089): Loading HTLCs for channel 1
    2018-04-25T19:05:19.157Z lightningd(31089): Restored 0 incoming and 0 outgoing HTLCS
    2018-04-25T19:05:19.473Z lightningd(31089): Adding block 519547: 00000000000000000015514c89c449945862f8cd61df6532256ae2452b3c2c0a
    2018-04-25T19:05:19.485Z lightningd(31089): Listening on 'lightning-rpc'
    
  6. changed the title [-]sqlite crash[/-] [+]sqlite crash when `--daemon` flag used[/+] on Apr 26, 2018
  7. self-assigned this
    on Apr 26, 2018
  8. added a commit that references this issue on Apr 26, 2018
    1bcfb3e
  9. Rav3nPL commented on Apr 26, 2018

    @Rav3nPL

    It still exists, if you start fresh with --daemon.
    If you start w/o --daemon and close, then --daemon works fine.

  10. 9735dev commented on Apr 27, 2018

    @9735dev

    To follow-up on @Rav3nPL's comment, if you start a new node with the daemon flag, like below, it fails with this error still. You have to start without --daemon one time. Then after the first successful run, you can use daemon.

    Easy to reproduce with the following as of commit 69cdfba:

    /lightning/lightningd/lightningd --daemon --network=regtest --port=9735 --lightning-dir=/tmp/l1 --bitcoin-datadir=/tmp/n1 --log-file=server.log --log-level=debug --bitcoin-cli=/bitcoin/src/bitcoin-cli --bitcoin-rpcuser=n1 --bitcoin-rpcpassword=n1 --override-fee-rates=253/253/253
    

    This first start problem appears to be fixed by #1430 commit 6308c1f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions