crossplane-contrib / provider-upjet-gcp

Official GCP Provider for Crossplane by Upbound.
Apache License 2.0
64 stars 71 forks source link

[Bug]: v1.0.0 Connection Error waiting for Create Service Networking Connection #474

Open haarchri opened 6 months ago

haarchri commented 6 months ago

Is there an existing issue for this?

Affected Resource(s)

Resource MRs required to reproduce the bug

No response

Steps to Reproduce

2024-03-11T15:44:07.3718368Z     logger.go:42: 15:44:07 | case/0-apply | - apiVersion: servicenetworking.gcp.upbound.io/v1beta1
2024-03-11T15:44:07.3719254Z     logger.go:42: 15:44:07 | case/0-apply |   kind: Connection
2024-03-11T15:44:07.3719918Z     logger.go:42: 15:44:07 | case/0-apply |   metadata:
2024-03-11T15:44:07.3720585Z     logger.go:42: 15:44:07 | case/0-apply |     annotations:
2024-03-11T15:44:07.3721701Z     logger.go:42: 15:44:07 | case/0-apply |       crossplane.io/composition-resource-name: PrivateConnection
2024-03-11T15:44:07.3722942Z     logger.go:42: 15:44:07 | case/0-apply |       crossplane.io/external-create-pending: "2024-03-11T15:43:29Z"
2024-03-11T15:44:07.3724087Z     logger.go:42: 15:44:07 | case/0-apply |       crossplane.io/external-create-succeeded: "2024-03-11T15:43:29Z"
2024-03-11T15:44:07.3725066Z     logger.go:42: 15:44:07 | case/0-apply |       upjet.upbound.io/test: "true"
2024-03-11T15:44:07.3725981Z     logger.go:42: 15:44:07 | case/0-apply |     creationTimestamp: "2024-03-11T15:23:03Z"
2024-03-11T15:44:07.3726763Z     logger.go:42: 15:44:07 | case/0-apply |     finalizers:
2024-03-11T15:44:07.3727599Z     logger.go:42: 15:44:07 | case/0-apply |     - finalizer.managedresource.crossplane.io
2024-03-11T15:44:07.3728945Z     logger.go:42: 15:44:07 | case/0-apply |     generateName: configuration-gcp-database-mysql-hw9pw-
2024-03-11T15:44:07.3730554Z     logger.go:42: 15:44:07 | case/0-apply |     generation: 3
2024-03-11T15:44:07.3731808Z     logger.go:42: 15:44:07 | case/0-apply |     labels:
2024-03-11T15:44:07.3733123Z     logger.go:42: 15:44:07 | case/0-apply |       crossplane.io/claim-name: configuration-gcp-database-mysql
2024-03-11T15:44:07.3734657Z     logger.go:42: 15:44:07 | case/0-apply |       crossplane.io/claim-namespace: default
2024-03-11T15:44:07.3736850Z     logger.go:42: 15:44:07 | case/0-apply |       crossplane.io/composite: configuration-gcp-database-mysql-hw9pw
2024-03-11T15:44:07.3738954Z     logger.go:42: 15:44:07 | case/0-apply |     name: configuration-gcp-database-mysql-hw9pw-nk9xm
2024-03-11T15:44:07.3740553Z     logger.go:42: 15:44:07 | case/0-apply |     ownerReferences:
2024-03-11T15:44:07.3742156Z     logger.go:42: 15:44:07 | case/0-apply |     - apiVersion: gcp.platform.upbound.io/v1alpha1
2024-03-11T15:44:07.3743712Z     logger.go:42: 15:44:07 | case/0-apply |       blockOwnerDeletion: true
2024-03-11T15:44:07.3745121Z     logger.go:42: 15:44:07 | case/0-apply |       controller: true
2024-03-11T15:44:07.3746455Z     logger.go:42: 15:44:07 | case/0-apply |       kind: XSQLInstance
2024-03-11T15:44:07.3747641Z     logger.go:42: 15:44:07 | case/0-apply |       name: configuration-gcp-database-mysql-hw9pw
2024-03-11T15:44:07.3748627Z     logger.go:42: 15:44:07 | case/0-apply |       uid: 8b0f3947-6ec9-4403-b978-f1f5a14e9875
2024-03-11T15:44:07.3749476Z     logger.go:42: 15:44:07 | case/0-apply |     resourceVersion: "5365"
2024-03-11T15:44:07.3750356Z     logger.go:42: 15:44:07 | case/0-apply |     uid: 535d20f2-a32e-4769-afbc-9e8ca8fc87dc
2024-03-11T15:44:07.3751125Z     logger.go:42: 15:44:07 | case/0-apply |   spec:
2024-03-11T15:44:07.3751844Z     logger.go:42: 15:44:07 | case/0-apply |     deletionPolicy: Delete
2024-03-11T15:44:07.3752568Z     logger.go:42: 15:44:07 | case/0-apply |     forProvider:
2024-03-11T15:44:07.3753690Z     logger.go:42: 15:44:07 | case/0-apply |       network: projects/official-provider-testing/global/networks/configuration-gcp-database
2024-03-11T15:44:07.3754701Z     logger.go:42: 15:44:07 | case/0-apply |       networkRef:
2024-03-11T15:44:07.3755515Z     logger.go:42: 15:44:07 | case/0-apply |         name: configuration-gcp-database
2024-03-11T15:44:07.3756321Z     logger.go:42: 15:44:07 | case/0-apply |       networkSelector:
2024-03-11T15:44:07.3757297Z     logger.go:42: 15:44:07 | case/0-apply |         matchLabels:
2024-03-11T15:44:07.3758346Z     logger.go:42: 15:44:07 | case/0-apply |           networks.gcp.platform.upbound.io/network-id: configuration-gcp-database
2024-03-11T15:44:07.3759343Z     logger.go:42: 15:44:07 | case/0-apply |       reservedPeeringRanges:
2024-03-11T15:44:07.3760395Z     logger.go:42: 15:44:07 | case/0-apply |       - configuration-gcp-database-mysql-hw9pw-sbt2b
2024-03-11T15:44:07.3762120Z     logger.go:42: 15:44:07 | case/0-apply |       reservedPeeringRangesRefs:
2024-03-11T15:44:07.3763932Z     logger.go:42: 15:44:07 | case/0-apply |       - name: configuration-gcp-database-mysql-hw9pw-sbt2b
2024-03-11T15:44:07.3765865Z     logger.go:42: 15:44:07 | case/0-apply |       reservedPeeringRangesSelector:
2024-03-11T15:44:07.3767471Z     logger.go:42: 15:44:07 | case/0-apply |         matchControllerRef: true
2024-03-11T15:44:07.3769044Z     logger.go:42: 15:44:07 | case/0-apply |       service: servicenetworking.googleapis.com
2024-03-11T15:44:07.3770521Z     logger.go:42: 15:44:07 | case/0-apply |     initProvider: ***
2024-03-11T15:44:07.3771807Z     logger.go:42: 15:44:07 | case/0-apply |     managementPolicies:
2024-03-11T15:44:07.3773045Z     logger.go:42: 15:44:07 | case/0-apply |     - '*'
2024-03-11T15:44:07.3774306Z     logger.go:42: 15:44:07 | case/0-apply |     providerConfigRef:
2024-03-11T15:44:07.3775614Z     logger.go:42: 15:44:07 | case/0-apply |       name: default
2024-03-11T15:44:07.3776802Z     logger.go:42: 15:44:07 | case/0-apply |   status:
2024-03-11T15:44:07.3778023Z     logger.go:42: 15:44:07 | case/0-apply |     atProvider: ***
2024-03-11T15:44:07.3779283Z     logger.go:42: 15:44:07 | case/0-apply |     conditions:
2024-03-11T15:44:07.3780825Z     logger.go:42: 15:44:07 | case/0-apply |     - lastTransitionTime: "2024-03-11T15:23:51Z"
2024-03-11T15:44:07.3782555Z     logger.go:42: 15:44:07 | case/0-apply |       reason: ReconcileSuccess
2024-03-11T15:44:07.3783955Z     logger.go:42: 15:44:07 | case/0-apply |       status: "True"
2024-03-11T15:44:07.3785337Z     logger.go:42: 15:44:07 | case/0-apply |       type: Synced
2024-03-11T15:44:07.3786874Z     logger.go:42: 15:44:07 | case/0-apply |     - lastTransitionTime: "2024-03-11T15:23:51Z"
2024-03-11T15:44:07.3788374Z     logger.go:42: 15:44:07 | case/0-apply |       reason: Creating
2024-03-11T15:44:07.3789700Z     logger.go:42: 15:44:07 | case/0-apply |       status: "False"
2024-03-11T15:44:07.3790947Z     logger.go:42: 15:44:07 | case/0-apply |       type: Ready
2024-03-11T15:44:07.3792438Z     logger.go:42: 15:44:07 | case/0-apply |     - lastTransitionTime: "2024-03-11T15:43:40Z"
2024-03-11T15:44:07.3793858Z     logger.go:42: 15:44:07 | case/0-apply |       message: |-
2024-03-11T15:44:07.3797333Z     logger.go:42: 15:44:07 | case/0-apply |         async create failed: failed to create the resource: [***0 Error waiting for Create Service Networking Connection: Error code 9, message: Cannot modify allocated ranges in CreateConnection. Please use UpdateConnection.

What happened?

after upgrade to v1.0.0 we get the following error from provider:

async create failed: failed to create the resource: [***0 Error waiting for Create Service Networking Connection: Error code 9, message: Cannot modify allocated ranges in CreateConnection. Please use UpdateConnection.

Relevant Error Output Snippet

No response

Crossplane Version

v1.15.0

Provider Version

v1.0.0

Kubernetes Version

No response

Kubernetes Distribution

No response

Additional Info

No response

turkenf commented 6 months ago

Hi @haarchri,

I cannot reproduce the error permanently.

I saw the same error message for a short time when the Connection.servicenetworking resource was first created, but I was able to create it successfully in my subsequent attempts.

NAME                                                  READY   SYNCED   EXTERNAL-NAME    AGE
globaladdress.compute.gcp.upbound.io/test-sc-ft-ga1   True    True     test-sc-ft-ga1   14m

NAME                                           READY   SYNCED   EXTERNAL-NAME   AGE
network.compute.gcp.upbound.io/test-sc-ft-n1   True    True     test-sc-ft-n1   14m

NAME                                                      READY   SYNCED   EXTERNAL-NAME
             AGE
connection.servicenetworking.gcp.upbound.io/test-sc-ft1   True    True     projects%2Fofficial-provider-testing%2Fglobal%2Fnetworks%2Ftest-sc-ft-n1:servicenetworking.goog
leapis.com   14m
connection.servicenetworking.gcp.upbound.io/test-sc-ft2   True    True     projects%2Fofficial-provider-testing%2Fglobal%2Fnetworks%2Ftest-sc-ft-n1:servicenetworking.goog
leapis.com   9m8s
connection.servicenetworking.gcp.upbound.io/test-sc-ft3   True    True     projects%2Fofficial-provider-testing%2Fglobal%2Fnetworks%2Ftest-sc-ft-n1:servicenetworking.goog
leapis.com   7m14s
status:
  atProvider:
    id: projects%2Fofficial-provider-testing%2Fglobal%2Fnetworks%2Ftest-sc-ft-n1:servicenetworking.googleapis.com
    network: projects/official-provider-testing/global/networks/test-sc-ft-n1
    peering: servicenetworking-googleapis-com
    reservedPeeringRanges:
    - test-sc-ft-ga1
    service: servicenetworking.googleapis.com
  conditions:
  - lastTransitionTime: "2024-03-11T23:30:31Z"
    reason: ReconcileSuccess
    status: "True"
    type: Synced
  - lastTransitionTime: "2024-03-11T23:32:25Z"
    reason: Available
    status: "True"
    type: Ready
  - lastTransitionTime: "2024-03-11T23:32:21Z"
    reason: Success
    status: "True"
    type: LastAsyncOperation
  - lastTransitionTime: "2024-03-11T23:39:49Z"
    reason: UpToDate
    status: "True"
    type: Test

But there is a related issue upstream: https://github.com/hashicorp/terraform-provider-google/issues/16697

haarchri commented 6 months ago

i have no luck with https://github.com/upbound/configuration-gcp-database/actions/runs/8235303142 - possible that i miss something

haarchri commented 5 months ago

looks like its related to:

https://www.googlecloudcommunity.com/gc/Infrastructure-Compute-Storage/Error-waiting-for-Create-Service-Networking-Connection-Error/m-p/720205

Update: resolved the issue by changing the name of the VPC I was trying to create and deploy.

In terraform resource "google_compute_network" I changed the 'name' element by one character. And now resource "google_service_networking_connection" applies onto that VPC with no problem.

It seems something with the VPC name conflicted in the backend. Maybe I deleted a VPC with that same name a few years ago?

did the same and create a never used VPC - now its working

haarchri commented 5 months ago

but we hitting this issue during deletion: https://github.com/hashicorp/terraform-provider-google/issues/16275

haarchri commented 5 months ago

after deletion in a fresh vpc same issue again:

Message: async create failed: failed to create the resource: [{0 Error waiting for Create Service Networking Connection: Error code 9, message: Cannot modify allocated ranges in CreateConnection. Please use UpdateConnection.

github-actions[bot] commented 2 months ago

This provider repo does not have enough maintainers to address every issue. Since there has been no activity in the last 90 days it is now marked as stale. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

haarchri commented 2 months ago

/fresh