Open dappelt opened 7 years ago
This sounds this issue: https://github.com/tgriesser/knex/issues/1701
Note that to reproduce with current ledger you have to access /accounts
because the root endpoint no longer accesses the database.
I tried the same (LEDGER_ADMIN_PASS=mypassword LEDGER_DB_URI=sqlite://:memory: npm start
), and I get the same error when doing PUT /accounts/alice
:
Unhandled rejection Error: SQLITE_ERROR: no such table: L_ACCOUNTS
Thanks for reporting. Currently, sqlite in-memory databases do not work very reliably with five-bells-ledger
. As a workaround, try to store the sqlite database in a file, e.g. LEDGER_ADMIN_PASS=mypassword LEDGER_DB_URI=sqlite:///some/path/ledger.sqlite npm start
or use postgres.
Description
When starting the ledger with an in-memory sqlite database, the database disappears after a few minutes. When the ledger tries to query a (non-existing) table, it crashes.
Steps to reproduce
Open terminal, switch into the root folder of the ledger repo and run
Wait a few minutes. Then, execute
curl http://localhost:3001
and the ledger will fail with:The problem might be that the connection to the in-memory database is released and, thus, sqlite removes the database. See here.