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

summary.py: cannot add item to database #365

Open
laanwj opened this issue May 17, 2022 · 2 comments
Open

summary.py: cannot add item to database #365

laanwj opened this issue May 17, 2022 · 2 comments

Comments

@laanwj
Copy link
Contributor

laanwj commented May 17, 2022

Just got the following error in my log related to summary.py:

2022-05-16T09:25:55.337Z UNUSUAL plugin-summary.py: [PeerThread] cannot add item to database

This was printed on stderr:

HASH: Out of overflow pages.  Increase page size

The plugin is still working but some information must have gotten lost. (no, it isn't, see next post)

I'm fairly sure this is an error with shelve (lots of hits on the internet), or more specifically, the dbm database it choses. FWIW:

>>> dbm.whichdb('summary.dat')
'dbm.ndbm'

There are tons of known issues with dbm, it's a very primitive database, that randomly breaks then requires manual tuning of parameters considered unacceptable nowadays (some discussion here). I think it would make sense to switch to sqlite3 (possibly through sqlitedict, a drop-in replacement).

@laanwj
Copy link
Contributor Author

laanwj commented May 18, 2022

I'm not sure if it's the same issue, but the summary plugin completely refuses to load now:

2022-05-17T19:22:13.394Z INFO    plugin-summary.py: Killing plugin: exited before replying to init

No further errors in the log.

Edit: yes, it seems related. It crashes on a simple database lookup:

    if 'peerstate' not in plugin.persist:

Edit.2: no, it gets past the lookup. What it crashes on is:

        plugin.persist['peerstate'] = {}
        plugin.persist['availcount'] = 0

Manually reproducible:

>>> import shelve
>>> db = shelve.open('summary.dat', writeback=True)
>>> db['peerstate']={}
Segmentation fault

@x3nb63
Copy link

x3nb63 commented Feb 24, 2023

i observed very excessive logging of this cannot add item to database line and had to stop the plugin

dont understand it cause the rest of lightningd worked fine, adding things to its db.

did not figure how to re-produce except for listing the summary until it starts logging

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

2 participants