Create Reverse IPv4 DNS record on MS Windows failed

Version: foreman 1.23

Hi -

I am trying to provision a bare metal from discovered host. I get the below error while provisioning the host.

Error: Create Reverse IPv4 DNS record for mac01234567.example.com task failed with the following error: ERF12-2357 [ProxyAPI::ProxyException]: Unable to set DNS entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://host.example.com:8443/dns

Proxy Log:

2019-11-19T13:35:04 c6ee291b [I] Started POST /dns/
2019-11-19T13:35:04 c6ee291b [E] Command dnscmd failed:
sh: c:windowssystem32cmd.exe: command not found

2019-11-19T13:35:04 c6ee291b [E] Command dnscmd failed:
sh: c:windowssystem32cmd.exe: command not found

2019-11-19T13:35:04 c6ee291b [E] Unknown error while processing ‘’
2019-11-19T13:35:04 c6ee291b [W] Unknown error while processing ‘’
Proxy::Dns::Error: Unknown error while processing ‘’
/usr/share/foreman-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:75:in rescue in report' /usr/share/foreman-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:62:inreport’
/usr/share/foreman-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:57:in execute' /usr/share/foreman-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:99:inenum_zones’
/usr/share/foreman-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:13:in do_create' /usr/share/foreman-proxy/modules/dns_common/dns_common.rb:67:increate_ptr_record’
/usr/share/foreman-proxy/modules/dns/dns_api.rb:34:in block in <class:Api>' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:incall’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in block in compile!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in block (3 levels) in route!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:inroute_eval’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in block (2 levels) in route!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:inblock in process_route’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in catch' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:inprocess_route’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in block in route!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:ineach’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in route!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:inblock in dispatch!’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in block in invoke' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:incatch’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in invoke' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:indispatch!’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in block in call!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:inblock in invoke’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in catch' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:ininvoke’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in call!' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:incall’
/usr/share/foreman-proxy/lib/proxy/log.rb:96:in call' /usr/share/foreman-proxy/lib/proxy/request_id_middleware.rb:11:incall’
/usr/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in call' /usr/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:incall’
/usr/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in call' /usr/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:incall’
/usr/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in call' /usr/share/gems/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:incall’
/usr/share/gems/gems/rack-1.6.4/lib/rack/nulllogger.rb:9:in call' /usr/share/gems/gems/rack-1.6.4/lib/rack/head.rb:13:incall’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.rb:25:in call' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:incall’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in call' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:inblock in call’
/usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in synchronize' /usr/share/gems/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:incall’
/usr/share/gems/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in block in call' /usr/share/gems/gems/rack-1.6.4/lib/rack/urlmap.rb:50:ineach’
/usr/share/gems/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in call' /usr/share/gems/gems/rack-1.6.4/lib/rack/builder.rb:153:incall’
/usr/share/gems/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in service' /usr/share/ruby/webrick/httpserver.rb:138:inservice’
/usr/share/ruby/webrick/httpserver.rb:94:in run' /usr/share/ruby/webrick/server.rb:295:inblock in start_thread’
/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in call' /usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:inblock in create_with_logging_context’
2019-11-19T13:35:04 c6ee291b [I] Finished POST /dns/ with 400 (10.39 ms)
2019-11-19T13:35:04 c6ee291b [I] Started DELETE /dhcp/172.103.29.0/mac/0c:c4:7a:4d:1f:52
2019-11-19T13:35:04 c6ee291b [I] Finished DELETE /dhcp/172.103.29.0/mac/0c:c4:7a:4d:1f:52 with 200 (46.65 ms)

Production log:

2019-11-19T13:35:03 [I|app|c6ee291b] Parameters: {“utf8”=>“✓”, “authenticity_token”=>“uOqBG2IXSXpOrn8kkQDdjQQIFCBAfcZT+UCd5gcnCMZA13kMsOS3cz4U8sMgKVMqWoQVQno4LRQof2ag/bPYTA==”, “host”=>{“name”=>“mac01234567”, “organization_id”=>“1”, “location_id”=>“2”, “hostgroup_id”=>“1”, “environment_id”=>“1”, “ansible_role_ids”=>[""], “puppetclass_ids”=>[""], “managed”=>“true”, “progress_report_id”=>"[FILTERED]", “type”=>“Host::Managed”, “interfaces_attributes”=>{“0”=>{"_destroy"=>“0”, “mac”=>“0c:c4:7a:4d:1f:52”, “identifier”=>“eno1”, “name”=>“mac01234567”, “domain_id”=>“1”, “subnet_id”=>“19”, “ip”=>“172.103.29.34”, “ip6”=>"", “managed”=>“1”, “primary”=>“1”, “provision”=>“1”, “execution”=>“1”, “tag”=>"", “attached_to”=>"", “id”=>“4”}, “1”=>{"_destroy"=>“0”, “mac”=>“0c:c4:7a:4d:1f:53”, “identifier”=>“eno2”, “name”=>"", “domain_id”=>"", “subnet_id”=>"", “ip”=>"", “ip6”=>"", “managed”=>“0”, “primary”=>“0”, “provision”=>“0”, “execution”=>“0”, “tag”=>"", “attached_to”=>"", “id”=>“5”}, “2”=>{"_destroy"=>“0”, “mac”=>“7c:fe:90:c5:75:ae”, “identifier”=>“enp4s0”, “name”=>"", “domain_id”=>"", “subnet_id”=>"", “ip”=>"", “ip6”=>"", “managed”=>“0”, “primary”=>“0”, “provision”=>“0”, “execution”=>“0”, “tag”=>"", “attached_to”=>"", “id”=>“6”}, “3”=>{"_destroy"=>“0”, “mac”=>“0c:c4:7a:4d:1e:69”, “identifier”=>“ipmi”, “name”=>"", “domain_id”=>"", “subnet_id”=>"", “ip”=>“172.103.29.78”, “ip6”=>"", “managed”=>“0”, “primary”=>“0”, “provision”=>“0”, “execution”=>“0”, “username”=>"", “password”=>"[FILTERED]", “provider”=>“IPMI”, “id”=>“7”}}, “architecture_id”=>“1”, “operatingsystem_id”=>“2”, “build”=>“1”, “medium_id”=>“1”, “ptable_id”=>“106”, “pxe_loader”=>“PXELinux BIOS”, “disk”=>"", “root_pass”=>"[FILTERED]", “is_owned_by”=>“4-Users”, “enabled”=>“1”, “model_id”=>“1”, “comment”=>"", “overwrite”=>“false”}, “fakepassword”=>"[FILTERED]", “id”=>“2”}
2019-11-19T13:35:04 [I|app|c6ee291b] Create DHCP reservation mac01234567.example.com for mac01234567.example.com-0c:c4:7a:4d:1f:52/172.103.29.34
2019-11-19T13:35:04 [I|app|c6ee291b] Add DNS PTR record for 172.103.29.34/mac01234567.example.com
2019-11-19T13:35:04 [W|app|c6ee291b] Create Reverse IPv4 DNS record for mac01234567.example.com task failed with the following error: ERF12-2357 [ProxyAPI::ProxyException]: Unable to set DNS entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://host.example.com:8443/dns
ProxyAPI::ProxyException: ERF12-2357 [ProxyAPI::ProxyException]: Unable to set DNS entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://host.example.com:8443/dns

Please help if I am missing any configuration, Thanks!

This is fixed by removing the Reverse DNS Proxy setting in (infrastructure–>subnet–>proxies)

1 Like

Thanks for letting us know.

Hello,
I had the same behaviour with the last 3.2 version of foreman after installing a discovered server, then removing it and rediscover/reinstall it.
Removing DNS proxy setting works. But is it supposed to work as this ? No secondary effect expected ?
Regards