Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: ReconcileError: Cannot import existing resource #828

Open
1 task done
1aziz opened this issue Sep 26, 2024 · 1 comment
Open
1 task done

[Bug]: ReconcileError: Cannot import existing resource #828

1aziz opened this issue Sep 26, 2024 · 1 comment
Labels
bug Something isn't working needs:triage

Comments

@1aziz
Copy link

1aziz commented Sep 26, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

cache.azure.upbound.io/v1beta1 - RedisLinkedServer

Resource MRs required to reproduce the bug

apiVersion: cache.azure.upbound.io/v1beta1
kind: RedisLinkedServer
metadata:
  annotations:
    crossplane.io/external-name: >-
      /subscriptions/***/resourceGroups/rg-stage-blue/providers/Microsoft.Cache/redis/redis-stage-blue-trading/linkedServers/redis-stage-green-trading
  labels:
    subscription: prod
  name: redislinkedserver-stage-blue-trading
spec:
  deletionPolicy: Orphan
  forProvider:
    linkedRedisCacheId: >-
      /subscriptions/***/resourceGroups/rg-stage-green/providers/Microsoft.Cache/redis/redis-stage-green-trading
    linkedRedisCacheLocation: westeurope
    resourceGroupName: rg-stage-blue
    serverRole: Secondary
    targetRedisCacheName: redis-stage-blue-trading
  providerConfigRef:
    name: azure-prod

Steps to Reproduce

No actions applicable. The ReconcileError was thrown automatically.

What happened?

When Crossplane tries to reconcile my RedisLinkedServer resource, I recieve the following error:

create failed: async create failed: failed to create the resource: [{0 A resource with the ID "/subscriptions/***/resourceGroups/rg-stage-blue/providers/Microsoft.Cache/redis/redis-stage-blue-trading/linkedServers/redis-stage-green-trading" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_redis_linked_server" for more information. []}]

I am not what really happens. I did not change anything in the manifest and suddenly we're getting this error! The resource is healthy on the Azure side.

Provider version: xpkg.upbound.io/upbound/provider-azure-cache:v

Relevant Error Output Snippet

create failed: async create failed: failed to create the resource: [{0 A resource with the ID "/subscriptions/***/resourceGroups/rg-stage-blue/providers/Microsoft.Cache/redis/redis-stage-blue-trading/linkedServers/redis-stage-green-trading" already exists - to be managed via Terraform this resource needs to be imported into the State. Please see the resource documentation for "azurerm_redis_linked_server" for more information. []}]

Crossplane Version

1.17.1

Provider Version

1.1.0

Kubernetes Version

1.28.5

Kubernetes Distribution

AKS

Additional Info

No response

@1aziz 1aziz added bug Something isn't working needs:triage labels Sep 26, 2024
@1aziz 1aziz changed the title [Bug]: ReconcileError: Cannot import existing resource with default managementPolicies [Bug]: ReconcileError: Cannot import existing resource Sep 26, 2024
@JakobGSvendsen
Copy link

we have same error with cosmos db:

" async create failed: failed to create the resource: [{0 CosmosDB Account dcdb001asct-nl2 already exists, please import the resource via terraform import []}] "

And I tried to add the external-name to see if it imported but no luck. I did earlier deploy a resource with this name, but it has been deleted long time ago.

Can I reset the state file in terraform or somehow fix it otherwise?

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

No branches or pull requests

2 participants