Open ilya-tishonok opened 4 months ago
Hello @ilya-tishonok, kindly check https://docs.api7.ai/apisix/reference/environment-variables. This page includes all environments APISIX support.
I don't think APISIX now supports injecting an environment variable into the apisix.yaml
configuration.
APISIX supports ENV injections in apisix.yaml
. Test case can be found in t/cli/test_standalone.sh
:
The fact that your request hits the LOS service also confirms it.
As it's not relevant to the variable injection, I'm updating the title to the DNS resolution error.
Hello, @juzhiyuan, according to https://apisix.apache.org/docs/apisix/profile/, it's possible to use envs in apisix.yaml
file:
Just realized {{LOS_SERVICE_UPSTREAM_ADDRESS}}
was showed up as the string literal in the log so it's still a variable resolution issue.
Did you by chance set the variable with LOS_SERVICE_UPSTREAM_ADDRESS=xxxxx
instead of export LOS_SERVICE_UPSTREAM_ADDRESS=xxxxx
?
Current Behavior
"DNS resolver domain: ${{LOS_SERVICE_UPSTREAM_ADDRESS}} error: failed to query the DNS server: DNS server error: 3 name error" appears when sending a request to the target service (LOS), but the request is hitting the target service. (No configuration was changed after the APISIX server startup). Apisix is started in standalone mode and docker enviroment.
It looks like everything in the request flow is working as expected, but it constantly produces such errors in the logs even if the request was upstreamed to the correct target service (which means that the ENV variable was found).
Expected Behavior
No errors should be produced in the logs
Error Logs
Steps to Reproduce
Environment
Docker image: apache/apisix:3.9.0-debian