mattermost / mattermost-docker

Deprecated
Apache License 2.0
964 stars 575 forks source link

DB Docker building error #463

Open allanesquina opened 4 years ago

allanesquina commented 4 years ago

Hi folks, I'm getting a package error when installing Wal-e on DB Docker. Good job btw, thanks.

NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
Executing busybox-1.31.1-r9.trigger                                                                                                                                                                                
Executing ca-certificates-20191127-r1.trigger                                                                                                                                                                      OK: 349 MiB in 77 packages                                                                                                                                                                                         Collecting wal-e<1.0.0                                                                                                                                                                                               Downloading https://files.pythonhosted.org/packages/7a/67/4da340652303e3adb26f6e9aa97b2118dbe5cd17be87e8a21dff9e9bc507/wal-e-0.9.2.tar.gz (100kB)                                                                Collecting envdir                                                                                                                                                                                                    Downloading https://files.pythonhosted.org/packages/75/dd/817dc77edf4807fc2c29e28046ab83aa7ccfe27e79d24ca37d7aaa1e36bb/envdir-1.0.1-py2.py3-none-any.whl                                                         Collecting gevent>=1.0.2 (from wal-e<1.0.0)                                                                                                                                                                          Downloading https://files.pythonhosted.org/packages/ed/27/6c49b70808f569b66ec7fac2e78f076e9b204db9cf5768740cff3d5a07ae/gevent-1.4.0.tar.gz (5.2MB)                                                               Collecting boto>=2.24.0 (from wal-e<1.0.0)                                                                                                                                                                           Downloading https://files.pythonhosted.org/packages/23/10/c0b78c27298029e4454a472a1919bde20cb182dab1662cec7f2ca1dcc523/boto-2.49.0-py2.py3-none-any.whl (1.4MB)                                                  Collecting azure>=0.7.0 (from wal-e<1.0.0)                                                                                                                                                                           Downloading https://files.pythonhosted.org/packages/e8/48/ef73d5e71ecb84cacaeaf533f519be81825ad6198acc41bd821f440e7f7c/azure-5.0.0.zip                                                                               Complete output from command python setup.py egg_info:                                                                                                                                                             Traceback (most recent call last):                                                                                                                                                                                   File "<string>", line 1, in <module>                                                                                                                                                                               File "/tmp/pip-install-w__KHv/azure/setup.py", line 60, in <module>                                                                                                                                                  raise RuntimeError(message)                                                                                                                                                                                    RuntimeError:                                                                                                                                                                                                                                                                                                                                                                                                                         Starting with v5.0.0, the 'azure' meta-package is deprecated and cannot be installed anymore.                                                                                                                      Please install the service specific packages prefixed by `azure` needed for your application.                                                                                                                                                                                                                                                                                                                                         The complete list of available packages can be found at:                                                                                                                                                           https://aka.ms/azsdk/python/all                                                                                                                                                                                                                                                                                                                                                                                                       Here's a non-exhaustive list of common packages:                                                                                                                                                               

    -  azure-mgmt-compute (https://pypi.python.org/pypi/azure-mgmt-compute) : Management of Virtual Machines, etc.                                                                                                 
    -  azure-mgmt-storage (https://pypi.python.org/pypi/azure-mgmt-storage) : Management of storage accounts.                                                                                                      
    -  azure-mgmt-resource (https://pypi.python.org/pypi/azure-mgmt-resource) : Generic package about Azure Resource Management (ARM)                                                                              
    -  azure-keyvault-secrets (https://pypi.python.org/pypi/azure-keyvault-secrets) : Access to secrets in Key Vault                                                                                               
    -  azure-storage-blob (https://pypi.python.org/pypi/azure-storage-blob) : Access to blobs in storage accounts                                                                                                  

    A more comprehensive discussion of the rationale for this decision can be found in the following issue:
    https://github.com/Azure/azure-sdk-for-python/issues/10646

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-w__KHv/azure/
ERROR: Service 'db' failed to build: The command '/bin/sh -c apk add --no-cache       build-base       curl       libc6-compat       libffi-dev       linux-headers       python-dev       py-pip       py-cryptogr
aphy       pv       libressl-dev     && pip --no-cache-dir install 'wal-e<1.0.0' envdir     && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*' returned a non-zero code: 1
nvjacobo commented 4 years ago

hi @allanesquina

I have experienced the same issue

My setup

Collecting wal-e<1.0.0
  Downloading https://files.pythonhosted.org/packages/7a/67/4da340652303e3adb26f6e9aa97b2118dbe5cd17be87e8a21dff9e9bc507/wal-e-0.9.2.tar.gz (100kB)
Collecting envdir
  Downloading https://files.pythonhosted.org/packages/75/dd/817dc77edf4807fc2c29e28046ab83aa7ccfe27e79d24ca37d7aaa1e36bb/envdir-1.0.1-py2.py3-none-any.whl
Collecting gevent>=1.0.2 (from wal-e<1.0.0)
  Downloading https://files.pythonhosted.org/packages/ed/27/6c49b70808f569b66ec7fac2e78f076e9b204db9cf5768740cff3d5a07ae/gevent-1.4.0.tar.gz (5.2MB)
Collecting boto>=2.24.0 (from wal-e<1.0.0)
  Downloading https://files.pythonhosted.org/packages/23/10/c0b78c27298029e4454a472a1919bde20cb182dab1662cec7f2ca1dcc523/boto-2.49.0-py2.py3-none-any.whl (1.4MB)
Collecting azure>=0.7.0 (from wal-e<1.0.0)
  Downloading https://files.pythonhosted.org/packages/e8/48/ef73d5e71ecb84cacaeaf533f519be81825ad6198acc41bd821f440e7f7c/azure-5.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-_AUrmA/azure/setup.py", line 60, in <module>
        raise RuntimeError(message)
    RuntimeError:

    Starting with v5.0.0, the 'azure' meta-package is deprecated and cannot be installed anymore.
    Please install the service specific packages prefixed by `azure` needed for your application.

    The complete list of available packages can be found at:
    https://aka.ms/azsdk/python/all

    Here's a non-exhaustive list of common packages:

    -  azure-mgmt-compute (https://pypi.python.org/pypi/azure-mgmt-compute) : Management of Virtual Machines, etc.
    -  azure-mgmt-storage (https://pypi.python.org/pypi/azure-mgmt-storage) : Management of storage accounts.
    -  azure-mgmt-resource (https://pypi.python.org/pypi/azure-mgmt-resource) : Generic package about Azure Resource Management (ARM)
    -  azure-keyvault-secrets (https://pypi.python.org/pypi/azure-keyvault-secrets) : Access to secrets in Key Vault
    -  azure-storage-blob (https://pypi.python.org/pypi/azure-storage-blob) : Access to blobs in storage accounts

    A more comprehensive discussion of the rationale for this decision can be found in the following issue:
    https://github.com/Azure/azure-sdk-for-python/issues/10646

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-_AUrmA/azure/
ERROR: Service 'db' failed to build: The command '/bin/sh -c apk add --no-cache       build-base       curl       libc6-compat       libffi-dev       linux-headers       python-dev       py-pip       py-cryptography       pv       libressl-dev     && pip --no-cache-dir install 'wal-e<1.0.0' envdir     && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*' returned a non-zero code: 1
swagner74 commented 4 years ago

+1, same issue.

yannhowe commented 4 years ago

+1, same issue. ubuntu 18.04 docker 19.03.8 docker-compose version 1.25.4, build 8d51620a

Looks like something to do with wal-e 1.0.0 which relies on azure

salsudais commented 4 years ago

Same issue here, as workaround we had to update the db Dockerfile to:

RUN echo "azure<5.0.0" > pip-constraints.txt
RUN pip --no-cache-dir install -c pip-constraints.txt 'wal-e<1.0.0' envdir \
     && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
ahmaddanialmohd commented 4 years ago

Hi, everyone.

I am also running into the same issue based on the output that I am getting here:

Ahmad-Danials-MacBook-Pro:mattermost-docker ahmaddanialmohammad$ docker-compose build
Building db
Step 1/9 : FROM postgres:9.4-alpine
 ---> 60692ae58e72
Step 2/9 : ENV DEFAULT_TIMEZONE UTC
 ---> Using cache
 ---> 5c822e3114e0
Step 3/9 : RUN apk add --no-cache       build-base       curl       libc6-compat       libffi-dev       linux-headers       python-dev       py-pip       py-cryptography       pv       libressl-dev     && pip --no-cache-dir install 'wal-e<1.0.0' envdir     && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
 ---> Running in 6e49c295fb20
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/56) Upgrading musl (1.1.20-r4 -> 1.1.20-r5)
(2/56) Installing binutils (2.31.1-r2)
(3/56) Installing libmagic (5.36-r1)
(4/56) Installing file (5.36-r1)
(5/56) Installing gmp (6.1.2-r1)
(6/56) Installing isl (0.18-r0)
(7/56) Installing libgomp (8.3.0-r0)
(8/56) Installing libatomic (8.3.0-r0)
(9/56) Installing libgcc (8.3.0-r0)
(10/56) Installing mpfr3 (3.1.5-r1)
(11/56) Installing mpc1 (1.0.3-r1)
(12/56) Installing libstdc++ (8.3.0-r0)
(13/56) Installing gcc (8.3.0-r0)
(14/56) Installing musl-dev (1.1.20-r5)
(15/56) Installing libc-dev (0.7.1-r0)
(16/56) Installing g++ (8.3.0-r0)
(17/56) Installing make (4.2.1-r2)
(18/56) Installing fortify-headers (1.0-r0)
(19/56) Installing build-base (0.5-r1)
(20/56) Installing ca-certificates (20190108-r0)
(21/56) Installing nghttp2-libs (1.35.1-r1)
(22/56) Installing libssh2 (1.9.0-r1)
(23/56) Installing libcurl (7.64.0-r3)
(24/56) Installing curl (7.64.0-r3)
(25/56) Upgrading musl-utils (1.1.20-r4 -> 1.1.20-r5)
(26/56) Installing libc6-compat (1.1.20-r5)
(27/56) Installing linux-headers (4.18.13-r1)
(28/56) Installing libffi (3.2.1-r6)
(29/56) Installing pkgconf (1.6.0-r0)
(30/56) Installing libffi-dev (3.2.1-r6)
(31/56) Installing libressl2.7-libcrypto (2.7.5-r0)
(32/56) Installing libressl2.7-libssl (2.7.5-r0)
(33/56) Installing libressl2.7-libtls (2.7.5-r0)
(34/56) Installing libressl-dev (2.7.5-r0)
(35/56) Installing pv (1.6.6-r1)
(36/56) Installing py-cffi (1.11.5-r0)
(37/56) Installing py-idna (2.7-r0)
(38/56) Installing py-asn1crypto (0.24.0-r0)
(39/56) Installing py-six (1.12.0-r0)
(40/56) Installing py-cryptography (2.4.2-r2)
(41/56) Installing libbz2 (1.0.6-r7)
(42/56) Installing expat (2.2.8-r0)
(43/56) Installing gdbm (1.13-r1)
(44/56) Installing sqlite-libs (3.28.0-r2)
(45/56) Installing python2 (2.7.16-r2)
(46/56) Installing py2-idna (2.7-r0)
(47/56) Installing py2-six (1.12.0-r0)
(48/56) Installing py2-asn1crypto (0.24.0-r0)
(49/56) Installing py2-cparser (2.19-r0)
(50/56) Installing py2-cffi (1.11.5-r0)
(51/56) Installing py2-ipaddress (1.0.22-r0)
(52/56) Installing py-enum34 (1.1.6-r2)
(53/56) Installing py2-cryptography (2.4.2-r2)
(54/56) Installing py-setuptools (40.6.3-r0)
(55/56) Installing py2-pip (18.1-r0)
(56/56) Installing python2-dev (2.7.16-r2)
Executing busybox-1.29.3-r10.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 274 MiB in 82 packages
Collecting wal-e<1.0.0
  Downloading https://files.pythonhosted.org/packages/7a/67/4da340652303e3adb26f6e9aa97b2118dbe5cd17be87e8a21dff9e9bc507/wal-e-0.9.2.tar.gz (100kB)
Collecting envdir
  Downloading https://files.pythonhosted.org/packages/75/dd/817dc77edf4807fc2c29e28046ab83aa7ccfe27e79d24ca37d7aaa1e36bb/envdir-1.0.1-py2.py3-none-any.whl
Collecting gevent>=1.0.2 (from wal-e<1.0.0)
  Downloading https://files.pythonhosted.org/packages/5a/79/2c63d385d017b5dd7d70983a463dfd25befae70c824fedb857df6e72eff2/gevent-1.5.0.tar.gz (5.3MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
Collecting boto>=2.24.0 (from wal-e<1.0.0)
  Downloading https://files.pythonhosted.org/packages/23/10/c0b78c27298029e4454a472a1919bde20cb182dab1662cec7f2ca1dcc523/boto-2.49.0-py2.py3-none-any.whl (1.4MB)
Collecting azure>=0.7.0 (from wal-e<1.0.0)
  Downloading https://files.pythonhosted.org/packages/e8/48/ef73d5e71ecb84cacaeaf533f519be81825ad6198acc41bd821f440e7f7c/azure-5.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-lHA6Cd/azure/setup.py", line 60, in <module>
        raise RuntimeError(message)
    RuntimeError:

    Starting with v5.0.0, the 'azure' meta-package is deprecated and cannot be installed anymore.
    Please install the service specific packages prefixed by `azure` needed for your application.

    The complete list of available packages can be found at:
    https://aka.ms/azsdk/python/all

    Here's a non-exhaustive list of common packages:

    -  azure-mgmt-compute (https://pypi.python.org/pypi/azure-mgmt-compute) : Management of Virtual Machines, etc.
    -  azure-mgmt-storage (https://pypi.python.org/pypi/azure-mgmt-storage) : Management of storage accounts.
    -  azure-mgmt-resource (https://pypi.python.org/pypi/azure-mgmt-resource) : Generic package about Azure Resource Management (ARM)
    -  azure-keyvault-secrets (https://pypi.python.org/pypi/azure-keyvault-secrets) : Access to secrets in Key Vault
    -  azure-storage-blob (https://pypi.python.org/pypi/azure-storage-blob) : Access to blobs in storage accounts

    A more comprehensive discussion of the rationale for this decision can be found in the following issue:
    https://github.com/Azure/azure-sdk-for-python/issues/10646

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-lHA6Cd/azure/
ERROR: Service 'db' failed to build: The command '/bin/sh -c apk add --no-cache       build-base       curl       libc6-compat       libffi-dev       linux-headers       python-dev       py-pip       py-cryptography       pv       libressl-dev     && pip --no-cache-dir install 'wal-e<1.0.0' envdir     && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*' returned a non-zero code: 1

These are the details of my Docker running on Mac 10.15.4:

Ahmad-Danials-MacBook-Pro:mattermost-docker ahmaddanialmohammad$ docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:21:11 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
nin0-0 commented 4 years ago

I've commented all Wal-e lines in my db/Dockerfile and so it builds, but the db container keeps restarting

This is in the db container logs, though seems irrelevant?

WALE_S3_PREFIX is required for Wal-E but not set. Skipping Wal-E setup.
AWS_REGION is required for Wal-E but not set. Skipping Wal-E setup.

I run on azure VM.

This was my specific error upon building:

  Downloading https://files.pythonhosted.org/packages/e8/48/ef73d5e71ecb84cacaeaf533f519be81825ad6198acc41bd821f440e7f7c/azure-5.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-W3qAB_/azure/setup.py", line 60, in <module>
        raise RuntimeError(message)
    RuntimeError:

   Starting with v5.0.0, the 'azure' meta-package is deprecated and cannot be installed anymore.
    Please install the service specific packages prefixed by azure needed for your application.

  The complete list of available packages can be found at:
    https://aka.ms/azsdk/python/all

Here's a non-exhaustive list of common packages:

azure-mgmt-compute (https://pypi.python.org/pypi/azure-mgmt-compute) : Management of Virtual Machines, etc.
azure-mgmt-storage (https://pypi.python.org/pypi/azure-mgmt-storage) : Management of storage accounts.
azure-mgmt-resource (https://pypi.python.org/pypi/azure-mgmt-resource) : Generic package about Azure Resource Management (ARM)
azure-keyvault-secrets (https://pypi.python.org/pypi/azure-keyvault-secrets) : Access to secrets in Key Vault
azure-storage-blob (https://pypi.python.org/pypi/azure-storage-blob) : Access to blobs in storage accounts A more comprehensive discussion of the rationale for this decision can be found in the following issue:
https://github.com/Azure/azure-sdk-for-python/issues/10646

Also have to add libressl-dev in the Dockerfile manually since some time.

I updated the certs in web/cert/ just before, but when I run docker-compose without -d it seems to accept the certs.

For completeness, my current db/Dockerfile

$ cat db/Dockerfile 
FROM postgres:9.4-alpine

ENV DEFAULT_TIMEZONE UTC

# Install some packages to use WAL
RUN apk add --no-cache \
      build-base \
      curl \
      libc6-compat \
      libressl-dev \
      libffi-dev \
      linux-headers \
      python-dev \
      py-pip \
      py-cryptography \
      pv \
    #&& pip --no-cache-dir install 'wal-e<1.0.0' envdir \
    && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*

# Add wale script
#COPY setup-wale.sh /docker-entrypoint-initdb.d/

#Healthcheck to make sure container is ready
HEALTHCHECK CMD pg_isready -U $POSTGRES_USER -d $POSTGRES_DB || exit 1

# Add and configure entrypoint and command
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD ["postgres"]

VOLUME ["/var/run/postgresql", "/usr/share/postgresql/", "/var/lib/postgresql/data", "/tmp"]
nin0-0 commented 4 years ago
app_1  | Configure database connection...OK
app_1  | Starting mattermost
app_1  | {"level":"error","ts":1586784277.797079,"caller":"sqlstore/supplier.go:236","msg":"Failed to ping DB retrying in 10 seconds err=dial tcp: lookup db on 127.0.0.11:53: no such host"}
app_1  | {"level":"error","ts":1586784287.854749,"caller":"sqlstore/supplier.go:236","msg":"Failed to ping DB retrying in 10 seconds err=dial tcp: lookup db on 127.0.0.11:53: no such host"}
app_1  | {"level":"error","ts":1586784297.8858087,"caller":"sqlstore/supplier.go:236","msg":"Failed to ping DB retrying in 10 seconds err=dial tcp: lookup db on 127.0.0.11:53: no such host"}
web_1  | found certificate and key, linking ssl config
web_1  | 2020/04/13 13:24:36 [warn] 1#1: the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/mattermost.conf:15
web_1  | nginx: [warn] the "ssl" directive is deprecated, use the "listen ... ssl" directive instead in /etc/nginx/conf.d/mattermost.conf:15

is that sqlstore/supplier.go a bug, bc am using pgsql?

meizenga commented 4 years ago

Add this line in db/Dockerfile && pip --no-cache-dir install 'azure==4.0.0' envdir \

so the file looks like this:

&& pip --no-cache-dir install 'azure==4.0.0' envdir \ && pip --no-cache-dir install 'wal-e<1.0.0' envdir \

After that it build fine