getamis / eth-indexer

An Ethereum project to crawl blockchain states into database
GNU Lesser General Public License v3.0
232 stars 47 forks source link

docker-compose up errors #136

Closed miguelmota closed 5 years ago

miguelmota commented 5 years ago

Hello, I cloned the repo and ran docker-compose up but getting errors:

$ docker-compose up
WARNING: The GETH_DATA_PATH variable is not set. Defaulting to a blank string.
WARNING: The MYSQL_DATA_PATH variable is not set. Defaulting to a blank string.
Building idx-migration
Step 1/18 : FROM ruby:2.3.0
 ---> 7ca70eb2dfea
Step 2/18 : ENV LANG C.UTF-8
 ---> Using cache
 ---> 340b7361d0bc
Step 3/18 : ENV HOST localhost
 ---> Using cache
 ---> 5ede098b401e
Step 4/18 : ENV PORT 3306
 ---> Using cache
 ---> 4827b8d7a978
Step 5/18 : ENV USERNAME root
 ---> Using cache
 ---> d1513edf48bc
Step 6/18 : ENV PASSWORD my-secret-pw
 ---> Using cache
 ---> b457a87aeb22
Step 7/18 : ENV DATABASE ethdb
 ---> Using cache
 ---> a00f819c209e
Step 8/18 : RUN apt-get update &&     apt-get install -y unixodbc-dev                        mysql-client                        freetds-dev                        build-essential                        patch                        ruby-dev                        zlib1g-dev                        liblzma-dev                        --no-install-recommends &&     rm -rf /var/lib/apt/lists/*
 ---> Running in 5bfcb8406e64
Get:1 http://security.debian.org jessie/updates InRelease [44.9 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [825 kB]
Ign http://httpredir.debian.org jessie InRelease
Get:3 http://httpredir.debian.org jessie-updates InRelease [7340 B]
Get:4 http://httpredir.debian.org jessie Release.gpg [2420 B]
Get:5 http://httpredir.debian.org jessie Release [148 kB]
Get:6 http://httpredir.debian.org jessie/main amd64 Packages [9098 kB]
Fetched 10.1 MB in 7s (1377 kB/s)
W: Failed to fetch http://httpredir.debian.org/debian/dists/jessie-updates/InRelease  Unable to find expected entry 'main/binary-amd64/Packages' in Release file (Wrong sources.list entry or malformed file)

E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'idx-migration' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y unixodbc-dev                        mysql-client                        freetds-dev                        build-essential                        patch                        ruby-dev                        zlib1g-dev                        liblzma-dev                        --no-install-recommends &&     rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100

Any help is much appreciated

owensengoku commented 5 years ago

Hi @miguelmota , I guess the root cause is that Wheezy and Jessie were recently removed from the mirror network. We may discuss about how to solve this problem.

I just made a simple workaround for your .You could try to modify the file migration/Dockerfile in your cloned repo as following

FROM ruby:2.3.0
ENV LANG C.UTF-8
ENV HOST localhost
ENV PORT 3306
ENV USERNAME root
ENV PASSWORD my-secret-pw
ENV DATABASE ethdb

# Ref: https://unix.stackexchange.com/questions/508724/failed-to-fetch-jessie-backports-repository
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
    echo "deb http://cdn-fastly.deb.debian.org/debian/ jessie main" >/etc/apt/sources.list && \
    echo "deb-src http://cdn-fastly.deb.debian.org/debian/ jessie main" >>/etc/apt/sources.list && \
    echo "deb http://security.debian.org/ jessie/updates main" >>/etc/apt/sources.list && \
    echo "deb-src http://security.debian.org/ jessie/updates main" >>/etc/apt/sources.list

RUN apt-get update && \
    apt-get install -y unixodbc-dev \
                       mysql-client \
                       freetds-dev \
                       build-essential \
                       patch \
                       ruby-dev \
                       zlib1g-dev \
                       liblzma-dev \
                       --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

# Cache bundle install
WORKDIR /tmp
ADD ./Gemfile Gemfile
ADD ./Gemfile.lock Gemfile.lock
RUN bundle install

ADD ./Rakefile Rakefile
ADD ./db db

RUN chmod -R 777 Rakefile && chmod -R 777 db

RUN addgroup --system --gid 699 app
RUN adduser --system --uid 699 --gid 699 --no-create-home --disabled-login app

USER app
miguelmota commented 5 years ago

@owensengoku thanks! no more errors