Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1514885 - Failed to fetch a free IP from Capsule while creating host
Summary: Failed to fetch a free IP from Capsule while creating host
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: DHCP & DNS
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
high
high vote
Target Milestone: Unspecified
Assignee: Dmitri Dolguikh
QA Contact: Nikhil Kathole
URL:
Whiteboard:
: 1517876 (view as bug list)
Depends On:
Blocks: 1459644
TreeView+ depends on / blocked
 
Reported: 2017-11-19 08:51 UTC by Nikhil Kathole
Modified: 2019-04-01 20:27 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 17:05:07 UTC


Attachments (Terms of Use)
screenshot of UI (deleted)
2017-11-19 08:51 UTC, Nikhil Kathole
no flags Details
Backtrace in capsule log (deleted)
2017-11-19 09:03 UTC, Nikhil Kathole
no flags Details
Fetched free IP from capsule (deleted)
2017-12-05 12:10 UTC, Nikhil Kathole
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 21710 None None None 2017-11-24 09:53:57 UTC
Red Hat Bugzilla 1459644 None None None Never

Internal Links: 1459644

Description Nikhil Kathole 2017-11-19 08:51:01 UTC
Created attachment 1355058 [details]
screenshot of UI

Description of problem: We were trying to create a host (with libvirt but issue is with all compute resource). But the capsule was unable to provide a free IP. Interface tab shows error as Failed to fetch a free IP from Capsule.


Version-Release number of selected component (if applicable):Satellite 6.3 snap 25


How reproducible: always


Steps to Reproduce:
1. Create host group with valid subnet, compute resource
2. Navigate to Hosts -> create new host 
3. Select host group and compute resource to deploy
4. Go to interface tab and select edit interface
5. Select subnet

Actual results:

UI showed error on IPv4 suggestion as Failed to fetch a free IP from Capsule %{Capsule}: %{message}

and production.log showed

2017-11-19 03:11:13 d95897a3 [app] [I] Started POST "/subnets/freeip" for 10.65.223.187 at 2017-11-19 03:11:13 -0500
2017-11-19 03:11:13 d95897a3 [app] [I] Processing by SubnetsController#freeip as JSON
2017-11-19 03:11:13 d95897a3 [app] [I]   Parameters: {"subnet_id"=>"2", "host_mac"=>"", "organization_id"=>"1", "location_id"=>"2", "taken_ips"=>["", ""]}
2017-11-19 03:11:13 d95897a3 [app] [I] Current user: admin (administrator)
2017-11-19 03:11:13 d95897a3 [app] [W] Failed to fetch a free IP from proxy <hostname> (https://<hostname>:9090): ERF12-8202 [ProxyAPI::ProxyException]: Unable to retrieve unused IP ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://<hostname>:9090/dhcp
2017-11-19 03:11:13 d95897a3 [app] [I] Completed 200 OK in 94ms (Views: 0.5ms | ActiveRecord: 6.7ms)

and proxy.log showed

I, [2017-11-19T03:14:59.108374 ]  INFO -- : <IP> - - [19/Nov/2017:03:14:59 -0500] "GET /dhcp/192.168.100.0/unused_ip HTTP/1.1" 400 35 0.0018

E, [2017-11-19T03:15:02.300105 ] ERROR -- : wrong number of arguments (4 for 3)


Expected results:
free IP suggestion should work.

Additional info:

Comment 1 Nikhil Kathole 2017-11-19 09:03:17 UTC
Created attachment 1355062 [details]
Backtrace in capsule log

Comment 2 Sachin Ghai 2017-11-20 08:07:54 UTC
Note, this issue appears while provisioning all compute resources.

Comment 3 Sachin Ghai 2017-11-20 08:13:04 UTC
following logs appears on clicking "suggest IP":


2017-11-20 03:11:55 7a3483c1 [app] [I] Started POST "/subnets/freeip" for 10.67.116.20 at 2017-11-20 03:11:55 -0500
2017-11-20 03:11:55 7a3483c1 [app] [I] Processing by SubnetsController#freeip as JSON
2017-11-20 03:11:55 7a3483c1 [app] [I]   Parameters: {"subnet_id"=>"2", "host_mac"=>"", "organization_id"=>"1", "location_id"=>"2", "taken_ips"=>["", ""]}
2017-11-20 03:11:55 7a3483c1 [app] [I] Current user: admin (administrator)

==> /var/log/foreman-proxy/proxy.log <==
E, [2017-11-20T03:11:55.404522 ] ERROR -- : wrong number of arguments (4 for 3)
I, [2017-11-20T03:11:55.404897 ]  INFO -- : 127.0.0.1 - - [20/Nov/2017:03:11:55 -0500] "GET /dhcp/10.8.113.0/unused_ip HTTP/1.1" 400 35 0.0011


==> /var/log/foreman/production.log <==
2017-11-20 03:11:55 7a3483c1 [app] [W] Failed to fetch a free IP from proxy SAT_SERVER (https://SAT_SERVER:9090): ERF12-8202 [ProxyAPI::ProxyException]: Unable to retrieve unused IP ([RestClient::BadRequest]: 400 Bad Request) for Capsule https://SAT_SERVER:9090/dhcp
2017-11-20 03:11:55 7a3483c1 [app] [I] Completed 200 OK in 99ms (Views: 0.5ms | ActiveRecord: 6.2ms)

Comment 4 Lukas Zapletal 2017-11-20 15:03:39 UTC
These two bugs are dupe, I will let Dmitri and QAs to decide which one to close as a dupe:

https://bugzilla.redhat.com/show_bug.cgi?id=1514885
https://bugzilla.redhat.com/show_bug.cgi?id=1459644

Comment 5 Lukas Zapletal 2017-11-20 15:11:15 UTC
Regression in DHCP proxy module apparently as per https://bugzilla.redhat.com/show_bug.cgi?id=1459644#c21

Comment 6 Lukas Zapletal 2017-11-20 15:12:27 UTC
This BZ blocks https://bugzilla.redhat.com/show_bug.cgi?id=1459644 so I think we should not close as dupe.

Comment 7 Dmitri Dolguikh 2017-11-20 20:36:20 UTC
Created an upstream issue: http://projects.theforeman.org/issues/21710

Comment 8 Dmitri Dolguikh 2017-11-20 20:37:45 UTC
This bug is separate from https://bugzilla.redhat.com/show_bug.cgi?id=1459644 AND is tracked separately upstream, I think this warrants a dedicated BZ.

Comment 9 Sachin Ghai 2017-11-22 08:05:33 UTC
PR attached to upstream issue fixed the issue on my setup.

Comment 10 Nikhil Kathole 2017-11-27 16:27:36 UTC
*** Bug 1517876 has been marked as a duplicate of this bug. ***

Comment 11 Perry Gagne 2017-11-27 20:56:39 UTC
To make this bug easier to search the error you will see when this happens is: 

"Failed to fetch a free IP from Capsule %{Capsule}: %{message}"

Comment 12 Nikhil Kathole 2017-12-05 12:09:08 UTC
VERIFIED

Version Tested:
Satellite-6.3 Snap 27

Found Successfully fetch a free IP from Capsule.

Comment 13 Nikhil Kathole 2017-12-05 12:10:10 UTC
Created attachment 1363179 [details]
Fetched free IP from capsule

Comment 15 Bryan Kearney 2018-02-21 17:05:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.

For information on the advisory, and where to find the updated files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.