Project

General

Profile

Actions

Bug #34222

closed

Windows DNSCMD Fails no implicit conversion of nil into String

Added by Max DiOrio over 2 years ago. Updated over 2 years ago.

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

Description

Windows Proxy 3.2.0-develop built using ruby27 on Windows 2012 R2.

[Calling Foreman API to create a host entry associated with the group & org]
An error occurred: HTTP Error 422: Unprocessable Entity
url: https://hq-1pforeman.internal.domain.com:443/api/v2/hosts/
code: 422
data: {
"host": {
"name": "hq-1pjenkinsx01",
"hostgroup_id": 5,
"organization_id": 1,
"mac": "00:50:56:85:31:11",
"architecture_id": 1,
"build": false,
"managed": "true",
"location_id": 2,
"domain_id": 1,
"ip": "10.85.136.117"
}
}
error: {
"error": {
"id": null,
"errors": {
"base": [
"Create IPv4 DNS record for hq-1pjenkinsx01.internal.ieeeglobalspec.com task failed with the following error: ERF12-2357 [ProxyAPI::ProxyException]: Unable to set DNS entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://hq-2pforeman02.internal.domain.com/dns"
]
},
"full_messages": [
"Create IPv4 DNS record for hq-1pjenkinsx01.internal.domain.com task failed with the following error: ERF12-2357 [ProxyAPI::ProxyException]: Unable to set DNS entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://hq-2pforeman02.internal.domain.com/dns"
]
}
}

2022-01-05T11:54:28 [D] accept: 10.85.136.161:59638
2022-01-05T11:54:28 [D] Rack::Handler::WEBrick is invoked.
2022-01-05T11:54:28 8ae73b6c [I] Started POST /dns/
2022-01-05T11:54:29 8ae73b6c [D] verifying remote client 10.85.136.161 against trusted_hosts ["hq-1pforeman.internal.domain.com", "hq-2pforeman02.intenral.domain.com"]
2022-01-05T11:54:29 8ae73b6c [D] Finished DNS query getresources for 'hq-1pjenkinsx01.internal.domain.com' in 37.02 ms
2022-01-05T11:54:29 8ae73b6c [D] executing: ["c:\\Windows\\System32\\dnscmd.exe", "hq-2pdom01.internal.domain.com", "/EnumZones", nil, true]
2022-01-05T11:54:29 8ae73b6c [E] no implicit conversion of nil into String
2022-01-05T11:54:29 8ae73b6c [W] Error details for no implicit conversion of nil into String: <TypeError>: no implicit conversion of nil into String
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:213:in `spawn'
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:213:in `popen_run'
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:101:in `popen3'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:130:in `popen3'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:42:in `block in execute'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:33:in `block in catch'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:110:in `timeout'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:124:in `timeout'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:40:in `execute'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:100:in `enum_zones'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:13:in `do_create'
C:/smart-proxy/modules/dns_common/dns_common.rb:37:in `create_a_record'
C:/smart-proxy/modules/dns/dns_api.rb:25:in `block in <class:Api>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `block in compile!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (3 levels) in route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1032:in `route_eval'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (2 levels) in route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1061:in `block in process_route'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `catch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `process_route'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1011:in `block in route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1129:in `block in dispatch!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1124:in `dispatch!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `block in call!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `call!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:929:in `call'
C:/smart-proxy/lib/proxy/log.rb:105:in `call'
C:/smart-proxy/lib/proxy/request_id_middleware.rb:11:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/xss_header.rb:18:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/json_csrf.rb:26:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/frame_options.rb:31:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/null_logger.rb:11:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/show_exceptions.rb:22:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:216:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1991:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `block in call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1769:in `synchronize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:244:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/handler/webrick.rb:95:in `service'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/webrick-1.7.0/lib/webrick/httpserver.rb:140:in `service'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/webrick-1.7.0/lib/webrick/httpserver.rb:96:in `run'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/webrick-1.7.0/lib/webrick/server.rb:310:in `block in start_thread'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2022-01-05T11:54:29 8ae73b6c [W] no implicit conversion of nil into String: <TypeError>: no implicit conversion of nil into String
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:213:in `spawn'
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:213:in `popen_run'
C:/Ruby27-x64/lib/ruby/2.7.0/open3.rb:101:in `popen3'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:130:in `popen3'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:42:in `block in execute'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:95:in `block in timeout'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:33:in `block in catch'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:33:in `catch'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:110:in `timeout'
C:/Ruby27-x64/lib/ruby/2.7.0/timeout.rb:124:in `timeout'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:40:in `execute'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:100:in `enum_zones'
C:/smart-proxy/modules/dns_dnscmd/dns_dnscmd_main.rb:13:in `do_create'
C:/smart-proxy/modules/dns_common/dns_common.rb:37:in `create_a_record'
C:/smart-proxy/modules/dns/dns_api.rb:25:in `block in <class:Api>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1675:in `block in compile!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (3 levels) in route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1032:in `route_eval'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1013:in `block (2 levels) in route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1061:in `block in process_route'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `catch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1059:in `process_route'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1011:in `block in route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1008:in `route!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1129:in `block in dispatch!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1124:in `dispatch!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `block in call!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `block in invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `catch'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1101:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:939:in `call!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:929:in `call'
C:/smart-proxy/lib/proxy/log.rb:105:in `call'
C:/smart-proxy/lib/proxy/request_id_middleware.rb:11:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/xss_header.rb:18:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/json_csrf.rb:26:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/base.rb:50:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-protection-2.1.0/lib/rack/protection/frame_options.rb:31:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/null_logger.rb:11:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/head.rb:12:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/show_exceptions.rb:22:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:216:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1991:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `block in call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1769:in `synchronize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1542:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:74:in `block in call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/urlmap.rb:58:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/builder.rb:244:in `call'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rack-2.2.3/lib/rack/handler/webrick.rb:95:in `service'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/webrick-1.7.0/lib/webrick/httpserver.rb:140:in `service'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/webrick-1.7.0/lib/webrick/httpserver.rb:96:in `run'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/webrick-1.7.0/lib/webrick/server.rb:310:in `block in start_thread'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/logging-2.3.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2022-01-05T11:54:29 8ae73b6c [I] Finished POST /dns/ with 400 (65.12 ms)

Actions #1

Updated by Max DiOrio over 2 years ago

Exists in smart-proxy 3.1 as well

curl --cacert /etc/foreman/proxy_ca.pem --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem -d 'fqdn=hq-1pjenkinsx01.internal.domain.com&value=10.85.136.117&type=A' 'https://hq-2pforeman02.internal.domain.com:443/dns/'
no implicit conversion of nil into String

This is also the case when switching back to ruby 2.6.

Actions #2

Updated by Max DiOrio over 2 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF