Request logging fail in smart-proxy 1.6.2

Hi,

This request works:
$ wget --no-check-certificate
–private-key=/var/lib/puppet/ssl/private_keys/puppet.example.com.pem
–certificate=/var/lib/puppet/ssl/certs/puppet.example.com.pem
https://puppet.example.com:8443/bmc/providers

 // foreman-proxy.log:
 10.183.161.129 - - [11/Feb/2015 08:19:53] "GET /providers HTTP/1.1" 

200 18 0.0225

This request fails:
$ wget --no-check-certificate
–private-key=/var/lib/puppet/ssl/private_keys/puppet.example.com.pem
–certificate=/var/lib/puppet/ssl/certs/puppet.example.com.pem
https://puppet.example.com:8443/providers

 // foreman-proxy.log:
 10.183.161.129 - - [11/Feb/2015 08:20:01] "GET /providers HTTP/1.1" 

404 418 0.0211

Please note the subtle differences in the actually requested URL which
cause one of those requests to fail, but which are not reflected in the
log file: adding the '/bmc' prefix to the URL makes the request work,
but is not reflected in the log file, making debugging really hard.
Also, from the source code, the connection between proxy resources and
URLs is very thin, as this is hidden in the ProxyAPI::Resource
initialization at [1], far away from any hope of finding/noticing it
quickly. I have not invested even more time in exploring the sinatra
stuff on the proxy side, where the routes in [2] also helpfully elide
the '/bmc' prefix.

This is happening on foreman-proxy-1.6.2-1.el6 from the 1.6 repo
running on Scientific Linux release 6.5 (Carbon).

Regards, David

[1]


[2]

Yeah, I noticed this on EL6 recently too, but not on my source
installation or EL7. I suspect it's a bug in sinatra (1.0.2 vs 1.3.5)
or rack?

··· On 11/02/15 13:36, David Schmitt wrote: > This request works: > $ wget --no-check-certificate > --private-key=/var/lib/puppet/ssl/private_keys/puppet.example.com.pem > --certificate=/var/lib/puppet/ssl/certs/puppet.example.com.pem > https://puppet.example.com:8443/bmc/providers > > // foreman-proxy.log: > 10.183.161.129 - - [11/Feb/2015 08:19:53] "GET /providers HTTP/1.1" > 200 18 0.0225 > > This request fails: > $ wget --no-check-certificate > --private-key=/var/lib/puppet/ssl/private_keys/puppet.example.com.pem > --certificate=/var/lib/puppet/ssl/certs/puppet.example.com.pem > https://puppet.example.com:8443/providers > > // foreman-proxy.log: > 10.183.161.129 - - [11/Feb/2015 08:20:01] "GET /providers HTTP/1.1" > 404 418 0.0211 > > > Please note the subtle differences in the actually requested URL which > cause one of those requests to fail, but which are not reflected in the > log file: adding the '/bmc' prefix to the URL makes the request work, > but is not reflected in the log file, making debugging really hard.


Dominic Cleal
Red Hat Engineering