"The environment variable didn't work" would never have translated to "set an environment variable" for me
What other "work" can an environment variable do?
When you try to use an environment variable, there are really only two ways that the variable itself can fail. Either you couldn't fetch the value, which I've never seen be caused by anything other than it just not being set (in the particular process). Or, you fetch the value and it isn't an appropriate value.
So setting the environment variable to an appropriate value does seem an obvious resolution to such a reported failure, IMHO. :) Especially after you look at what value is currently set for it, if any. And I think the names of the variables make what values are appropriate pretty obvious as well, in this context.