Project

General

Profile

Support #17790

Updated by Alex Brodov over 7 years ago

Hi Team, 

 We're facing some issues with smart proxy, no hosts can be added due to this issue. 

 We have Foreman running on Linux, Smart proxy running on Win server 2012, with DHCP, and DNS. 

 We're using Foreman 1.13.2, Smart Proxy: 1.13.0. 

 Currently, I have one subnet configured, 1 host group, one installation media. 

 When i'm creating a new host with one interface (VMware), and trying to pull down the IP from the DHCP { using the "Suggest New" button), i'm getting an error: 

 <pre> 
 Failed @Failed to fetch a free IP from proxy uslabdns1.mydomain.com (https://uslabdns1.mydomain.com:8443): ERF12-8202 [ProxyAPI::ProxyException]: Unable to retrieve unused IP ([RestClient::ResourceNotFound]: 404 Resource Not Found) for proxy https://uslabdns1.mydomain.com:8443/dhcp 
 </pre> 

 @ 
 Below are the logs from Smart Proxy: 

 <pre> 
 [2016-12-19T16:19:54.925776 @[2016-12-19T16:19:54.925776 #1288] DEBUG -- : verifying remote client 172.29.20.226 against trusted_hosts ["do-foreman.ops.mydomain.com", "alex-local-dev.ops.mydomain.com", "172.29.20.226", "uslabdns1.mydomain.com"] 
 I, [2016-12-19T16:19:54.925776 #1288]    INFO -- : 172.29.20.226 - - [19/Dec/2016 16:19:54] "GET /logs/?from_timestamp=0 HTTP/1.1" 200 12406 0.0000 

 D, [2016-12-19T16:19:54.972652 #1288] DEBUG -- : close: 172.29.20.226:35933 
 D, [2016-12-19T16:19:55.191402 #1288] DEBUG -- : accept: 172.29.20.226:35934 
 D, [2016-12-19T16:19:55.191402 #1288] DEBUG -- : Rack::Handler::WEBrick is invoked. 
 I, [2016-12-19T16:19:55.191402 #1288]    INFO -- : 172.29.20.226 - - [19/Dec/2016 16:19:55] "GET /version HTTP/1.1" 200 79 0.0000 

 D, [2016-12-19T16:19:55.253902 #1288] DEBUG -- : close: 172.29.20.226:35934 
 D, [2016-12-19T16:20:16.582069 #1288] DEBUG -- : accept: 172.29.20.226:35935 
 D, [2016-12-19T16:20:16.597694 #1288] DEBUG -- : Rack::Handler::WEBrick is invoked. 
 I, [2016-12-19T16:20:16.597694 #1288]    INFO -- : 172.29.20.226 - - [19/Dec/2016 16:20:16] "GET /dhcp HTTP/1.1" 404 591 0.0000 

 D, [2016-12-19T16:20:16.644569 #1288] DEBUG -- : close: 172.29.20.226:35935 
 </pre> 



 

 @ 

 The Smart Proxy config file: 

 <pre> 
 :ssl_certificate: @:ssl_certificate: C:\smart-proxy-1.13.0\ssl\temp\certs\uslabdns1.corp.primarydata.com.pem 
 :ssl_ca_file:    C:\smart-proxy-1.13.0\ssl\temp\certs\ca.pem 
 :ssl_private_key: C:\smart-proxy-1.13.0\ssl\temp\private_keys\uslabdns1.corp.primarydata.com.pem 

 :trusted_hosts: 
  - do-foreman.ops.mydomain.com do-foreman.ops.primarydata.com 
  - alex-local-dev.ops.mydomain.com alex-local-dev.ops.primarydata.com 
  - uslabdns1.mydomain.com 172.29.20.226 
  - uslabdns1.corp.primarydata.com 

 :bind_host: '0.0.0.0' 

 :http_port: 8000 
 :https_port: 8443 
 :log_file: 'C:\smart-proxy.log' 
 :log_level: DEBUG 
 </pre> DEBUG@ 

 If I'm doing the same rest calls manually to Foreman using CURL (port 8000, insecure) unsecure) I'm getting the response. 

 Below is part of the foreman log after clicking the button (sending the request) 

 <pre> 
 tail @tail -F /var/log/foreman/production.log 
 2016-12-19 23:37:14 78657dd8 [app] [I] Started POST "/subnets/freeip" for 10.10.40.2 at 2016-12-19 23:37:14 +0000 
 2016-12-19 23:37:14 78657dd8 [app] [I] Processing by SubnetsController#freeip as JSON 
 2016-12-19 23:37:14 78657dd8 [app] [I]     Parameters: {"subnet_id"=>"2", "host_mac"=>"", "taken_ips"=>["", ""]} 
 2016-12-19 23:37:14 78657dd8 [app] [W] Can't verify CSRF token authenticity 
 2016-12-19 23:37:14 78657dd8 [app] [W] Action failed 
  | Foreman::Exception: ERF42-4995 [Foreman::Exception]: Invalid authenticity token 
  | /usr/share/foreman/app/controllers/application_controller.rb:393:in `handle_unverified_request' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/request_forgery_protection.rb:204:in `verify_authenticity_token' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in `block in make_lambda' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:164:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:164:in `block in halting' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in `block in call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in `each' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in `__run_callbacks__' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/callbacks.rb:19:in `process_action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rescue.rb:29:in `process_action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `block in instrument' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications.rb:164:in `instrument' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/abstract_controller/base.rb:137:in `process' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionview-4.2.5.1/lib/action_view/rendering.rb:30:in `process' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:196:in `dispatch' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal.rb:237:in `block in action' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:74:in `dispatch' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:43:in `serve' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:43:in `block in serve' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `each' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb:30:in `serve' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/route_set.rb:815:in `call' 
  | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/lib/apipie/static_dispatcher.rb:65:in `call' 
  | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/lib/apipie/extractor/recorder.rb:132:in `call' 
  | /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.3.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/etag.rb:24:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/conditionalget.rb:38:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/head.rb:13:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call' 
  | /usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/flash.rb:260:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:225:in `context' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/session/abstract/id.rb:220:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/cookies.rb:560:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/query_cache.rb:36:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:88:in `__run_callbacks__' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:81:in `run_callbacks' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:38:in `call_app' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/rack/logger.rb:22:in `call' 
  | /usr/share/foreman/lib/middleware/tagged_logging.rb:18:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/request_id.rb:21:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/methodoverride.rb:22:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/runtime.rb:18:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_dispatch/middleware/static.rb:116:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/sendfile.rb:113:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/engine.rb:518:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/application.rb:165:in `call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:66:in `block in call' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `each' 
  | /opt/rh/sclo-ror42/root/usr/share/gems/gems/rack-1.6.2/lib/rack/urlmap.rb:50:in `call' 
  | /usr/share/passenger/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request' 
  | /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request' 
  | /usr/share/passenger/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop' 
  | /usr/share/passenger/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads' 
  | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `call' 
  | /opt/theforeman/tfm/root/usr/share/gems/gems/logging-1.8.2/lib/logging/diagnostic_context.rb:323:in `block in create_with_logging_context' 
 2016-12-19 23:37:14 78657dd8 [app] [I]     Rendered common/500.html.erb (4.5ms) 
 2016-12-19 23:37:14 78657dd8 [app] [I] Completed 500 Internal Server Error in 7ms (Views: 5.0ms | ActiveRecord: 0.3ms) 
 </pre> 0.3ms)@ 

Back