lnbits: [BUG] Update from 239f166 commit to fe315d0 (origin/main now) failed

Describe the bug

I updated by instruction the version from 239f166a141fa9347ba7ab958c80cbc8804bd8b8 commit to fe315d0a9b97f360c1540509654dce91568bdf45 and cannot run - throw error

To Reproduce Steps to reproduce the behavior:

  1. Install 239f166a141fa9347ba7ab958c80cbc8804bd8b8 commit version
  2. Set up the config AdminUI version and LndRestWallet type
  3. Everything works fine (REST point is OK, macaroon is OK)
  4. Update through console as described in “Update LNbits” section to origin/main branch (the current is fe315d0a9b97f360c1540509654dce91568bdf45 commit)
  5. Restart LNBits and get errors (with same config and with LNBITS_ADMIN_UI=false too)
  6. If I do downgrade - everything works again

Additional context

Error of stack trace after upgrade:

2023-04-18 17:26:19.41 | ERROR | cannot initialize lndrest
2023-04-18 17:26:19.41 | ERROR | Traceback (most recent call last):
  File "/home/lnbits/lnbits/lnbits/app.py", line 288, in lnbits_startup
    set_wallet_class()
  File "/home/lnbits/lnbits/lnbits/settings.py", line 326, in set_wallet_class
    WALLET = wallet_class()
  File "/home/lnbits/lnbits/lnbits/wallets/lndrest.py", line 43, in __init__
    raise Exception("cannot initialize lndrest")
Exception: cannot initialize lndrest

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lnbits/.cache/pypoetry/virtualenvs/lnbits-Me3QFGJB-py3.9/lib/python3.9/site-packages/starlette/routing.py", line 635, in lifespan
    async with self.lifespan_context(app):
  File "/home/lnbits/.cache/pypoetry/virtualenvs/lnbits-Me3QFGJB-py3.9/lib/python3.9/site-packages/starlette/routing.py", line 530, in __aenter__
    await self._router.startup()
  File "/home/lnbits/.cache/pypoetry/virtualenvs/lnbits-Me3QFGJB-py3.9/lib/python3.9/site-packages/starlette/routing.py", line 612, in startup
    await handler()
  File "/home/lnbits/lnbits/lnbits/app.py", line 298, in lnbits_startup
    raise ImportError("Failed to run 'startup' event.")
ImportError: Failed to run 'startup' event.

2023-04-18 17:26:19.41 | ERROR | Application startup failed. Exiting.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 44 (43 by maintainers)

Most upvoted comments

it is merged into main, but not in the latest version

truncating the settings table will work it will regenerate the superuser each time

I found in docs other way

“After the settings are “reset to defaults” and restarted a new super user is created”.

I started the server in admin ui and pressed the “RESET TO DEFAULTS”. So now I have other admin ui user 😉

Pinging @dni