oliver006 / redis_exporter

Prometheus Exporter for ValKey & Redis Metrics. Supports ValKey and Redis 2.x, 3.x, 4.x, 5.x, 6.x, and 7.x
https://github.com/oliver006/redis_exporter
MIT License
3.03k stars 858 forks source link

Unable to start container with secret password file #877

Closed Florentin68 closed 4 months ago

Florentin68 commented 4 months ago

Describe the problem Unable to initialize container:

2024-02-11T19:45:06.987510625Z time="2024-02-11T19:45:06Z" level=info msg="Redis Metrics Exporter v1.57.0    build date:     sha1: 30ca90e07603c58038686aec92ce842ef05695ce    Go: go1.20.13    GOOS: linux    GOARCH: arm64"
2024-02-11T19:45:06.987686919Z time="2024-02-11T19:45:06Z" level=warning msg="password file format error: invalid character 'j' looking for beginning of value"
2024-02-11T19:45:06.987719474Z time="2024-02-11T19:45:06Z" level=fatal msg="Error loading redis passwords from file /run/secrets/redis_exporter_redis_password, err: invalid character 'j' looking for beginning of value"

What version of redis_exporter are you running? Please run redis_exporter --version if you're not sure what version you're running. [ ] 0.3x.x [x] 1.57.0

oliver006 commented 4 months ago

What's your password file looking like? (don't paste the actual password) Is it valid format? (map of host to password) Example: https://github.com/oliver006/redis_exporter/blob/master/contrib/sample-pwd-file.json

Florentin68 commented 3 months ago

What does the file looks like when authenticating with username + password?

I've unsuccessfully tried both syntaxes:

{
  "redis://redis_exporter:pwd@redis:6379": ""
}
{
  "redis://redis_exporter@redis:6379": "pwd"
}

The json config file is passed by a secret file:

  redis_exporter:
    image: quay.io/oliver006/redis_exporter
    environment:
      - REDIS_ADDR=${REDIS_HOST:-redis}
      - REDIS_PORT=${REDIS_PORT:-6379}
      #- REDIS_USER=redis_exporter
      #- REDIS_PASSWORD=$REDIS_EXPORTER_REDIS_PASSWORD
      - REDIS_PASSWORD_FILE=/run/secrets/redis_exporter_redis_password
    secrets:
      - redis_exporter_redis_password