Smart-proxy only listens on 127.0.0.1

Hi all,

I'm having a problem with a newly installed 1.6 smart-proxy on CentOS 6.6.
When it starts up it only ever listens with the configured port on the
loopback interface. Eg:

lsof -n -i4 -a -P -p cat /var/run/foreman-proxy/foreman-proxy.pid

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 20072 foreman-proxy 6u IPv4 170342 0t0 TCP
127.0.0.1:8000 (LISTEN)

My settings.yml:

··· --- :settings_directory: /etc/foreman-proxy/settings.d :daemon: true :http_port: 8000 :daemon_pid: /var/run/foreman-proxy/foreman-proxy.pid :log_file: /var/log/foreman-proxy/proxy.log :log_level: DEBUG :virsh_network: default

Package version:

foreman-proxy-1.6.3-1.el6.noarch

Have I missed something obvious?

Thanks,
Pete

Somewhat answering my own question. It appears to be related to this:

I don't appear to have a RACK_ENV so Sinatra is assuming development mode
and only listening on loopback.

Adding "export RACK_ENV='production'" to my foreman-proxy init script fixes
the issue but I'm not sure why this is the first time I've noticed this!

Thanks,
Pete

··· On 9 January 2015 at 11:48, Pete Harvey wrote:

I’m having a problem with a newly installed 1.6 smart-proxy on CentOS 6.6.
When it starts up it only ever listens with the configured port on the
loopback interface. Eg:

Pete,
Created a Redmine issue for this over at
theforeman.org: Bug #9989: Smart-Proxy listens on 127.0.0.1 only - Smart Proxy - Foreman. Hopefully it
gets some traction!
Thanks,
Rod

··· On Friday, January 9, 2015 at 6:57:31 AM UTC-5, Pete Harvey wrote: > > On 9 January 2015 at 11:48, Pete Harvey <pe...@phiph.org > > wrote: > >> I'm having a problem with a newly installed 1.6 smart-proxy on CentOS >> 6.6. When it starts up it only ever listens with the configured port on the >> loopback interface. Eg: > > > Somewhat answering my own question. It appears to be related to this: > > > https://github.com/sinatra/sinatra/commit/0f9a959253bdf0c39422ffb9b60278df46ef0248 > > I don't appear to have a RACK_ENV so Sinatra is assuming development mode > and only listening on loopback. > > Adding "export RACK_ENV='production'" to my foreman-proxy init script > fixes the issue but I'm not sure why this is the first time I've noticed > this! > > Thanks, > Pete >

Just to reiterate what I added to the bug report (thanks for bringing it
to my attention), we added a new config setting into 1.8.0 called
"bind_host" that lets you override this behaviour.

It's due to new versions of rack, which generally shouldn't be provided
by packages as they're all a bit older. I spoke to a user on IRC
yesterday who hit this issue and it turned out to be a locally installed
gem which was newer than the packages.

Running "gem list" showed that both rack 1.6.0 and 1.1.0 were installed,
then running "gem uninstall -v 1.6.0 rack" got the smart proxy working
as expected again.

The 1.8.0 release candidates should also work properly as the default is
now set to all interfaces.

Cheers,

··· -- Dominic Cleal Red Hat Engineering

On 01/04/15 17:30, Roderick Day wrote:

Pete,
Created a Redmine issue for this over at
theforeman.org: Bug #9989: Smart-Proxy listens on 127.0.0.1 only - Smart Proxy - Foreman. Hopefully it
gets some traction!
Thanks,
Rod

On Friday, January 9, 2015 at 6:57:31 AM UTC-5, Pete Harvey wrote:

On 9 January 2015 at 11:48, Pete Harvey <pe...@phiph.org >     <javascript:>> wrote:

    I'm having a problem with a newly installed 1.6 smart-proxy on
    CentOS 6.6. When it starts up it only ever listens with the
    configured port on the loopback interface. Eg:


Somewhat answering my own question. It appears to be related to this:

https://github.com/sinatra/sinatra/commit/0f9a959253bdf0c39422ffb9b60278df46ef0248
<https://github.com/sinatra/sinatra/commit/0f9a959253bdf0c39422ffb9b60278df46ef0248>

I don't appear to have a RACK_ENV so Sinatra is assuming development
mode and only listening on loopback.

Adding "export RACK_ENV='production'" to my foreman-proxy init
script fixes the issue but I'm not sure why this is the first time
I've noticed this!

Thanks,
Pete


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-users+unsubscribe@googlegroups.com
mailto:foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com
mailto:foreman-users@googlegroups.com.
Visit this group at http://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

confirmed that "gem uninstall -v 1.6.0 rack" worked!

Thanks,
Roderick Day

··· On Thursday, April 2, 2015 at 4:12:35 AM UTC-4, Dominic Cleal wrote: > > Just to reiterate what I added to the bug report (thanks for bringing it > to my attention), we added a new config setting into 1.8.0 called > "bind_host" that lets you override this behaviour. > > It's due to new versions of rack, which generally shouldn't be provided > by packages as they're all a bit older. I spoke to a user on IRC > yesterday who hit this issue and it turned out to be a locally installed > gem which was newer than the packages. > > Running "gem list" showed that both rack 1.6.0 and 1.1.0 were installed, > then running "gem uninstall -v 1.6.0 rack" got the smart proxy working > as expected again. > > The 1.8.0 release candidates should also work properly as the default is > now set to all interfaces. > > Cheers, > > -- > Dominic Cleal > Red Hat Engineering >