https://issues.rudder.io/https://issues.rudder.io/themes/rudder7/favicon/favicon.ico?17096450182013-04-02T14:26:08ZIssue TrackerRudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160822013-04-02T14:26:08ZNicolas CHARLESnicolas.charles@rudder.io
<ul></ul><p>Hi Dennis,</p>
<p>Did you change the context name of the application within Jetty ?</p>
<p>What is the output of the following command ? (note the :8080)<br /><pre>
curl -s http://localhost:8080/endpoint/api/status
</pre></p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160832013-04-02T14:43:44ZDennis Cabooterdcabooter@snow.nl
<ul></ul><p>What do you mean with context name?</p>
<p>root@winzts021:/tmp# curl -s <a class="external" href="http://localhost:8080/endpoint/api/status">http://localhost:8080/endpoint/api/status</a><br /><HTML><br /><HEAD><TITLE>Redirection</TITLE></HEAD><br /><BODY><H1>Redirect</H1></BODY><br /></HTML></p>
<p>Also Apache has errors in /var/log/rudder/apache2/error.log:</p>
<p>[Tue Apr 02 15:01:27 2013] [error] [client 10.122.245.14] (20014)Internal error: proxy: error reading status line from remote server localhost:8080, referer: <a class="external" href="http://rudder.wintershall.nl/rudder/secure/nodeManager/searchNodes">http://rudder.wintershall.nl/rudder/secure/nodeManager/searchNodes</a><br />[Tue Apr 02 15:01:27 2013] [error] (111)Connection refused: proxy: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed<br />[Tue Apr 02 15:01:27 2013] [error] ap_proxy_connect_backend disabling worker for (localhost)<br />[Tue Apr 02 15:01:37 2013] [error] proxy: HTTP: disabled connection for (localhost)<br />[Tue Apr 02 15:01:47 2013] [error] proxy: HTTP: disabled connection for (localhost)<br />[Tue Apr 02 15:01:57 2013] [error] proxy: HTTP: disabled connection for (localhost)<br />[Tue Apr 02 15:02:07 2013] [error] proxy: HTTP: disabled connection for (localhost)<br />[Tue Apr 02 15:02:17 2013] [error] proxy: HTTP: disabled connection for (localhost)<br />[Tue Apr 02 15:02:20 2013] [error] proxy: HTTP: disabled connection for (localhost)</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160842013-04-02T14:44:45ZDennis Cabooterdcabooter@snow.nl
<ul></ul><p>Also from /var/log/rudder/apache2/error.log:</p>
<p>[Tue Apr 02 16:04:34 2013] [error] [client 10.122.245.14] client denied by server configuration: proxy:http://localhost:8080/rudder/api/status</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160852013-04-02T15:01:07ZDennis Cabooterdcabooter@snow.nl
<ul></ul><p>When running cf-agent on the server I see this:</p>
<pre>
-> Transformer /var/rudder/inventories/accepted-nodes-updates/winzts022-2013-03-27-14-41-31.ocs => /var/rudder/tools/send-clean.sh http://localhost:8080/endpoint/upload/ /var/rudder/inventories/accepted-nodes-updates/winzts022-2013-03-27-14-41-31.ocs /var/rudder/inventories/received/ returned error
Transforming: /var/rudder/tools/send-clean.sh http://localhost:8080/endpoint/upload/ /var/rudder/inventories/accepted-nodes-updates/winzts021-2013-03-26-11-25-05.ocs /var/rudder/inventories/received/
% Total % Received 10ferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 196k 0 0 100 196k 0 608k --:--:-- --:--:-- --:--:-- 660k
curl: (22) The requested URL returned error: 404
</pre> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160862013-04-02T15:05:48ZMatthieu CERDAmatthieu.cerda@normation.com
<ul></ul><p>Can you retry the exact same command, but with a:<br /><pre>
unset http_proxy
unset https_proxy
unset ftp_proxy
</pre></p>
<p>You might have some proxy env variables interfering with cURL.</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160872013-04-02T15:24:45ZDennis Cabooterdcabooter@snow.nl
<ul></ul><p>Now it works! The proxy was in the way:</p>
<p>root@winzts021:/tmp# unset http_proxy<br />root@winzts021:/tmp# unset https_proxy<br />root@winzts021:/tmp# unset ftp_proxy<br />root@winzts021:/tmp# echo $http_proxy<br />root@winzts021:/tmp# curl -s <a class="external" href="http://localhost:8080/endpoint/api/status">http://localhost:8080/endpoint/api/status</a><br />OK</p>
<p>I've implemented the following workaround for now:</p>
<p>root@winzts021:/tmp# . /etc/bash.bashrc<br />root@winzts021:/tmp# echo $http_proxy<br /><a class="external" href="http://proxy.example.com:8080">http://proxy.example.com:8080</a><br />root@winzts021:/tmp# echo "noproxy = *" > ~/.curlrc<br />root@winzts021:/tmp# curl -s <a class="external" href="http://localhost:8080/endpoint/api/status">http://localhost:8080/endpoint/api/status</a><br />OKroot@winzts021:/tmp#</p>
<p>However, it would be better to add "--noproxy \*" to all curl commands. I think the best thing to do for now is adding the workaround in the documentation.</p>
<p>Thank you for your help! :)</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160882013-04-02T15:47:12ZJonathan CLARKEjonathan.clarke@normation.com
<ul></ul><p>I'm glad this is working for you. I think we should build this into the base Rudder Techniques, and use curl's "--no-proxy" option, for the hostname that we're downloading from.</p>
<p>I see no reason why the Rudder agent should contact it's root server via a HTTP proxy... This wouldn't work for syslog or CFEngine network flows, so let's consider that we don't need it for HTTP either. Unless I'm really mistaken here?</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160902013-04-02T15:55:32ZDennis Cabooterdcabooter@snow.nl
<ul></ul><p>I think you can safely build this into the base Rudder Techniques. I see no reason for using a proxy to communicate with localhost. :)</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=160912013-04-02T16:00:40ZMatthieu CERDAmatthieu.cerda@normation.com
<ul><li><strong>Subject</strong> changed from <i>Rudder status check</i> to <i>Rudder status check fails if a proxy is defined in the environment</i></li><li><strong>Category</strong> set to <i>System techniques</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>8</i></li><li><strong>Assignee</strong> set to <i>Matthieu CERDA</i></li><li><strong>Priority</strong> changed from <i>N/A</i> to <i>1</i></li><li><strong>Target version</strong> set to <i>2.3.12</i></li></ul><p>So, this is a confirmed bug, and the workaround has been tested successfully (thanks Dennis), I'm on it.</p>
<p>I will document a way of using proxies with Rudder nodes too in the FaQ.</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=161122013-04-03T16:49:11ZMatthieu CERDAmatthieu.cerda@normation.com
<ul><li><strong>Status</strong> changed from <i>8</i> to <i>Pending technical review</i></li><li><strong>Assignee</strong> changed from <i>Matthieu CERDA</i> to <i>Jonathan CLARKE</i></li><li><strong>Pull Request</strong> set to <i>https://github.com/Normation/rudder-techniques/pull/66</i></li></ul><p>Technical review needed here !</p>
<p>=> <a class="external" href="https://github.com/Normation/rudder-techniques/pull/66">https://github.com/Normation/rudder-techniques/pull/66</a></p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=161132013-04-03T16:49:18ZMatthieu CERDAmatthieu.cerda@normation.com
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=161222013-04-04T11:51:12ZJonathan CLARKEjonathan.clarke@normation.com
<ul><li><strong>Status</strong> changed from <i>Pending technical review</i> to <i>Pending release</i></li></ul><p>Applied in changeset policy-templates:commit:0b9f245e0d83b1c49802ea817af35562b71b1904.</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=161232013-04-04T11:53:41ZJonathan CLARKEjonathan.clarke@normation.com
<ul></ul><p>Just commited this fix. It'll be available in tonight's nightly builds (tomorrow morning). All you need to use it is to upgrade the rudder-techniques package, and copy the Techniques from /opt/rudder/share/techniques to /var/rudder/configuration-repository/techniques as shown in the docs.</p> Rudder - Bug #3383: Rudder status check fails if a proxy is defined in the environmenthttps://issues.rudder.io/issues/3383?journal_id=174872013-05-03T15:15:52ZNicolas PERRONnicolas.perron@normation.com
<ul><li><strong>Status</strong> changed from <i>Pending release</i> to <i>Released</i></li></ul>