Because https://github.com/elastic/logstash-docker/blob/5.6/build/logstash/bin/docker-entrypoint#L7
This is working fine on my laptop (Docker4Mac), but no on our production servers :/
Maybe you should check file permission because, or add a way to disable it.
It only tries to change the file if it detects a valid setting in the environment:
https://github.com/elastic/logstash-docker/blob/5.6/build/logstash/env2yaml/env2yaml.go#L157,L168
Do you have some environment variables set in production that you don't need?
Ran into the same issue, using environment variables to set usernames and passwords.
I ran into this issue when using the helm chart upstream repo of helm itself: https://github.com/helm/charts/tree/master/stable/logstash as they declare env variables in templates/statefulset.yaml.
I am new to this so this got me wondering:
Are they using your image in a strange way, is writing environment variables to files discouraged or is having a readonly cluster strange/uncommon?
Thank you!
Configuring via environment variables is supported "by popular demand" but it's not our recommended way to go about things. It just adds too much trickery and too many places that things can go wrong. If it's possible, I recommend bringing your configuration in as files (logstash.yml, pipelines.yml et al.). This approach cuts out a lot of indirection. It's easier for humans to reason about and easier for the machines to execute without hiccups.
This is especially true for Logstash since you'll almost certainly have to bring your pipeline code in as files. Handling settings the same way makes everything consistent.
I am also running into the same issue. Is anyone able to fix it?
Running into the same issue, when I set environment variable (through docker-compose file) and consume that in custom logstash.yml file, I get the same error, removing the env variable from docker-compose, it runs fine. How can I make use of env variables in custom logstash.yml ?
Most helpful comment
Ran into the same issue, using environment variables to set usernames and passwords.