Promtail container keeps restarting

I had a Loki setup running successfully but after an update using docker-compose pull and docker-compose up -d, the Promtail container is in restarting loop.

version: '3.7'

  loki:
    container_name: loki
    image: grafana/loki
    networks:
      - loki
    restart: unless-stopped
    ports:
      - '3100:3100'
    command: -config.file=/etc/loki/local-config.yaml

  promtail:
    container_name: promtail
    image: grafana/promtail
    networks:
      - loki
    restart: unless-stopped
    volumes:
      - /var/log:/var/log
    command: -config.file=/etc/promtail/docker-config.yaml

  grafana:
    image: grafana/grafana
    container_name: grafana
    networks:
      - loki
    restart: unless-stopped
    user: 1000
    ports:
      - '3000:3000'
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin
      - GF_RENDERING_SERVER_URL=http://renderer:8081/render
      - GF_RENDERING_CALLBACK_URL=http://grafana:3000
      - GF_LOG_FILTERS=rendering:debug
    volumes:
      - /media/data/grafana:/var/lib/grafana
    user: "1000:1001"

The logs show following error:

Unable to parse config: open /etc/promtail/docker-config.yaml: no such file or directory
Unable to parse config: open /etc/promtail/docker-config.yaml: no such file or directory
Unable to parse config: open /etc/promtail/docker-config.yaml: no such file or directory
Unable to parse config: open /etc/promtail/docker-config.yaml: no such file or directory

I don’t ever remember configuring that file and since I don’t have a volume attached to it, I am not sure where to look for the config file. Any help would be appreciated.

1 Like

Hey, I managed to fix that problem!
Try to use older promtail version
for example:

promtail:
image: grafana/promtail:1.5.0

or change following line in your docker-compose file:
command: -config.file=/etc/promtail/docker-config.yaml
to this one:
command: -config.file=/etc/promtail/config.yaml

According to my knowledge new versions of promtail has only config.yaml file in /etc/promtail/ directory.
(But I might be wrong about that)

I hope this post will help other ppl which will face that problem in the future.
Using the latest grafana build is ok until you decide to prune and build image from scratch.
At that very moment I’ve encountered this problem.

Regards,
Michał