Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Subnet spec.forProvider.addressPrefix causes observe errors #178

Open
natereid72 opened this issue Apr 19, 2022 · 1 comment
Open

Subnet spec.forProvider.addressPrefix causes observe errors #178

natereid72 opened this issue Apr 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@natereid72
Copy link

natereid72 commented Apr 19, 2022

What happened?

Create Subnet with spec.forProvider.addressPrefix configured. Subnet creates ok in Azure cloud. MR reports Ready:True/Synced:True. Then on a subsequent reconcile, it changes to Ready:True/Synced:False. The MR will not delete gracefully at that point.

Config used:

    - base:
        apiVersion: network.azure.jet.crossplane.io/v1alpha2
        kind: Subnet
        spec:
          forProvider:
            resourceGroupNameSelector:
              matchControllerRef: true
            virtualNetworkNameSelector:
              matchControllerRef: true
            addressPrefix: "192.168.1.0/24"
            serviceEndpoints: ["Microsoft.Sql"]

Error reported with kubectl describe on MR:

Warning  CannotObserveExternalResource  5m22s (x7 over 10m)  managed/network.azure.jet.crossplane.io/v1alpha2, kind=subnet  cannot run refresh: refresh failed: Invalid combination of arguments: "address_prefixes": only one of `address_prefix,address_prefixes` can be specified, but `address_prefix,address_prefixes` were specified.: File name: main.tf.json

When trying to delete the XR/MR, it hangs for a long time and then produces this error:

error: An error occurred while waiting for the object to be deleted: an error on the server ("unable to decode an event from the watch stream: stream error: stream ID 167; INTERNAL_ERROR; received from peer") has prevented the request from succeeding

Switching config to the following resolved the issue. It seems as though on subsequent reconciles, the Provider is looking specifically for addressPrefixes. But addressPrefix is a valid option according to API documentation and from within the reported error.

    - base:
        apiVersion: network.azure.jet.crossplane.io/v1alpha2
        kind: Subnet
        spec:
          forProvider:
            resourceGroupNameSelector:
              matchControllerRef: true
            virtualNetworkNameSelector:
              matchControllerRef: true
            addressPrefixes: 
              - "192.168.1.0/24"
            serviceEndpoints: ["Microsoft.Sql"]

How can we reproduce it?

Create this resource as above?

What environment did it happen in?

  • Crossplane version: 1.5.1 (UbC hosted)
  • crossplane/provider-jet-azure:v0.9.0
@natereid72 natereid72 added the bug Something isn't working label Apr 19, 2022
@natereid72 natereid72 reopened this Apr 19, 2022
@muvaf
Copy link
Member

muvaf commented Apr 19, 2022

The error looks very similar to cases where we need to add late-initialization config https://github.com/crossplane/terrajet/blob/main/docs/configuring-a-resource.md#late-initialization-configuration cc @ulucinar

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants