I am trying to add a puppet smart proxy to my foreman server, but not
having any luck.
All hosts are RHEL 6.4. I am running puppet enterprise 3.1.0 and foreman
1.3.1 installed via packages.
The puppet master is behind a load balancer/proxy (nginx) but that does not
seem to be the issue as far as I can tell.
When I add the smart proxy in foreman, I get the following error:
Unable to save
Unable to communicate with the proxy: Feature(#61541240) expected, got
NilClass(#15845480)
Please check the proxy is configured and running on the host.
However, when I send the request manually via curl, it returns data:
> Unable to save
> Unable to communicate with the proxy: Feature(#61541240) expected, got
> NilClass(#15845480)
> Please check the proxy is configured and running on the host.
Ok after quick chat with Dominic it looks like you are missing features
in the database. Is this clean installation or upgrade?
You are missing some bits in the "features" table. Try to re-migrate
database (it should only check if there are not pending migrations).
Also check the database, table "features":
Loading development environment (Rails 3.2.15)
>> Feature.all
Feature Load (0.1ms) SELECT "features".* FROM "features"
···
+----+-----------+-------------------------+-------------------------+
> id | name | created_at | updated_at |
+----+-----------+-------------------------+-------------------------+
> 1 | TFTP | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> 2 | DNS | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> 3 | DHCP | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> 4 | Puppet CA | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> 5 | Puppet | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> 6 | BMC | 2013-10-30 12:32:30 UTC | 2013-10-30 12:32:30 UTC |
+----+-----------+-------------------------+-------------------------+
6 rows in set
If your database is clean, drop it and create a new one, then migrate.
Sure, here you go. Also, the same exact thing happens when if use the FQDN
for the puppet master instead of just "puppet"
Started POST "/smart_proxies" for 10.10.10.10 at 2014-01-08 09:31:59 -0500
Processing by SmartProxiesController#create as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"9S+BrJdMJNBWfoS7IWfYCZqsThB0vIE3SjXsP3zpQ24=",
"smart_proxy"=>{"name"=>"Puppet", "url"=>"https://puppet:9443",
"location_ids"=>[""], "organization_ids"=>[""]}, "commit"=>"Submit"}
WARNING: Can't verify CSRF token authenticity
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."login" =
'admin' LIMIT 1
Setting current user thread-local variable to admin
(0.3ms) SELECT COUNT() FROM "taxonomies" WHERE "taxonomies"."type" IN
('Organization')
Setting current organization thread-local variable to none
(0.3ms) SELECT COUNT() FROM "taxonomies" WHERE "taxonomies"."type" IN
('Location')
Setting current location thread-local variable to none
(0.3ms) SELECT id FROM "taxonomies" WHERE "taxonomies"."type" IN
('Location') LIMIT 1
(0.3ms) SELECT id FROM "taxonomies" WHERE "taxonomies"."type" IN
('Organization') LIMIT 1
(0.3ms) BEGIN
SmartProxy Exists (0.3ms) SELECT 1 AS one FROM "smart_proxies" WHERE
"smart_proxies"."name" = 'Puppet' LIMIT 1
SmartProxy Exists (0.3ms) SELECT 1 AS one FROM "smart_proxies" WHERE
"smart_proxies"."url" = 'https://puppet:9443' LIMIT 1
Feature Load (0.3ms) SELECT "features".* FROM "features" WHERE
"features"."name" = 'TFTP' LIMIT 1
Feature Load (0.3ms) SELECT "features".* FROM "features" WHERE
"features"."name" = 'BMC' LIMIT 1
Feature Load (0.3ms) SELECT "features".* FROM "features" WHERE
"features"."name" = 'DNS' LIMIT 1
Feature Load (0.3ms) SELECT "features".* FROM "features" WHERE
"features"."name" = 'DHCP' LIMIT 1
Feature Load (0.3ms) SELECT "features".* FROM "features" WHERE
"features"."name" = 'Puppet CA' LIMIT 1
Feature Load (0.3ms) SELECT "features".* FROM "features" WHERE
"features"."name" = 'Puppet' LIMIT 1
Setting Load (0.4ms) SELECT "settings".* FROM "settings" WHERE
"settings"."name" = 'ssl_certificate' ORDER BY name LIMIT 1
Setting Load (0.4ms) SELECT "settings".* FROM "settings" WHERE
"settings"."name" = 'ssl_ca_file' ORDER BY name LIMIT 1
Setting Load (0.3ms) SELECT "settings".* FROM "settings" WHERE
"settings"."name" = 'ssl_priv_key' ORDER BY name LIMIT 1
(0.4ms) ROLLBACK
Failed to save: Unable to communicate with the proxy: Feature(#62146120)
expected, got NilClass(#10045540), Please check the proxy is configured and
running on the host.
CACHE (0.0ms) SELECT COUNT() FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Location')
Location Load (0.5ms) SELECT "taxonomies". FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Location')
Taxonomy Load (0.6ms) SELECT taxonomies.id FROM "taxonomies" INNER JOIN
"taxable_taxonomies" ON "taxonomies"."id" =
"taxable_taxonomies"."taxonomy_id" WHERE "taxable_taxonomies"."taxable_id"
IS NULL AND "taxable_taxonomies"."taxable_type" = 'SmartProxy' AND
(taxonomies.type='Location')
Rendered common/_edit_habtm.html.erb (2.2ms)
CACHE (0.0ms) SELECT COUNT() FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Organization')
Organization Load (0.4ms) SELECT "taxonomies". FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Organization')
Taxonomy Load (0.4ms) SELECT taxonomies.id FROM "taxonomies" INNER JOIN
"taxable_taxonomies" ON "taxonomies"."id" =
"taxable_taxonomies"."taxonomy_id" WHERE "taxable_taxonomies"."taxable_id"
IS NULL AND "taxable_taxonomies"."taxable_type" = 'SmartProxy' AND
(taxonomies.type='Organization')
Rendered common/_edit_habtm.html.erb (1.6ms)
Rendered smart_proxies/_form.html.erb (10.5ms)
Rendered smart_proxies/new.html.erb within layouts/application (10.8ms)
Read fragment views/tabs_and_title_records-1 (0.1ms)
CACHE (0.0ms) SELECT COUNT() FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Organization')
Organization Load (0.4ms) SELECT "taxonomies". FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Organization') ORDER BY type, name
Rendered home/_organization_dropdown.html.erb (2.5ms)
CACHE (0.0ms) SELECT COUNT() FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Location')
Location Load (0.4ms) SELECT "taxonomies". FROM "taxonomies" WHERE
"taxonomies"."type" IN ('Location') ORDER BY type, name
Rendered home/_location_dropdown.html.erb (2.4ms)
Rendered home/_org_switcher.html.erb (5.4ms)
Rendered home/_settings.html.erb (4.4ms)
Write fragment views/tabs_and_title_records-1 (0.8ms)
Rendered home/_topbar.html.erb (14.3ms)
Completed 200 OK in 108ms (Views: 25.1ms | ActiveRecord: 8.9ms)
···
On Wednesday, January 8, 2014 5:38:18 AM UTC-5, Lukas Zapletal wrote:
>
> > Unable to communicate with the proxy: Feature(#61541240) expected, got
> > NilClass(#15845480)
>
> Hello,
>
> can you find full backtrace for this ^^ error in production.log or
> proxy.log and paste it here?
>
> LZ
>
> --
> Later,
>
> Lukas "lzap" Zapletal
> irc: lzap #theforeman
>
Dropping and re-creating and migrating the db worked! Thank you for your
help!
Bill
···
On Wednesday, January 8, 2014 10:18:50 AM UTC-5, Lukas Zapletal wrote:
>
> > Unable to save
> > Unable to communicate with the proxy: Feature(#61541240) expected, got
> > NilClass(#15845480)
> > Please check the proxy is configured and running on the host.
>
> Ok after quick chat with Dominic it looks like you are missing features
> in the database. Is this clean installation or upgrade?
>
> You are missing some bits in the "features" table. Try to re-migrate
> database (it should only check if there are not pending migrations).
> Also check the database, table "features":
>
> Loading development environment (Rails 3.2.15)
> >> Feature.all
> Feature Load (0.1ms) SELECT "features".* FROM "features"
> +----+-----------+-------------------------+-------------------------+
> > id | name | created_at | updated_at |
> +----+-----------+-------------------------+-------------------------+
> > 1 | TFTP | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> > 2 | DNS | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> > 3 | DHCP | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> > 4 | Puppet CA | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> > 5 | Puppet | 2013-10-30 12:32:25 UTC | 2013-10-30 12:32:25 UTC |
> > 6 | BMC | 2013-10-30 12:32:30 UTC | 2013-10-30 12:32:30 UTC |
> +----+-----------+-------------------------+-------------------------+
> 6 rows in set
>
> If your database is clean, drop it and create a new one, then migrate.
>
> LZ
>
> --
> Later,
>
> Lukas "lzap" Zapletal
> irc: lzap #theforeman
>