influxdata / influxdata/influxdb

[2.x] False errors in docker compose for reading secrets

Open
#26,673 3 comments 0 reactions 1 assignee Claimed by @devanbenz View on GitHub
area/2.x
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

__Steps to reproduce:__
List the minimal actions needed to reproduce the behaviour.

1. run the docker compose as described at "https://docs.influxdata.com/influxdb/v2/install/use-docker-compose/"

__Expected behaviour:__
expected secrets to be loaded without errors, the errors given sound like permissions errors but they are not.

__Actual behaviour:__
Secrets are loaded into the container fine.

The errors seem to be coming from the entrypoint.sh at lines 195-198 as below.
# Read password and username from file to avoid unsecure env variables
if [ -n "${DOCKER_INFLUXDB_INIT_PASSWORD_FILE}" ]; then [ -e "${DOCKER_INFLUXDB_INIT_PASSWORD_FILE}" ] && DOCKER_INFLUXDB_INIT_PASSWORD=$(cat "${DOCKER_INFLUXDB_INIT_PASSWORD_FILE}") || echo "DOCKER_INFLUXDB_INIT_PASSWORD_FILE defined, but file not existing, skipping."; fi
if [ -n "${DOCKER_INFLUXDB_INIT_USERNAME_FILE}" ]; then [ -e "${DOCKER_INFLUXDB_INIT_USERNAME_FILE}" ] && DOCKER_INFLUXDB_INIT_USERNAME=$(cat "${DOCKER_INFLUXDB_INIT_USERNAME_FILE}") || echo "DOCKER_INFLUXDB_INIT_USERNAME_FILE defined, but file not existing, skipping."; fi
if [ -n "${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE}" ]; then [ -e "${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE}" ] && DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=$(cat "${DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE}") || echo "DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE defined, but file not existing, skipping."; fi

DOCKER_INFLUXDB_INIT_XXXXXXXXX defined, but file not existing, skipping is the error given in the logs at startup

__Logs__
cat: /run/secrets/influxdb2-admin-password: Permission denied
DOCKER_INFLUXDB_INIT_PASSWORD_FILE defined, but file not existing, skipping.
cat: /run/secrets/influxdb2-admin-username: Permission denied
DOCKER_INFLUXDB_INIT_USERNAME_FILE defined, but file not existing, skipping.
cat: /run/secrets/influxdb2-admin-token: Permission denied
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN_FILE defined, but file not existing, skipping.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.