Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1884421

Summary: [3.11] Wrong message error displayed when creating a route with path based
Product: OpenShift Container Platform Reporter: Miciah Dashiel Butler Masters <mmasters>
Component: NetworkingAssignee: Miciah Dashiel Butler Masters <mmasters>
Networking sub component: router QA Contact: Hongan Li <hongli>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: acomabon, aiyengar, amcdermo, anisal, aos-bugs, aygarg, bbennett, dmace, hongli, jechen, mfisher, mmasters, skuznets, sychen, vhernand
Version: 3.11.0   
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1821095 Environment:
Last Closed: 2021-08-25 15:16:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1821095, 1889868    
Bug Blocks:    

Description Miciah Dashiel Butler Masters 2020-10-01 22:38:46 UTC
+++ This bug was initially created as a clone of Bug #1821095 +++

Created attachment 1676479 [details]
All the steps to reproduce the issue with two scenarios

Description of problem:
After creating a route another route with the same hostname and path, the "HostAlreadyClaimed" comes up. Even on the deletion of the older route, "HostAlreadyClaimed" comes up for the route with the wrong message.

Version-Release number of selected component (if applicable):
v3.11.188
v3.11.153
v3.11.117

How reproducible:
Every time, I am providing the exact steps.

Steps to Reproduce:
1. Create a new project with a sample ruby application.

# oc new-project path-based-routes

# oc new-app centos/ruby-25-centos7~https://github.com/sclorg/ruby-ex.git

# oc get svc
NAME      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
ruby-ex   ClusterIP   172.30.216.93   <none>        8080/TCP   1m

2. Create one route without any path and one route with a path.

# oc create route edge --service=ruby-ex --hostname=base.example.com

# oc get routes
NAME      HOST/PORT          PATH      SERVICES   PORT       TERMINATION   WILDCARD
ruby-ex   base.example.com             ruby-ex    8080-tcp   edge          None

# oc create route edge path1 --service=ruby-ex --hostname=base.example.com --path=/path
route.route.openshift.io/path1 created

# oc get routes
NAME      HOST/PORT          PATH      SERVICES   PORT       TERMINATION   WILDCARD
path1     base.example.com   /path     ruby-ex    8080-tcp   edge          None
ruby-ex   base.example.com             ruby-ex    8080-tcp   edge          None

3. Now, create a route with the same configuration as to that of route path1.

# oc create route edge path2 --service=ruby-ex --hostname=base.example.com --path=/path
route.route.openshift.io/path2 created

# oc get routes
NAME      HOST/PORT            PATH      SERVICES   PORT       TERMINATION   WILDCARD
path1     base.example.com     /path     ruby-ex    8080-tcp   edge          None
path2     HostAlreadyClaimed   /path     ruby-ex    8080-tcp   edge          None
ruby-ex   base.example.com               ruby-ex    8080-tcp   edge          None

4. The description of route path2 reports that the route ruby-ex already exposes base.example.com and is older instead of path1 route.

# oc describe route path2
Name:           path2
Namespace:      path-based-routes
Created:        About a minute ago
Labels:         app=ruby-ex
Annotations:        <none>
Requested Host:     base.example.com
              rejected by router router: HostAlreadyClaimed (about a minute ago)
                route ruby-ex already exposes base.example.com and is older
Path:           /path
TLS Termination:    edge
Insecure Policy:    <none>
Endpoint Port:      8080-tcp

Service:    ruby-ex
Weight:     100 (100%)
Endpoints:  10.130.0.7:8080

5. Even after the deletion of path1 route, the path2 router reports HostAlreadyClaimed with the same description.

# oc delete route path1
route.route.openshift.io "path1" deleted

# oc get routes
NAME      HOST/PORT            PATH      SERVICES   PORT       TERMINATION   WILDCARD
path2     HostAlreadyClaimed   /path     ruby-ex    8080-tcp   edge          None
ruby-ex   base.example.com               ruby-ex    8080-tcp   edge          None

# oc describe route path2
Name:           path2
Namespace:      path-based-routes
Created:        3 minutes ago
Labels:         app=ruby-ex
Annotations:        <none>
Requested Host:     base.example.com
              rejected by router router: HostAlreadyClaimed (3 minutes ago)
                route ruby-ex already exposes base.example.com and is older
Path:           /path
TLS Termination:    edge
Insecure Policy:    <none>
Endpoint Port:      8080-tcp

Service:    ruby-ex
Weight:     100 (100%)
Endpoints:  10.130.0.7:8080

Actual results:
After the deletion of one route out of the two which is having the same hostname and port still shows "HostAlreadyClaimed".

Expected results:
The route shouldn't show "HostAlreadyClaimed".

Additional info:
The issue gets fixed by deleting the router pod so new pod comes up.

I found this bug which was opened for the same issue but it was closed considering not a bug as the wrong router image was being used but I am able to reproduce the issue on a freshly install OCP v3.11.188

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

Comment 1 Andrew McDermott 2020-10-02 15:57:37 UTC
https://github.com/openshift/origin/pull/25578

Tagging with UpcomingSprint while investigation is either ongoing or
pending. Will be considered for earlier release versions when
diagnosed and resolved.

Comment 2 Miciah Dashiel Butler Masters 2020-10-26 05:24:34 UTC
Fix is posted but blocked on CI issues.  We'll try to get this done in the upcoming sprint.

Comment 3 Miciah Dashiel Butler Masters 2020-11-14 00:43:43 UTC
Fix is posted but still blocked on CI issues (although some of the earlier issues have been resolved).  We'll continue working on getting this through CI in the upcoming sprint.

Comment 4 Miciah Dashiel Butler Masters 2020-12-07 03:07:49 UTC
Still investigating CI issues.  We'll try to get this through in the upcoming sprint.

Comment 5 Miciah Dashiel Butler Masters 2021-02-06 00:11:14 UTC
Still blocked on CI issues.

Comment 6 Miciah Dashiel Butler Masters 2021-02-26 06:28:18 UTC
Still blocked on CI issues (recent failures look like docker.io rate limiting).

Comment 7 Victor Hernando 2021-06-10 14:02:32 UTC
Hi Team, 

Do we have any update on this? Are you still facing CI issues?

Regards

Comment 8 Miciah Dashiel Butler Masters 2021-06-11 22:42:54 UTC
Need to follow up with PM as to how we will handle this and other 3.11 BZs that have been languishing in CI.

Comment 10 jechen 2021-08-09 17:16:13 UTC
Verified in v3.11.492

# oc version
oc v3.11.492
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://jechen-0806bmaster-etcd-nfs-1:8443
openshift v3.11.492
kubernetes v1.11.0+d4cacc0


# oc new-app --image-stream="openshift/ruby:latest"


# oc get all
NAME                READY     STATUS             RESTARTS   AGE
pod/ruby-1-68qpt    0/1       CrashLoopBackOff   1          35s
pod/ruby-1-deploy   1/1       Running            0          38s

NAME                           DESIRED   CURRENT   READY     AGE
replicationcontroller/ruby-1   1         1         0         38s

NAME           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/ruby   ClusterIP   172.30.176.50   <none>        8080/TCP   39s

NAME                                      REVISION   DESIRED   CURRENT   TRIGGERED BY
deploymentconfig.apps.openshift.io/ruby   1          1         1         config,image(ruby:latest)

NAME                                  DOCKER REPO                                      TAGS      UPDATED
imagestream.image.openshift.io/ruby   docker-registry.default.svc:5000/new-test/ruby   latest    
[root@jechen-0806bmaster-etcd-nfs-1 ~]# oc get svc
NAME      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
ruby      ClusterIP   172.30.176.50   <none>        8080/TCP   2m



# oc create route edge --service=ruby --hostname=base.example.com
route.route.openshift.io/ruby created

# oc get route
NAME      HOST/PORT          PATH      SERVICES   PORT       TERMINATION   WILDCARD
ruby      base.example.com             ruby       8080-tcp   edge          None

# oc create route edge path1 --service=ruby --hostname=base.example.com --path=/path
route.route.openshift.io/path1 created

# oc get routes
NAME      HOST/PORT          PATH      SERVICES   PORT       TERMINATION   WILDCARD
path1     base.example.com   /path     ruby       8080-tcp   edge          None
ruby      base.example.com             ruby       8080-tcp   edge          None

# oc create route edge path2 --service=ruby --hostname=base.example.com --path=/path
route.route.openshift.io/path2 created


# oc get routes
NAME      HOST/PORT            PATH      SERVICES   PORT       TERMINATION   WILDCARD
path1     base.example.com     /path     ruby       8080-tcp   edge          None
path2     HostAlreadyClaimed   /path     ruby       8080-tcp   edge          None
ruby      base.example.com               ruby       8080-tcp   edge          None

# oc describe route path2
Name:			path2
Namespace:		new-test
Created:		24 seconds ago
Labels:			app=ruby
Annotations:		<none>
Requested Host:		base.example.com
			  rejected by router router: HostAlreadyClaimed (25 seconds ago)
			    route ruby already exposes base.example.com and is older
Path:			/path
TLS Termination:	edge
Insecure Policy:	<none>
Endpoint Port:		8080-tcp

Service:	ruby
Weight:		100 (100%)
Endpoints:	<none>

# oc delete route path1
route.route.openshift.io "path1" deleted


# oc get routes
NAME      HOST/PORT          PATH      SERVICES   PORT       TERMINATION   WILDCARD
path2     base.example.com   /path     ruby       8080-tcp   edge          None
ruby      base.example.com             ruby       8080-tcp   edge          None   <---  After the deletion of one route out of the two, path2 got the correct host/post message



# oc describe route path2
Name:			path2
Namespace:		new-test
Created:		50 seconds ago
Labels:			app=ruby
Annotations:		<none>
Requested Host:		base.example.com
			  exposed on router router 10 seconds ago
Path:			/path
TLS Termination:	edge
Insecure Policy:	<none>
Endpoint Port:		8080-tcp

Service:	ruby
Weight:		100 (100%)
Endpoints:	<none>

Comment 13 errata-xmlrpc 2021-08-25 15:16:51 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 (Moderate: OpenShift Container Platform 3.11.z security and bug fix update), 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-2021:3193