Skip to content

Recent change caused Environment variables to no longer work #683

Closed
@xarinatan

Description

@xarinatan

Today when I updated my dockergen container (latest tag), it no longer worked, seemingly not finding the environment variables I have defined anymore.
When I reverted to 0.14 everything worked fine again, so it seems like in image 9209330fbea3 there's a bug that it doesn't read from environment anymore.

I saw these errors that seem to indicate that it's reading the wrong maps for the wrong variables perhaps, but perhaps I'm wrong:

nginx-proxy-gen   | 2025/06/18 16:15:16 unable to find key from the path expression VIRTUAL_HOST in map map[PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin]
nginx-proxy-gen   | 2025/06/18 16:15:16 unable to find key from the path expression VIRTUAL_HOST in map map[ACMESH_VERSION:3.1.1 COMPANION_VERSION:v2.6.0-4-g1fd6385 DHPARAM_GENERATION:false DOCKER_HOST:unix:///var/run/docker.sock PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/app]
[...]
map[LETSENCRYPT_HOST:bashquotes.dragonhive.net NODE_VERSION:18.20.8 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin VIRTUAL_HOST:bashquotes.dragonhive.net VIRTUAL_PORT:3000 VIRTUAL_PROTO:http YARN_VERSION:1.22.22]
nginx-proxy-gen   | 2025/06/18 16:15:16 unable to find key from the path expression CERT_NAME in map map[LETSENCRYPT_HOST:bashquotes.dragonhive.net NODE_VERSION:18.20.8 PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin VIRTUAL_HOST:bashquotes.dragonhive.net VIRTUAL_PORT:3000 VIRTUAL_PROTO:http YARN_VERSION:1.22.22]

Note the VIRTUAL_HOST is present in the maps of the later errors when it's looking for different variables (like CERT_NAME), but not in the maps when it's looking for the VIRTUAL_HOST variable, so perhaps it's grabbing the wrong ones?

I know about the work to move to labels instead of environment variables but this seemed unrelated (and I also recall it being said they would still support the 'legacy' environment variables for the time being)

Activity

aaccioly

aaccioly commented on Jun 23, 2025

@aaccioly

Likely #682 @buchdag.

buchdag

buchdag commented on Jun 23, 2025

@buchdag
Member

@aaccioly agreed 👍

@xarinatan could your pull the image nginxproxy/docker-gen:revert-682 and validate that it fix the issue ?

xarinatan

xarinatan commented on Jun 30, 2025

@xarinatan
Author

@aaccioly agreed 👍

@xarinatan could your pull the image nginxproxy/docker-gen:revert-682 and validate that it fix the issue ?

Sorry for the delay, I've been busy and forgot to get back to this. I just gave it a quick test in production (because I'm 🤠 like that) and it seems to work 👍
nice quick find! @aaccioly @buchdag

buchdag

buchdag commented on Jun 30, 2025

@buchdag
Member

@xarinatan I'm actually unable to reproduce the bug on my side, and the nginx-proxy test suite seem to pass just fine with a docker-gen version that include the patch from #682, the one that was supposed to cause the bug 🤷

  • could you detail the issues you experienced beside the log warnings ?
  • could you provide a reproducible example ?

So far I've seen that #682 mistakenly generate a LOT of undesirable logs, but I did not manage to make it break anything.

self-assigned this
on Jul 1, 2025
xarinatan

xarinatan commented on Jul 6, 2025

@xarinatan
Author

I've tested the latest tag again and it seems like it works again. Previously it definitely didn't work, the frontend was fully offline while I had those error messages in the log I posted in the original report. I'm not seeing those anymore either.. so maybe something was fixed, or maybe it was a temporary glitch on my side somehow (I did reboot the server at least once since for unrelated updates).

So I guess it can be closed for now, I'll reopen it if the problem happens again (or if anyone else runs into it, feel free to reopen it too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @xarinatan@aaccioly@buchdag

    Issue actions

      Recent change caused Environment variables to no longer work · Issue #683 · nginx-proxy/docker-gen