Repository navigation
Closed
Labels
P1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsRegressionThe issue is a bug that breaks functionality known to work in previous releases.State-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work aroundstale
Milestone
Description
Hey all, I have a state that looks something like this:
unzip:
pkg.installed
http_proxy:
environ.setenv:
- value: 'http://proxy-url'
https_proxy:
environ.setenv:
- value: 'https://proxy-url'
/usr/local/bin/consul_dir:
archive.extracted:
- source: https://dl.bintray.com/mitchellh/consul/0.5.0_linux_amd64.zip
- archive_format: zip
- source_hash: sha256=161f2a8803e31550bd92a00e95a3a517aa949714c19d3124c46e56cfdc97b088
- require:
- environ: http_proxy
- environ: https_proxy
- pkg: unzipwhere proxy-url is a standin for the actual url of my http proxy. With a 2014.7 minion the archive extracted fine, with a 2015.5 minion, I get:
----------
ID: /usr/local/bin/consul_dir
Function: archive.extracted
Result: False
Comment: Unable to manage file: [Errno 111] Connection refused
Started: 17:58:15.121916
Duration: 420.282 ms
Changes:
----------Debugging with salt-call, this appears to be happening here, it looks like the new utils.http doesn't use the http_proxy and https_proxy environment variables, whereas whatever was responsible for the http calls in 2014.7 did.
Reacted by Jens Rantil and M.
Reacted by Jens Rantil
Metadata
Metadata
Assignees
Labels
P1Priority 1PlatformRelates to OS, containers, platform-based utilities like FS, system based appsRegressionThe issue is a bug that breaks functionality known to work in previous releases.State-Modulebugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work aroundstale
Activity
jfindlay commentedon May 13, 2015
@porterjamesj, thanks for the report.
garo commentedon Jun 25, 2015
Noticed the same problem after spending way too many hours wondering why my proxy settings doesn't take any effect.
gboddin commentedon Jun 25, 2015
Same issue here, it's a blocker when you're working in a proxy controlled environment.
8 remaining items
JensRantil commentedon Sep 2, 2016
Workaround:
Clearly, this doesn't add any hashsum, so it's less secure.
chbiel commentedon Oct 18, 2016
Is there any progress on this issue?
The-Loeki commentedon Oct 18, 2016
See #29322; the new (default) Tornado backend should be able to use PycURL, which is proxy-capable.
quasiben commentedon Nov 3, 2016
What about doing the following above any states:
?
The-Loeki commentedon Nov 3, 2016
AFAIK the Tornado backend only listens to config options
https://docs.saltstack.com/en/latest/ref/configuration/minion.html#proxy-host
quasiben commentedon Nov 4, 2016
@The-Loeki looking through that I noticed that the minion doesn't support https proxying. Is that correct?
The-Loeki commentedon Nov 4, 2016
No, the idea is you specify in the config a
backend.Of that you have three choices:
urrlib2: No clue, haven't used this oneproxy_*to determine proxy usage, seemingly irrespective of proto.Both backends need PyCuRL IIRC to do the proxying.
maltris commentedon Nov 13, 2017
As of 2017.7 the problem mentioned by OP still exists.
stale commentedon Mar 8, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
joachimtingvold commentedon Sep 28, 2019
This is still an issue, and thus, should be re-opened.
It seems the only way to make Tornardo use a proxy, is to change the Salt Minion configuration file, and restart the Salt Minion. You cannot change it "on the fly" (i.e. for just one state, or similar).
What I've tried;
http_proxyandhttps_proxyenvironment variables for the root user.environ.setenvto set the same two variables, with or withoutupdate_minion. Does not matter what order, or if I require the state before doingfile.managedorarchive.extracted.None of them seems to work, even in 2019.2.0.
joachimtingvold commentedon Sep 28, 2019
@jfindlay , not sure if stalebot re-opens the issue if a new comment is added, so pinging you to be sure (i.e. to manually re-open it).
I'm aware that the connected issue (#8177) technically has been fixed. However, it's only been fixed in such a way that you still need to configure the Salt Minion.
My opinion is that this should be fixed so that a) Tornardo respects the http_proxy/https_proxy environment variables, or b) a flag that you can pass to
file.managed(and all of the modules that usesfile.managed, to set the proxy just for that one state.Useful if you have IPv6-only minions that should not use a proxy, unless for a specific state (i.e. very specific external sources that only has IPv4).
peter-fe commentedon Apr 18, 2020
@jfindlay, @tingvold
Same issues here with managed.file & archive.extracted behind a proxy, it does indeed work if we set that proxy_host and proxy_port settings on the minion.
But actually we have lots of different environments, some of them have proxies, some not, some have different ones.
We currently control these settings by salt formulas which are setting up the common http_proxy, https_proxy, no_proxy environment variables.
Having this additional/odd piece of configuration needed for the minions in environments with proxies really feels wrong. Especially as it is only possible to set them via file and the minion has to get restarted to respect them (so not even creating them on the fly on hosts with proxies through salt states is possible).
Why going into this completely strange direction of ignoring the existing env and widely spread standards in handling these settings?
intentropy commentedon May 19, 2022
Sorry for reopening a closed thread, but the answer to this is not clear in the thread so I thought I'd provide it.
If you're using the default tornado backend for http queries, then you need to configure the salt-minion to use the proxy.
It's documented here: https://docs.saltproject.io/en/latest/topics/tutorials/http.html#proxy
on Linux create this config:
/etc/salt/minion.d/tornado.confThen add your proxy details
Obviously change the values to what you need.