Bug 59371 - Warning : Config variable ${myvar} is not defined
Summary: Warning : Config variable ${myvar} is not defined
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.4-HEAD
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2016-04-24 15:22 UTC by Ben RUBSON
Modified: 2017-03-02 11:15 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben RUBSON 2016-04-24 15:22:12 UTC
Hello,

Here is an extract of my config :

RewriteRule .* - [E=myvar:127.0.0.1:5000]
ProxyPassInterpolateEnv on
ProxyPass "/" "https://${myvar}/" interpolate

It works as expected, however I get these warnings from Apache starting it :

# service apache24 start
Performing sanity check on apache24 configuration:
[Sun Apr 24 17:20:43.834413 2016] [core:warn] [pid 88431] AH00111: Config variable ${be} is not defined
Syntax OK
Starting apache24.
[Sun Apr 24 17:20:43.896887 2016] [core:warn] [pid 88432] AH00111: Config variable ${be} is not defined

How to / could it be possible to avoid these warnings ?

Thank you !

Ben
Comment 1 Ben RUBSON 2016-04-24 15:23:23 UTC
sorry, you will have corrected, here are the warnings :

[Sun Apr 24 17:20:43.834413 2016] [core:warn] [pid 88431] AH00111: Config variable ${myvar} is not defined
Syntax OK
Starting apache24.
[Sun Apr 24 17:20:43.896887 2016] [core:warn] [pid 88432] AH00111: Config variable ${myvar} is not defined
Comment 2 Eric Covener 2016-04-24 16:48:58 UTC
Any way you can set your var with any other set of directives, like <if> and setenvif?

I think if you chose a var-name with a ":" character embedded in it, it would allow you to suppress those warnings.  A real fix is still obviously needed for this conflict and others.
Comment 3 Ben RUBSON 2016-04-24 19:18:50 UTC
Unfortunately, my var value comes from a RewriteMap, so I can't use a different directive to set it.

I tested some workarounds to switch this warning off.
First one, but does not work, warning still present :
SetEnvIfExpr "'a' == 'b'" myvar

Second one, warning still present :
SetEnv myvar

I also tested addng this in envvars.env file :
export myvar=
Warning went away, but then, the RewriteRule does not overwrite the variable.

I would like to test your variable name workaround, but how do you define a variable name with a embedded ":" in the following rule ? (as ":" is the separator between the variable name and its value)
RewriteRule .* - [E=myvar:127.0.0.1:5000]

Thank you Eric !
Comment 4 Ben RUBSON 2016-06-13 12:57:57 UTC
Eric,

Any clue regarding your variable name workaround ? :)

Many thanks !
Comment 5 Ben RUBSON 2017-02-28 08:43:37 UTC
Patch just committed !
https://github.com/apache/httpd/pull/28

Solved by not hard-fixing empty environment variables.

In the above example, simply setting the following env var :
myvar=
will avoid the warning message.
${myvar} will then be kept like this, an populated by the RewriteRule.

Thank you !