Unable to run influx_cli with docker because of boltdb file error

Hi, I am trying to use docker-compose to setup influx_cli and telegraf with influxdb. I have been using influxdb for a couple of weeks now.
This is the docker compose file:

influxdb:
      image: influxdb:latest
      volumes:
        # Mount for influxdb data directory and configuration
        - ./influxdb2:/var/lib/influxdb2:rw
      ports:
        - "8086:8086"
    # Use the influx cli to set up an influxdb instance.
    influxdb_cli:
      ulimits:
        nofile: 100000
      links:
        - influxdb
      image: influxdb:latest
      volumes:
        # Mount for influxdb data directory and configuration
        - ./influxdb2:/var/lib/influxdb2:rw
        - ./ssl/influxdb-selfsigned.crt:/etc/ssl/influxdb-selfsigned.crt:rw
        - ./ssl/influxdb-selfsigned.key:/etc/ssl/influxdb-selfsigned.key:rw
      environment:
        # Use these same configurations parameters in your telegraf configuration, mytelegraf.conf.
        - DOCKER_INFLUXDB_INIT_MODE=setup
        - DOCKER_INFLUXDB_INIT_USERNAME=KMansour
        - DOCKER_INFLUXDB_INIT_PASSWORD=Lebanon25
        - DOCKER_INFLUXDB_INIT_ORG=Vadimus
        - DOCKER_INFLUXDB_INIT_BUCKET=Project1
        - INFLUXD_BOLT_PATH=./influxdb2/influxd.bolt
        - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=ufvddBPqWQe-hnfEh0dGiIXEKTmZJoR1WkhzTo4AaBhj22I71zftNsWhkp10mRyRU5-FXMYtfRNZkIMPdwrczw==
        - INFLUXD_TLS_CERT=/etc/ssl/influxdb-selfsigned.crt
        - INFLUXD_TLS_KEY=/etc/ssl/influxdb-selfsigned.key
      entrypoint: [ "./entrypoint.sh" ]
      restart: on-failure:10
      depends_on:
        - influxdb
    telegraf:
      image: telegraf
      links:
        - influxdb
      volumes:
        # Mount for telegraf config
        - ./telegraf/mytelegraf.conf:/etc/telegraf/telegraf.conf
      env_file:
        - ./influxv2.env
      environment:
        - DOCKER_INFLUXDB_INIT_ORG=Vadimus
        - DOCKER_INFLUXDB_INIT_BUCKET=Project1
        - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=ufvddBPqWQe-hnfEh0dGiIXEKTmZJoR1WkhzTo4AaBhj22I71zftNsWhkp10mRyRU5-FXMYtfRNZkIMPdwrczw==
      depends_on:
        - influxdb_cli

I am getting this error when setting up influxdb_cli:


Do you know how I can fix this error? Even when I remove all containers, images and volumes from docker and start again with the docker compose it doesn’t seem to fix it.
I don’t get any errors for the influxdb setup however and I can connect to the ui with port 8086.
Thank you!

Hi @KMansourr,
Nice to meet you! Could you explain a little more about why you are looking to set up another docker container to run the InfluxDB CLI. Essentially what you have done is start two InfluxDB instances each trying to talk to the same volume location. Have you considered building a customer docker image with the CLI binary as this now comes separate from InfluxDB.

Hi @Jay_Clifford,
Thank you for the fast reply!
I deleted all my containers to start over with the docker compose file that was on the influxdb documentation. I don’t know which is the other instance of influxdb in docker that is causing this problem.
I got the docker compose file from this documentation page: Running InfluxDB 2.0 and Telegraf Using Docker | InfluxData
I only have 1 container and wiped all the docker containers,volumes and images before rerunning it.

Also, I am not sure what you mean by customer docker image with CLI binary, I’ll look into it a little while waiting for your reply. Thank you!