mynodebtc / mynode

The easiest way to run Bitcoin and Lightning!
Other
649 stars 148 forks source link

docker: Error response - Unable to find image 'lnbits-legend:latest' locally [11152] #752

Closed btcforplebs closed 8 months ago

btcforplebs commented 1 year ago

Upon upgrade of 0.3.10 - LNbits returns error codes and 502 bad gateway. reinstalling the LNbits instance does not fix the issue

Status repeats this log Feb 24 07:06:27 myNode systemd[1]: lnbits.service: Failed with result 'exit-code'. Feb 24 07:06:27 myNode systemd[1]: lnbits.service: Main process exited, code=exited, status=125/n/a Feb 24 07:06:27 myNode lnbits[11152]: See 'docker run --help'. Feb 24 07:06:27 myNode lnbits[11152]: docker: Error response from daemon: pull access denied for lnbits-legend, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. Feb 24 07:06:25 myNode lnbits[11152]: Unable to find image 'lnbits-legend:latest' locally Feb 24 07:06:24 myNode systemd[1]: Started LNBits. Feb 24 07:06:24 myNode lnbits[11148]: + sed -i 's|^LND_REST_MACAROON=.*|LND_REST_MACAROON="/app/admin.macaroon"|g' /opt/mynode/lnbits/.env Feb 24 07:06:24 myNode lnbits[11148]: + cp /usr/share/mynode/lnbits.env /opt/mynode/lnbits/.env Feb 24 07:06:24 myNode lnbits[11113]: LND is ready. Feb 24 07:06:24 myNode lnbits[11113]: "synced_to_chain": true, Feb 24 07:06:24 myNode lnbits[11113]: Checking if LND is synced... Feb 24 07:06:24 myNode lnbits[11095]: Not shutting down! Feb 24 07:06:24 myNode lnbits[11095]: Checking if device is shutting down... Feb 24 07:06:24 myNode systemd[1]: Starting LNBits...

image

Desktop (please complete the following information): Orion 0.99.123.3-beta

MyNode hardware (please complete the following information): Raspi4

lollenderrofler commented 1 year ago

I have the same issue, running the VM image. I had to downgrade to get it running again. The issue was also addressed to lnbits on their GitHub and according to this thread it should be solved on the newest version. I did not confirm this myself, still running the downgraded version.

tehelsper commented 1 year ago

Try version v0.3.12 - it has solved several docker issues with recent versions of docker. Also, try upgrading to the 64-bit mynode os if you are still on 32-bit.

PraiaBitcoin commented 1 year ago

Hello, I upgraded to version 0.3.15 from 0.3.12 and lnbits stopped to work

-- Logs begin at Wed 2023-04-19 14:58:54 CDT, end at Wed 2023-04-19 15:00:58 CDT. --
Apr 19 15:00:54 myNode lnbits[23378]: 2023-04-19 20:00:54.80 | ERROR | Application startup failed. Exiting.
Apr 19 15:00:54 myNode lnbits[23378]: ImportError: Failed to run 'startup' event.
Apr 19 15:00:54 myNode lnbits[23378]:     raise ImportError("Failed to run 'startup' event.")
Apr 19 15:00:54 myNode lnbits[23378]:   File "/app/lnbits/app.py", line 281, in lnbits_startup
Apr 19 15:00:54 myNode lnbits[23378]:     await handler()
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 612, in startup
Apr 19 15:00:54 myNode lnbits[23378]:     await self._router.startup()
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 530, in __aenter__
Apr 19 15:00:54 myNode lnbits[23378]:     async with self.lifespan_context(app):
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 635, in lifespan
Apr 19 15:00:54 myNode lnbits[23378]: Traceback (most recent call last):
Apr 19 15:00:54 myNode lnbits[23378]: During handling of the above exception, another exception occurred:
Apr 19 15:00:54 myNode lnbits[23378]: (Background on this error at: http://sqlalche.me/e/13/4xp6)
Apr 19 15:00:54 myNode lnbits[23378]: [SQL: SELECT * FROM sqlite_master WHERE type='table' AND name='dbversions']
Apr 19 15:00:54 myNode lnbits[23378]: sqlalchemy.exc.DatabaseError: (sqlite3.DatabaseError) file is not a database
Apr 19 15:00:54 myNode lnbits[23378]:     cursor.execute(statement, parameters)
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
Apr 19 15:00:54 myNode lnbits[23378]:     self.dialect.do_execute(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Apr 19 15:00:54 myNode lnbits[23378]:     raise exception
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
Apr 19 15:00:54 myNode lnbits[23378]:     util.raise_(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1510, in _handle_dbapi_exception
Apr 19 15:00:54 myNode lnbits[23378]:     self._handle_dbapi_exception(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1316, in _execute_context
Apr 19 15:00:54 myNode lnbits[23378]:     ret = self._execute_context(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1172, in _execute_text
Apr 19 15:00:54 myNode lnbits[23378]:     return self._execute_text(object_, multiparams, params)
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1003, in execute
Apr 19 15:00:54 myNode lnbits[23378]:     raise captured_error
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/outcome/_impl.py", line 138, in unwrap
Apr 19 15:00:54 myNode lnbits[23378]:     return request.response.unwrap()
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy_aio/asyncio.py", line 70, in run
Apr 19 15:00:54 myNode lnbits[23378]:     return await _self._worker.run(_func, args, kwargs)
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy_aio/base.py", line 234, in _run_in_thread
Apr 19 15:00:54 myNode lnbits[23378]:     rp = await self._run_in_thread(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy_aio/base.py", line 291, in execute
Apr 19 15:00:54 myNode lnbits[23378]:     result = await self.conn.execute(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/app/lnbits/db.py", line 107, in fetchone
Apr 19 15:00:54 myNode lnbits[23378]:     exists = await conn.fetchone(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/app/lnbits/commands.py", line 60, in migrate_databases
Apr 19 15:00:54 myNode lnbits[23378]:     await migrate_databases()
Apr 19 15:00:54 myNode lnbits[23378]:   File "/app/lnbits/app.py", line 263, in lnbits_startup
Apr 19 15:00:54 myNode lnbits[23378]: Traceback (most recent call last):
Apr 19 15:00:54 myNode lnbits[23378]: The above exception was the direct cause of the following exception:
Apr 19 15:00:54 myNode lnbits[23378]: sqlite3.DatabaseError: file is not a database
Apr 19 15:00:54 myNode lnbits[23378]:     cursor.execute(statement, parameters)
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
Apr 19 15:00:54 myNode lnbits[23378]:     self.dialect.do_execute(
Apr 19 15:00:54 myNode lnbits[23378]:   File "/usr/local/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
Apr 19 15:00:54 myNode lnbits[23378]: 2023-04-19 20:00:54.80 | ERROR | Traceback (most recent call last):
Apr 19 15:00:54 myNode lnbits[23378]: (Background on this error at: http://sqlalche.me/e/13/4xp6)
Apr 19 15:00:54 myNode lnbits[23378]: [SQL: SELECT * FROM sqlite_master WHERE type='table' AND name='dbversions']
Apr 19 15:00:54 myNode lnbits[23378]: 2023-04-19 20:00:54.79 | ERROR | (sqlite3.DatabaseError) file is not a database
Apr 19 15:00:54 myNode lnbits[23378]: 2023-04-19 20:00:54.78 | INFO | Waiting for application startup.
Apr 19 15:00:54 myNode lnbits[23378]: 2023-04-19 20:00:54.78 | INFO | Started server process [12]
theerror commented 1 year ago

My guess is, that there are issues with dependency during building of image. I can see it in docker build logs. As LNDBit using postgres, it might by related.

Sep 07 11:33:24 myNode mynode_docker_images[6074]: + echo 0.10.6
Sep 07 11:33:24 myNode mynode_docker_images[6074]: ERROR: failed to solve: process "/bin/sh -c apt-get install -y postgresql-client-14" did not complete successfully: exit code: 100
Sep 07 11:33:24 myNode mynode_docker_images[6074]: --------------------
Sep 07 11:33:24 myNode mynode_docker_images[6074]:   17 |     WORKDIR /app
Sep 07 11:33:24 myNode mynode_docker_images[6074]:   16 |
Sep 07 11:33:24 myNode mynode_docker_images[6074]:   15 | >>> RUN apt-get install -y postgresql-client-14
Sep 07 11:33:24 myNode mynode_docker_images[6074]:   14 |     RUN apt-get update
Sep 07 11:33:24 myNode mynode_docker_images[6074]:   13 |     RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
Sep 07 11:33:24 myNode mynode_docker_images[6074]: --------------------
Sep 07 11:33:24 myNode mynode_docker_images[6074]: Dockerfile:15
Sep 07 11:33:24 myNode mynode_docker_images[6074]: ------
Sep 07 11:33:24 myNode mynode_docker_images[6074]: 2.436 E: Unable to correct problems, you have held broken packages.
Sep 07 11:33:24 myNode mynode_docker_images[6074]: 2.434                         Depends: libssl1.1 (>= 1.1.0) but it is not installable
Sep 07 11:33:24 myNode mynode_docker_images[6074]: 2.434  postgresql-client-14 : Depends: libpq5 (>= 14.9) but it is not going to be installed
Sep 07 11:33:24 myNode mynode_docker_images[6074]: 2.224 The following packages have unmet dependencies:

in my case, problem is simple - it adds wrong repository. I do have buster

admin@myNode:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:    10
Codename:   buster

but it trying to use / install it from bullseye

Sep 07 11:33:15 myNode mynode_docker_images[6074]: #11 [ 7/15] RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list
Sep 07 11:33:16 myNode mynode_docker_images[6074]: #11 DONE 0.8s

what is obviously wrong and incompatible. When I set it properly...

# Create the file repository configuration:
sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

# Import the repository signing key:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

# Update the package lists:
sudo apt-get update

I do not have any issue install the package there:

root@myNode:~# apt-get install postgresql-client-14
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  linux-image-4.19.0-21-amd64
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  libpq-dev libpq5 postgresql-client-common
Suggested packages:
  postgresql-doc-15 postgresql-14 postgresql-doc-14
The following NEW packages will be installed:
  postgresql-client-14 postgresql-client-common
The following packages will be upgraded:
  libpq-dev libpq5
2 upgraded, 2 newly installed, 0 to remove and 13 not upgraded.
Need to get 2,042 kB of archives.
After this operation, 7,645 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 libpq-dev amd64 15.4-1.pgdg100+1 [141 kB]
Get:2 https://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 libpq5 amd64 15.4-1.pgdg100+1 [185 kB]
Get:3 https://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-client-common all 253.pgdg100+1 [93.5 kB]
Get:4 https://apt.postgresql.org/pub/repos/apt buster-pgdg/main amd64 postgresql-client-14 amd64 14.9-1.pgdg100+1 [1,623 kB]
Fetched 2,042 kB in 0s (4,293 kB/s)
Reading changelogs... Done
(Reading database ... 84047 files and directories currently installed.)
Preparing to unpack .../libpq-dev_15.4-1.pgdg100+1_amd64.deb ...
Unpacking libpq-dev (15.4-1.pgdg100+1) over (11.20-0+deb10u1) ...
Preparing to unpack .../libpq5_15.4-1.pgdg100+1_amd64.deb ...
Unpacking libpq5:amd64 (15.4-1.pgdg100+1) over (11.20-0+deb10u1) ...
Selecting previously unselected package postgresql-client-common.
Preparing to unpack .../postgresql-client-common_253.pgdg100+1_all.deb ...
Unpacking postgresql-client-common (253.pgdg100+1) ...
Selecting previously unselected package postgresql-client-14.
Preparing to unpack .../postgresql-client-14_14.9-1.pgdg100+1_amd64.deb ...
Unpacking postgresql-client-14 (14.9-1.pgdg100+1) ...
Setting up postgresql-client-common (253.pgdg100+1) ...
Setting up libpq5:amd64 (15.4-1.pgdg100+1) ...
Setting up libpq-dev (15.4-1.pgdg100+1) ...
Setting up postgresql-client-14 (14.9-1.pgdg100+1) ...
update-alternatives: using /usr/share/postgresql/14/man/man1/psql.1.gz to provide /usr/share/man/man1/psql.1.gz (psql.1.gz) in auto mode
Processing triggers for libc-bin (2.28-10+deb10u2) ...
Processing triggers for man-db (2.8.5-2) ...

Question is - where the hell I can fix that stupid installation script... :/

theerror commented 1 year ago

Well, they do have static setting of build distro in Dockerbuild file... that's probably also reason, why building on buster is failing...

https://github.com/lnbits/lnbits/blob/0.10.6/Dockerfile#L12

theerror commented 1 year ago

Asked for change... however, we would have to somehow find way to patch it anyway... https://github.com/lnbits/lnbits/issues/1922

theerror commented 1 year ago

Ok, just ignore part of that, I didn't get right, how Dockerbuild works, actually... but true is, that building fails for some reason...

theerror commented 1 year ago

Ok, I've manage to fix. Looks, that in time, the python:3.10-slim base had changed from debian 11 to 12 I've manage to fix building it by:

cd /opt/mynode/lnbits/

# replace python:3.10-slim with 3.10-slim-bullseye
sed -i 's/python:3.10-slim/python:3.10-slim-bullseye/g' Dockerfile

# rebuild image 
docker build --no-cache -t lnbits-legend .
theerror commented 1 year ago

0.10.9 should fix this, please change version to that one. https://github.com/lnbits/lnbits/blob/0.10.9/Dockerfile

theerror commented 1 year ago

...or just override version to 0.10.9 image

tehelsper commented 1 year ago

Does it install properly on the most recent release?

theerror commented 1 year ago

Does it install properly on the most recent release?

yep, since 0.10.9 it's working fine.

tlindi commented 8 months ago

I'm on 0.11.1 and all good.

theerror commented 8 months ago

Actually I think this could by closed as solved.

btcforplebs commented 8 months ago

Thx