influxdata / influxdata/influxdata-docker

Plain influx container in setup mode leads to "Error: config name "default" already exists"

Open
#542 30 comments 20 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
364
Forks
255
Avg merge
3h 18m
Merged PRs (30d)
7

Description

In a docker compose setup with the following configuration for the influx service I get a weird error on some (**not on all!** host machines):

```
db:
image: influxdb:latest
ports:
- "8086:8086"
restart: on-failure
volumes:
- influx_data:/var/lib/influxdb2
environment:
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=user
- DOCKER_INFLUXDB_INIT_PASSWORD=password1234
- DOCKER_INFLUXDB_INIT_ORG=some_org
- DOCKER_INFLUXDB_INIT_BUCKET=some_data
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=4eYvsu8wZCJ6tKuE2sxvFHkvYFwSMVK0011hEEiojvejzpSaij86vYQomN_12au6eK-2MZ6Knr-Sax201y70w==

```

On some machines this immediatly leads to the container being stuck in restarting over and over again due to the following error:
```
Error: config name "default" already exists
```

As I see it this error shows up, if the config file in `/etc/influxdb2` already has an entry for `default`. But the error also pops up if the container is started on a machine that has not hosted the setup so far, so I assume that the `influx setup` is executed twice for some reason, although I do not see where that would be in the `entrypoint.sh`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the docker-compose service configuration in the issue and inspect entrypoint.sh, focusing on the startup path that invokes setup and the /etc/influxdb2 configuration. Reproduce the restart loop with a fresh volume and compare it with a host where setup succeeds. Done means setup runs once and the container starts without the duplicate default-config error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.