blockbook icon indicating copy to clipboard operation
blockbook copied to clipboard

make all-bitcoin fails

Open pkristian opened this issue 3 years ago • 2 comments

currently it looks like build is not working

root@trezor-blockbook:/blockbook# make all-bitcoin
rm -rf build/pkg-defs
rm -f build/*.deb
docker rmi blockbook-build
Error: No such image: blockbook-build
Makefile:77: recipe for target 'clean-bin-image' failed
make: [clean-bin-image] Error 1 (ignored)
docker rmi blockbook-build-deb
Error: No such image: blockbook-build-deb
Makefile:80: recipe for target 'clean-deb-image' failed
make: [clean-deb-image] Error 1 (ignored)
rm -f .bin-image .deb-image  # remove obsolete tag files
make .bin-image .deb-image
make[1]: Entering directory '/blockbook'
Building image blockbook-build from debian:9
Sending build context to Docker daemon  6.144kB
Step 1/25 : ARG BASE_IMAGE
Step 2/25 : FROM $BASE_IMAGE
 ---> fe718d1e4082
Step 3/25 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 6d66d6d2ddbd
Step 4/25 : RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y build-essential git wget pkg-config lxc-dev libzmq3-dev                        libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev                        liblz4-dev graphviz &&     apt-get clean
 ---> Using cache
 ---> 48796769714f
Step 5/25 : ENV GOLANG_VERSION=go1.17.1.linux-amd64
 ---> Running in 2b6092e4d34a
Removing intermediate container 2b6092e4d34a
 ---> 0f19a574f18d
Step 6/25 : ENV ROCKSDB_VERSION=v6.22.1
 ---> Running in 9c84610f9aa3
Removing intermediate container 9c84610f9aa3
 ---> 9f798701d957
Step 7/25 : ENV GOPATH=/go
 ---> Running in 15dc35e2b6fe
Removing intermediate container 15dc35e2b6fe
 ---> e89a15dbcb4d
Step 8/25 : ENV PATH=$PATH:$GOPATH/bin
 ---> Running in d87e34cd6f8f
Removing intermediate container d87e34cd6f8f
 ---> b589cfd7f87f
Step 9/25 : ENV CGO_CFLAGS="-I/opt/rocksdb/include"
 ---> Running in f5ae0d0684e8
Removing intermediate container f5ae0d0684e8
 ---> 99f5fd70171d
Step 10/25 : ENV CGO_LDFLAGS="-L/opt/rocksdb -ldl -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4"
 ---> Running in e542001799e6
Removing intermediate container e542001799e6
 ---> 1f0c89f60574
Step 11/25 : ARG TCMALLOC
 ---> Running in 3f0c08d0421a
Removing intermediate container 3f0c08d0421a
 ---> bd2180b13882
Step 12/25 : RUN mkdir /build
 ---> Running in cf2869cb5926
Removing intermediate container cf2869cb5926
 ---> 245b8e6fc310
Step 13/25 : RUN if [ -n "${TCMALLOC}" ]; then     echo "Using TCMALLOC";     apt-get install -y google-perftools;     ln -s /usr/lib/libtcmalloc.so.4 /usr/lib/libtcmalloc.so;fi
 ---> Running in f9f591a17b49
Removing intermediate container f9f591a17b49
 ---> 36fb59ef2064
Step 14/25 : RUN cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.tar.gz &&     tar xf $GOLANG_VERSION.tar.gz
 ---> Running in ca46a0f71bdb
--2021-12-06 11:36:12--  https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 142.250.181.238, 2a00:1450:4001:80f::200e
Connecting to dl.google.com (dl.google.com)|142.250.181.238|:443... connected.
ERROR: The certificate of 'dl.google.com' is not trusted.
ERROR: The certificate of 'dl.google.com' hasn't got a known issuer.
The certificate's owner does not match hostname 'dl.google.com'
The command '/bin/sh -c cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.tar.gz &&     tar xf $GOLANG_VERSION.tar.gz' returned a non-zero code: 5
Makefile:47: recipe for target '.bin-image' failed
make[1]: *** [.bin-image] Error 5
make[1]: Leaving directory '/blockbook'
Makefile:44: recipe for target 'build-images' failed
make: *** [build-images] Error 2

system: Linux trezor-blockbook 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64 blockbook: 707166d1ce9ef07fa29f7094105bcc570c70b1bd

pkristian avatar Dec 06 '21 11:12 pkristian

Hi, I just tried to build it on Debian 10 and it works fine. I think you will have to resolve the certificate trust issue in your system.

martinboehm avatar Dec 06 '21 23:12 martinboehm

image Hi, i belive there is some problem in docker images itself, because in host machine wget works just fine. Any ideas? :O Thank you

edit: please note this issue is on Debian 9.13

pkristian avatar Dec 07 '21 12:12 pkristian

Hi, this similar issue emerged again.. in host machine all is ok, i tried docker system prune, make clean-all , even upgrade all packages on host, but following issue persists: commit: 95eb699 (master)

/blockbook# make all-bitcoin
rm -rf build/pkg-defs
rm -f build/*.deb
docker rmi blockbook-build
Error: No such image: blockbook-build
make: [Makefile:78: clean-bin-image] Error 1 (ignored)
docker rmi blockbook-build-deb
Error: No such image: blockbook-build-deb
make: [Makefile:81: clean-deb-image] Error 1 (ignored)
rm -f .bin-image .deb-image  # remove obsolete tag files
make .bin-image .deb-image
make[1]: Entering directory '/blockbook'
Building image blockbook-build from ubuntu:20.04
Sending build context to Docker daemon  6.656kB
Step 1/28 : ARG BASE_IMAGE
Step 2/28 : FROM $BASE_IMAGE
 ---> 680e5dfb52c7
Step 3/28 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> 315f7c4d6d25
Step 4/28 : ARG PORTABLE_ROCKSDB
 ---> Using cache
 ---> d73c4e885ef6
Step 5/28 : RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y build-essential git wget pkg-config lxc-dev libzmq3-dev                        libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev                        liblz4-dev graphviz &&     apt-get clean
 ---> Using cache
 ---> 7ce73f805e29
Step 6/28 : ARG GOLANG_VERSION
 ---> Using cache
 ---> c0ef57e50e8a
Step 7/28 : ENV GOLANG_VERSION=go1.17.1
 ---> Using cache
 ---> 2722673e8acf
Step 8/28 : ENV ROCKSDB_VERSION=v6.22.1
 ---> Using cache
 ---> 9f3811ef0505
Step 9/28 : ENV GOPATH=/go
 ---> Using cache
 ---> 4b286b69f3e9
Step 10/28 : ENV PATH=$PATH:$GOPATH/bin
 ---> Using cache
 ---> 7a1a20dbfe9a
Step 11/28 : ENV CGO_CFLAGS="-I/opt/rocksdb/include"
 ---> Using cache
 ---> 7840a58dccb9
Step 12/28 : ENV CGO_LDFLAGS="-L/opt/rocksdb -ldl -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4"
 ---> Using cache
 ---> 9fb5b1cec50e
Step 13/28 : ARG TCMALLOC
 ---> Using cache
 ---> 881431a8bc7b
Step 14/28 : RUN mkdir /build
 ---> Using cache
 ---> 655f79434984
Step 15/28 : RUN if [ -n "${TCMALLOC}" ]; then     echo "Using TCMALLOC";     apt-get install -y google-perftools;     ln -s /usr/lib/libtcmalloc.so.4 /usr/lib/libtcmalloc.so;fi
 ---> Using cache
 ---> d550bb53c1b6
Step 16/28 : ARG TARGETPLATFORM
 ---> Using cache
 ---> 31285d6fe6e2
Step 17/28 : RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz
 ---> Running in b8f99f0058e6
--2022-11-03 20:28:04--  https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 216.58.212.174, 2a00:1450:4001:80b::200e
Connecting to dl.google.com (dl.google.com)|216.58.212.174|:443... connected.
ERROR: cannot verify dl.google.com's certificate, issued by 'CN=localhost,O=SatoshiLabs,L=Praha,ST=Some-State,C=CZ':
  Self-signed certificate encountered.
    ERROR: certificate common name 'localhost' doesn't match requested host name 'dl.google.com'.
To connect to dl.google.com insecurely, use `--no-check-certificate'.
The command '/bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz' returned a non-zero code: 5
make[1]: *** [Makefile:48: .bin-image] Error 5
make[1]: Leaving directory '/blockbook'
make: *** [Makefile:45: build-images] Error 2

pkristian avatar Nov 03 '22 20:11 pkristian

What? That doesn't make any sense... Why would dl.google.com have our Satoshilabs self signed certificate on it? I have absolutely no idea how can that happen...

Dehumanizer77 avatar Nov 03 '22 20:11 Dehumanizer77

i was thinking same thing... maybe docker image you use for bulding?

pkristian avatar Nov 03 '22 20:11 pkristian

That is indeed strange. I do not observe such behavior on my end. Can you try to run the build using debian11 as the base image with make all-bitcoin BASE_IMAGE=debian:11?

vdovhanych avatar Nov 04 '22 12:11 vdovhanych

just tried it, simmillar issue:

Step 17/28 : RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz
 ---> Running in 8f1ee8d3b0a5
--2022-11-04 12:33:04--  https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 172.217.18.14, 2a00:1450:4001:800::200e
Connecting to dl.google.com (dl.google.com)|172.217.18.14|:443... connected.
ERROR: The certificate of 'dl.google.com' is not trusted.
ERROR: The certificate of 'dl.google.com' doesn't have a known issuer.
The certificate's owner does not match hostname 'dl.google.com'
The command '/bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz' returned a non-zero code: 5
make[1]: *** [Makefile:48: .bin-image] Error 5
make[1]: Leaving directory '/blockbook'
make: *** [Makefile:45: build-images] Error 2

host machine is: Ubuntu 20.04.5 LTS (GNU/Linux 5.4.0-131-generic x86_64)

pkristian avatar Nov 04 '22 12:11 pkristian

Can you please try the build from this branch vd/fix-build, I added ca-certificates as it looks like base Debian image is missing the root certificate for the one dl.google.com uses.

vdovhanych avatar Nov 04 '22 12:11 vdovhanych

baforea eah comant i did run:

docker system prune -a

and

make clean-all

which returned this btw:

find build -maxdepth 1 -type f -executable -delete
rm -rf build/pkg-defs
rm -f build/*.deb
docker rmi blockbook-build
Error: No such image: blockbook-build
make: [Makefile:78: clean-bin-image] Error 1 (ignored)
docker rmi blockbook-build-deb
Error: No such image: blockbook-build-deb
make: [Makefile:81: clean-deb-image] Error 1 (ignored)
rm -f .bin-image .deb-image  # remove obsolete tag files


command: make all-bitcoin :

Step 17/28 : RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz
 ---> Running in 84bcec5b9e5f
--2022-11-04 12:50:32--  https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 172.217.18.14, 2a00:1450:4001:80b::200e
Connecting to dl.google.com (dl.google.com)|172.217.18.14|:443... connected.
ERROR: cannot verify dl.google.com's certificate, issued by 'CN=localhost,O=SatoshiLabs,L=Praha,ST=Some-State,C=CZ':
  Self-signed certificate encountered.
    ERROR: certificate common name 'localhost' doesn't match requested host name 'dl.google.com'.
To connect to dl.google.com insecurely, use `--no-check-certificate'.
The command '/bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz' returned a non-zero code: 5
make[1]: *** [Makefile:48: .bin-image] Error 5
make[1]: Leaving directory '/blockbook'
make: *** [Makefile:45: build-images] Error 2

command: make all-bitcoin BASE_IMAGE=debian:11

Step 17/28 : RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz
 ---> Running in 176b2ce9ce20
--2022-11-04 12:51:47--  https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz
Resolving dl.google.com (dl.google.com)... 172.217.18.14, 2a00:1450:4001:800::200e
Connecting to dl.google.com (dl.google.com)|172.217.18.14|:443... connected.
ERROR: The certificate of 'dl.google.com' is not trusted.
ERROR: The certificate of 'dl.google.com' doesn't have a known issuer.
The certificate's owner does not match hostname 'dl.google.com'
The command '/bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi     && cd /opt && wget https://dl.google.com/go/$GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz &&     tar xf $GOLANG_VERSION.linux-$ARCHITECTURE.tar.gz' returned a non-zero code: 5
make[1]: *** [Makefile:48: .bin-image] Error 5
make[1]: Leaving directory '/blockbook'
make: *** [Makefile:45: build-images] Error 2

pkristian avatar Nov 04 '22 12:11 pkristian

well i don't know, can you try different host? do you run any proxy on your host machine? this could also be some issue with docker networking, do you have latest docker installed?

vdovhanych avatar Nov 04 '22 13:11 vdovhanych

i am now trying it on my home computer (ubuntu) and it works fine during this step.. it is strange... so i guess i will have to build it locally and make image to run in target machine :-O but thank you for help anyway o.O

pkristian avatar Nov 04 '22 13:11 pkristian