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

Bug 1795436

Summary: openshift-install destroy cluster attempts to delete default routes in GCP
Product: OpenShift Container Platform Reporter: Steve Kuznetsov <skuznets>
Component: InstallerAssignee: Patrick Dillon <padillon>
Installer sub component: openshift-installer QA Contact: Yang Yang <yanyang>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: padillon, wking
Version: 4.4   
Target Milestone: ---   
Target Release: 4.4.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: GCP destroy tries to delete default routes. Consequence: default routes cannot be deleted manually and an error message was displayed Fix: create a more informative error message to show that error when trying to delete default routes is expected Result: users understand that default route will eventually be deleted along with corresponding network and error message can be ignored.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-04 11:27:25 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:
Embargoed:
Bug Depends On: 1742227    
Bug Blocks:    

Description Steve Kuznetsov 2020-01-27 23:28:04 UTC
Running a cluster destroy command selects some default, unrelated route to be deleted for all clusters in a project. The request to delete this route is malformed and cannot finish. Associated networks and subnetworks hang on deletion.

 level=debug msg="Listing subnetworks"
level=debug msg="Found subnetwork: ci-op-zxnf9-worker-subnet"
level=debug msg="Deleting subnetwork ci-op-zxnf9-worker-subnet"
level=debug msg="Subnetworks: failed to delete subnetwork ci-op-zxnf9-worker-subnet: googleapi: Error 400: The subnetwork resource 'projects/openshift-gce-devel-ci/regions/us-east1/subnetworks/ci-op-zxnf9-worker-subnet' is already being used by 'projects/openshift-gce-devel-ci/zones/us-east1-b/instances/e2e-mhc-1579900339-6tbm6', resourceInUseByAnotherResource"
level=debug msg="Listing networks"
level=debug msg="Found network: ci-op-zxnf9-network"
level=debug msg="Listing routes"
level=debug msg="Found route: default-route-135cb3565f520eea"
level=debug msg="Deleting route default-route-135cb3565f520eea"
level=debug msg="Failed to delete route {default-route-135cb3565f520eea default-route-135cb3565f520eea  route  }: failed to delete route default-route-135cb3565f520eea: googleapi: Error 400: The local route cannot be deleted., badRequest"
level=debug msg="Deleting network ci-op-zxnf9-network"
level=debug msg="Networks: failed to delete network ci-op-zxnf9-network with error: RESOURCE_IN_USE_BY_ANOTHER_RESOURCE: The network resource 'projects/openshift-gce-devel-ci/global/networks/ci-op-zxnf9-network' is already being used by 'projects/openshift-gce-devel-ci/zones/us-east1-b/instances/e2e-mhc-1579900339-6tbm6'"

Comment 4 Patrick Dillon 2020-02-05 13:32:44 UTC
Default routes cannot be manually deleted: they are deleted once the associated network is deleted, so these error messages are expected. These error messages are especially confusing because the dependent bug https://bugzilla.redhat.com/show_bug.cgi?id=1742227 is making the error message show up repeatedly. To satisfy this particular bug we should make the error message cleaner.

In order to verify, QA should run a normal GCP cluster destroy and check that the error message has been changed as mentioned in the commit message.

Comment 5 Yang Yang 2020-02-06 06:40:12 UTC
Verified with 4.4.0-0.nightly-2020-02-05-093448

Steps of verification as below:
1. Install an IPI cluster on GCP
2. Manually create a VM using the network created in step #1
3. Destroy the cluster
# openshift-install destroy cluster --dir=bz --log-level=debug

DEBUG Listing subnetworks                          
DEBUG Found subnetwork: yybz-p6mgt-worker-subnet   
DEBUG Deleting subnetwork yybz-p6mgt-worker-subnet 
DEBUG Subnetworks: failed to delete subnetwork yybz-p6mgt-worker-subnet: googleapi: Error 400: The subnetwork resource 'projects/openshift-qe/regions/us-central1/subnetworks/yybz-p6mgt-worker-subnet' is already being used by 'projects/openshift-qe/zones/us-central1-a/instances/yytest1', resourceInUseByAnotherResource 
DEBUG Listing networks                             
DEBUG Found network: yybz-p6mgt-network            
DEBUG Listing routes                               
DEBUG Found route: default-route-e6f0afc2eae0ab6b  
DEBUG Deleting route default-route-e6f0afc2eae0ab6b 
DEBUG Failed to delete route default-route-e6f0afc2eae0ab6b: this looks like a default route, which cannot be deleted manually but will be deleted with the corresponding network 

The error messages are as expected hence moving it to verified state.

Comment 7 errata-xmlrpc 2020-05-04 11:27:25 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/RHBA-2020:0581