Bug 1332124

Summary: A multisite realm pull using master endpoint IP address does not work
Product: Red Hat Ceph Storage Reporter: shilpa <smanjara>
Component: RGWAssignee: Casey Bodley <cbodley>
Status: CLOSED WORKSFORME QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.0CC: cbodley, ceph-eng-bugs, hnallurv, kbader, kdreyer, mbenjamin, owasserm, smanjara, sweil
Target Milestone: rc   
Target Release: 2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 06:08:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description shilpa 2016-05-02 09:51:40 UTC
Description of problem:
Instead of using the hostname, if we specify the IP in the url during realm pull, it results in a "Invalid argument" error


Version-Release number of selected component (if applicable):
ceph-radosgw-10.2.0-1.el7cp.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Configure master zone.
2. From a secondary zone do a realm pull:
# radosgw-admin realm pull --url=http://10.x.x.x:8080 --access-key=$access --secret=$secret 

Results in the following error:

# radosgw-admin realm pull --url=http://10.x.x.x:8080 --access-key=access --secret=secret
2016-05-02 09:44:58.409130 7f6640574a40  0 curl_easy_perform returned error: Failed connect to 10.x.x.x:8080; Connection refused
request failed: (22) Invalid argument

When the endpoint used is valid, we should allow realm pull to use it.

Comment 2 Casey Bodley 2016-05-03 20:36:05 UTC
A bug here would be surprising, as we pass this url directly to libcurl. When this fails with an IP address, does it succeed with a dns name immediately after?

In testing, I am able to use 'realm pull' with an IP address without issues:

# radosgw-admin realm pull --rgw-realm dev --url http://10.9.8.7:8000 --access-key access --secret secret --default

2016-05-03 15:35:25.828908 7f9dfbe08e40  0 error read_lastest_epoch .rgw.root:periods.0916005e-7bdd-4fc6-a3fc-0bb583538ffc.latest_epoch
2016-05-03 15:35:27.272460 7f9dfbe08e40  1 Set the period's master zonegroup 2387e282-ae82-4f4b-bf57-7803cb062df4 as the default
{
    "id": "38928d14-a374-4f3a-aa52-bc078fca60cc",
    "name": "dev",
    "current_period": "0916005e-7bdd-4fc6-a3fc-0bb583538ffc",
    "epoch": 2
}

Comment 3 shilpa 2016-05-04 07:29:55 UTC
(In reply to Casey Bodley from comment #2)
> A bug here would be surprising, as we pass this url directly to libcurl.
> When this fails with an IP address, does it succeed with a dns name
> immediately after?

I actually used port 8080 which is the default port used in ceph-ansible. And yes it does succeed with dns name immediately after.

> 
> In testing, I am able to use 'realm pull' with an IP address without issues:
> 
> # radosgw-admin realm pull --rgw-realm dev --url http://10.9.8.7:8000
> --access-key access --secret secret --default
> 
> 2016-05-03 15:35:25.828908 7f9dfbe08e40  0 error read_lastest_epoch
> .rgw.root:periods.0916005e-7bdd-4fc6-a3fc-0bb583538ffc.latest_epoch
> 2016-05-03 15:35:27.272460 7f9dfbe08e40  1 Set the period's master zonegroup
> 2387e282-ae82-4f4b-bf57-7803cb062df4 as the default
> {
>     "id": "38928d14-a374-4f3a-aa52-bc078fca60cc",
>     "name": "dev",
>     "current_period": "0916005e-7bdd-4fc6-a3fc-0bb583538ffc",
>     "epoch": 2
> }

I haven't got a chance to test with port 8000. Also, I have selinux in enforced mode.

Comment 4 Casey Bodley 2016-05-05 19:31:55 UTC
Hi Shilpa,

I suspect that this issue is not specific to radosgw-admin. Can you try using this ip address to access the gateway through other clients like s3 and swift?

Also, can you run 'dig +short <dns-name>' to confirm that the dns-name really does resolve to the same ip?

Comment 5 Ken Dreyer (Red Hat) 2016-05-10 13:07:31 UTC
From Yehuda's email earlier today:
> We couldn't reproduce this one, bug suggested misconfiguration.

Re-targeting to 2.1.

Comment 6 shilpa 2016-05-11 06:08:51 UTC
(In reply to Casey Bodley from comment #4)
> Hi Shilpa,
> 
> I suspect that this issue is not specific to radosgw-admin. Can you try
> using this ip address to access the gateway through other clients like s3
> and swift?
> 
> Also, can you run 'dig +short <dns-name>' to confirm that the dns-name
> really does resolve to the same ip?

I am not able to reproduce this in the latest build. Will re-open the BZ if I hit it again.