Smart Proxy Unable to fetch logs

Hi all,

I’m having an issue with Foreman

We installed via puppet forge for both foreman and foreman-proxy

We are adding smart proxies, and when clicking on an added proxy, there are several frames that have the following error in them:

Failure: ERF50-5345 [Foreman::WrappedException]: Unable to connect ([ProxyAPI::ProxyException]: ERF12-7885 [ProxyAPI::ProxyException]: Unable to fetch logs ([RestClient::ResourceNotFo...)

What I was expecting to happen is to see details on the smart proxy added.

Here’s the debugging I’ve done so far:

In the smart proxy under /var/log/foreman-proxy/proxy.log I see the following entries:

D, [2018-01-25T12:58:34.359943 #6339] DEBUG -- : close: {IP_Address_Hidden}:41114
D, [2018-01-25T12:58:34.398563 #6339] DEBUG -- : accept: {IP_Address_Hidden}:41116
D, [2018-01-25T12:58:34.400919 #6339] DEBUG -- : Rack::Handler::WEBrick is invoked.
I, [2018-01-25T12:58:34.402316 #6339]  INFO -- : {IP_Address_Hidden} - - [25/Jan/2018:12:58:34 +0000] "GET /logs/?from_timestamp=0 HTTP/1.1" 404 612 0.0008

D, [2018-01-25T12:58:34.403384 #6339] DEBUG -- : close: {IP_Address_Hidden}:41116
D, [2018-01-25T12:58:34.487930 #6339] DEBUG -- : accept: {IP_Address_Hidden}:41118
D, [2018-01-25T12:58:34.490083 #6339] DEBUG -- : Rack::Handler::WEBrick is invoked.
I, [2018-01-25T12:58:34.491287 #6339]  INFO -- : {IP_Address_Hidden} - - [25/Jan/2018:12:58:34 +0000] "GET /tftp/serverName HTTP/1.1" 404 622 0.0007

I’ve tried deleting the smart proxy, and re-adding.

The smart proxy was setup for http only, using port 8000

Please help!

  • Shawn

Have you enabled the logging feature on http?

# cat /etc/foreman-proxy/settings.d/logs.yml 
---
:enabled: true

Ah, it was set to https, thank you for guiding the way

# cat /etc/foreman-proxy/settings.d/logs.yml
---
:enabled: https

After setting to true and restarting foreman-proxy, all is well!

1 Like

Generally speaking id recommend configuring ssl and setting everything to https. I know some things need http for provisioning but most smart proxy roles shouldnt

1 Like

i am facing same issue when i enabled to true , i still see the issue exist , any other suggestion on this below is the error
Failure: ERF50-5345 [Foreman::WrappedException]: Unable to connect ([ProxyAPI::ProxyException]: ERF12-7885 [ProxyAPI::ProxyException]: Unable to fetch logs ([Errno::EACCES]: Failed to open TCP connection to 1xx.2xx.xx.xxx:3128 (Permission denied - connect(2) for “1xx.2xx.xx.xxx” port 3128)) for proxy https://xxx:8443/logs)

Failure: ERF50-5345 [Foreman::WrappedException]: Unable to connect ([ProxyAPI::ProxyException]: ERF12-7885 [ProxyAPI::ProxyException]: Unabl
e to fetch logs ([Errno::EACCES]: Permissio…)

Below settings is set to true… but still the same above error message… can someone help on the same

cat /etc/foreman-proxy/settings.d/logs.yml — :enabled: true

Have you checked for any selinux denials, either on the foreman server or on the smart proxy?