timescale / timescaledb-docker-ha

Create Docker images containing TimescaleDB, Patroni to be used by developers and Kubernetes.
Apache License 2.0
168 stars 45 forks source link

/build/scripts/shared_install.sh: line 164: /usr/share/postgresql/16/extension/timescaledb--*.sql: Permission denied #425

Closed aviralsingh21 closed 9 months ago

aviralsingh21 commented 1 year ago

I am building a docker image using timescale/timescaledb-ha image by including pgaudit and pg_profile for the pg version 13. The Lines which I am including are successfully built but later I am getting Permission Denied error in one of the scripts included in repo.

I cloned the repository using below command:

git clone https://github.com/timescale/timescaledb-docker-ha.git

The lines which I have modified/added in Dockerfile are:

Modified:
ARG PG_MAJOR=13

Added:
# Install PostgreSQL-Contrib
RUN apt-get update && apt-get install -y postgresql-contrib

# Install PgAudit
RUN for pg in ${PG_VERSIONS}; do apt-get install -y postgresql-${pg}-pgaudit || exit 1; done

 Setup pg_profile extension
RUN for pg in ${PG_VERSIONS}; do \
        wget https://github.com/zubkov-andrei/pg_profile/releases/download/4.2/pg_profile--4.2.tar.gz && \
        tar xzf pg_profile--4.2.tar.gz --directory /usr/share/postgresql/${pg}/extension|| exit 1; \
    done

Error I am getting while building docker image:

 => CACHED [builder 44/62] RUN set -ex;     if [ -n "${PG_LOGERRORS}" ]; then         git clone https://github.com/munakoiso/logerrors /build/logerrors;         cd /build/logerrors;         git checkout "${PG_LOGERRORS}";       0.0s
 => ERROR [builder 45/62] RUN set -ex;     OSS_ONLY="${OSS_ONLY}"         GITHUB_REPO="timescale/timescaledb"         TIMESCALEDB_VERSIONS="${TIMESCALEDB_VERSIONS}"         /build/scripts/install_extensions timescaledb          2.9s
------
 > [builder 45/62] RUN set -ex;     OSS_ONLY="${OSS_ONLY}"         GITHUB_REPO="timescale/timescaledb"         TIMESCALEDB_VERSIONS="${TIMESCALEDB_VERSIONS}"         /build/scripts/install_extensions timescaledb:
1.522 + OSS_ONLY= GITHUB_REPO=timescale/timescaledb TIMESCALEDB_VERSIONS= /build/scripts/install_extensions timescaledb
2.864 /build/scripts/shared_install.sh: line 164: /usr/share/postgresql/16/extension/timescaledb--*.sql: Permission denied
------
Dockerfile:352
--------------------
 351 |     ARG TIMESCALEDB_VERSIONS
 352 | >>> RUN set -ex; \
 353 | >>>     OSS_ONLY="${OSS_ONLY}" \
 354 | >>>         GITHUB_REPO="${GITHUB_REPO}" \
 355 | >>>         TIMESCALEDB_VERSIONS="${TIMESCALEDB_VERSIONS}" \
 356 | >>>         /build/scripts/install_extensions timescaledb
 357 |
--------------------
ERROR: failed to solve: process "/bin/sh -c set -ex;     OSS_ONLY=\"${OSS_ONLY}\"         GITHUB_REPO=\"${GITHUB_REPO}\"         TIMESCALEDB_VERSIONS=\"${TIMESCALEDB_VERSIONS}\"         /build/scripts/install_extensions timescaledb" did not complete successfully: exit code: 1`

What can be the reason for this error?

aviralsingh21 commented 1 year ago

Anyone can please help me to rectify this issue? I am stuck at this step. Not able to discover why is this happening and how it can be resolved.

graveland commented 9 months ago

This is quite an old issue. Please re-open or create a new issue if this is still a problem with the latest builds. pgaudit for example is included in the latest builds already.