Project

General

Profile

Actions

Bug #3255

closed

foreman proxy auto-registration may fail

Added by Frederic Schaer almost 11 years ago. Updated about 10 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Foreman modules
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi,

I just got caught with foreman 1.3 : using the installer defaults, foreman autoregisters a proxy.
Problem is when you already have a registered proxy for the host with a different name: in my case, the proxy was registered with the short hostname, while foreman attempted to register it with the long hostname.

This lead to puppet errors like this :

Error: Could not set 'present' on ensure: 422 Unprocessable Entity at 12:/etc/puppet/envs/dev/puppet/foreman_proxy/manifests/register.pp
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:178:in `transmit'
/usr/lib/ruby/1.8/net/http.rb:543:in `start'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:172:in `transmit'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/usr/lib/ruby/gems/1.8/gems/rest-client-1.6.7/lib/restclient/resource.rb:71:in `post'
/usr/lib/ruby/gems/1.8/gems/foreman_api-0.1.6/lib/foreman_api/base.rb:77:in `send'
/usr/lib/ruby/gems/1.8/gems/foreman_api-0.1.6/lib/foreman_api/base.rb:77:in `http_call'
/usr/lib/ruby/gems/1.8/gems/foreman_api-0.1.6/lib/foreman_api/base.rb:60:in `perform_call'
/usr/lib/ruby/gems/1.8/gems/foreman_api-0.1.6/lib/foreman_api/resources/smart_proxy.rb:37:in `create'
/etc/puppet/envs/dev/puppet/foreman/lib/puppet/provider/foreman_smartproxy/rest.rb:31:in `create'
/usr/lib/ruby/site_ruby/1.8/puppet/property/ensure.rb:16:in `set_present'

And foreman logs like that :

Started POST "/api/smart_proxies" for xxxIPxxx at 2013-10-15 12:24:58 +0200
Processing by Api::V1::SmartProxiesController#create as JSON
  Parameters: {"smart_proxy"=>{"url"=>"https://xxx_long hostname_xxx:8443", "name"=>"xxx_long_hostname_xxx"}}
Authorized user admin(Admin User)
Unprocessable entity SmartProxy (id: new):
  URL Only one declaration of a proxy is allowed

I think the error should be at least made explicit that a proxy already exists with a different name but with the same URL, or there should be no error at all when running the installer/puppet class.

Regards

Actions

Also available in: Atom PDF