Project

General

Profile

Actions

Support #11305

closed

foreman new proxy add fails with error "No features found on this proxy, please make sure you enable at least one feature"

Added by tony zheng almost 9 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Triaged:
Fixed in Releases:
Found in Releases:

Description

it seems to be same bug as #2494
foreman proxy returning html instead of JSON

but i have different version of sinatra.

here is my curl output:

[root@tony_zheng-pc ~]# curl -k -H 'accept application/json' http://105.1.43.51:8000/features
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
  <head> 
    <title>DHCP Web interface</title> 
    <link href='/css/styles.css' rel='stylesheet' /> 
  </head> 
  <body> 
    <div id='wrapper'> 
      <div id='header'> 
        <h1>DHCP Browser</h1> 
        <div id='nav'> 
          <ol> 
            <a href='/dhcp'>     <li>Home</li> </a>
            <a href='/features'> <li>Features</li> </a>
          </ol> 
        </div> 
      </div> 
      <div id='content'> 
        <h2>Suported features</h2>
<ul>

</ul>

      </div> 
      <div id='footer'> 
        <p> &copy; 2010 <a href='mailto:ohadlevy@gmail.com'> Ohad Levy </a> </p> 
      </div> 
    </div> 
  </body> 
</html> 
[root@tony_zheng-pc ~]# 

and here are versions of sinatra i have:
[root@pmonkey ~]# rpm -qa |grep sinatra
rubygem-sinatra-1.0-2.el6.noarch
ruby193-rubygem-sinatra-1.3.2-12.el6.noarch

Actions #1

Updated by Dominic Cleal almost 9 years ago

  • Description updated (diff)
  • Status changed from New to Feedback
  • Assignee deleted (Ohad Levy)

The header you're passing into curl is missing a colon between the name and value. Use:

curl -k -H 'Accept: application/json'

That should fix the HTML issue in your test.

The proxy doesn't have any features enabled though, which needs to be done under /etc/foreman-proxy/settings.d/, see also http://theforeman.org/manuals/1.8/index.html#4.3.2SmartProxySettings

Actions #2

Updated by tony zheng almost 9 years ago

you right!

[root@pmonkey ~]# curl -k -H 'Accept: application/json' http://105.1.43.51:8000/features
[][root@pmonkey ~]#

so it didnt return nothing.

but what's bothering me is that i did enable dhcp under /etc/foreman-proxy/settings.d
here is the dhcp.yml file:
---
  1. Enable DHCP management
    :enabled: http
  2. valid vendors:
  3. - isc
  4. - native_ms (Microsoft native implementation)
  5. - virsh (simple implementation for libvirt)
    :dhcp_vendor: isc
    :dhcp_config: /etc/dhcp/dhcpd.conf
    :dhcp_leases: /var/lib/dhcpd/dhcpd.leases
    #:dhcp_key_name: secret_key_name
    #:dhcp_key_secret: secret_key
and here is the /etc/dhcp/dhcpd.conf:
  1. dhcpd.conf
    omapi-port 7911;

default-lease-time 43200;
max-lease-time 86400;

ddns-update-style none;

option domain-name "samsung.lab";
option domain-name-servers 105.1.43.51;

allow booting;
allow bootp;

option fqdn.no-client-update on; # set the "O" and "S" flag bits
option fqdn.rcode2 255;
option pxegrub code 150 = text ;

  1. PXE Handoff.
    next-server 105.1.43.51;
    filename "pxelinux.0";

log-facility local7;

include "/etc/dhcp/dhcpd.hosts"; #################################
  1. samsung.lab #################################
    subnet 105.1.43.0 netmask 255.255.255.0 {

pool { range 105.1.43.81 105.1.43.90; }
option subnet-mask 255.255.255.0;
option routers 105.1.43.1;
}

and dhcpd and foreman-proxy services are running.

what could be wrong?

Actions #3

Updated by Anonymous almost 9 years ago

Did you check the log file? Can you post it here?

Actions #4

Updated by Anonymous almost 9 years ago

  • Tracker changed from Bug to Support
Actions #5

Updated by tony zheng almost 9 years ago

W, [2015-08-06T08:47:08.358654 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/foreman_proxy.yml. Using default settings.
W, [2015-08-06T08:47:08.362154 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/facts.yml. Using default settings.
W, [2015-08-06T08:47:08.362288 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/dns.yml. Using default settings.
W, [2015-08-06T08:47:08.362434 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/templates.yml. Using default settings.
W, [2015-08-06T08:47:08.362576 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/tftp.yml. Using default settings.
W, [2015-08-06T08:47:08.362723 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/dhcp.yml. Using default settings.
W, [2015-08-06T08:47:08.362871 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/puppetca.yml. Using default settings.
W, [2015-08-06T08:47:08.363037 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/puppet.yml. Using default settings.
W, [2015-08-06T08:47:08.363255 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/bmc.yml. Using default settings.
W, [2015-08-06T08:47:08.363379 #16550] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/realm.yml. Using default settings.
W, [2015-08-06T08:47:08.363998 #16550] WARN -- : Missing SSL setup, https is disabled.
105.1.43.46 - - [06/Aug/2015 08:47:15] "GET /features HTTP/1.1" 200 2 0.0018
105.1.43.46 - - [06/Aug/2015 08:47:17] "GET /features HTTP/1.1" 200 2 0.0004
105.1.15.100 - - [06/Aug/2015 08:55:47] "GET /features HTTP/1.1" 200 773 0.0029
105.1.43.51 - - [06/Aug/2015 09:53:15] "GET /features HTTP/1.1" 200 2 0.0022
W, [2015-08-06T09:59:35.132807 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/foreman_proxy.yml. Using default settings.
W, [2015-08-06T09:59:35.136319 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/facts.yml. Using default settings.
W, [2015-08-06T09:59:35.136460 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/dns.yml. Using default settings.
W, [2015-08-06T09:59:35.136621 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/templates.yml. Using default settings.
W, [2015-08-06T09:59:35.136746 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/tftp.yml. Using default settings.
W, [2015-08-06T09:59:35.136889 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/dhcp.yml. Using default settings.
W, [2015-08-06T09:59:35.137035 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/puppetca.yml. Using default settings.
W, [2015-08-06T09:59:35.137199 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/puppet.yml. Using default settings.
W, [2015-08-06T09:59:35.137417 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/bmc.yml. Using default settings.
W, [2015-08-06T09:59:35.137558 #16960] WARN -- : Couldn't find settings file /usr/share/foreman-proxy/config/settings.d/realm.yml. Using default settings.
W, [2015-08-06T09:59:35.138157 #16960] WARN -- : Missing SSL setup, https is disabled.
105.1.43.51 - - [06/Aug/2015 09:59:40] "GET /features HTTP/1.1" 200 2 0.0016
[root@pmonkey foreman-proxy]# ls -al /usr/share/foreman-proxy/config/settings.d/foreman_proxy.yml
ls: cannot access /usr/share/foreman-proxy/config/settings.d/foreman_proxy.yml: No such file or directory

why is it looking in that directory? this is just a smart proxy. not foreman server itself and /etc/foreman-proxy/settings.yml are there.

Actions #6

Updated by Anonymous almost 9 years ago

Your installation is using the default location for the settings directory. Not sure how you did the install as this shouldn't happen when rpm packages are used, but you can change the location of the settings directory via 'settings_directory' parameter in the main config file.

Actions #7

Updated by Anonymous about 7 years ago

  • Status changed from Feedback to Resolved

no reaction, closing

Actions

Also available in: Atom PDF