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

Error when switching Recipes from dev to azure #6303

Open
Tracked by #7
AaronCrawfis opened this issue Jun 7, 2023 · 1 comment
Open
Tracked by #7

Error when switching Recipes from dev to azure #6303

AaronCrawfis opened this issue Jun 7, 2023 · 1 comment

Comments

@AaronCrawfis
Copy link
Contributor

AaronCrawfis commented Jun 7, 2023

Steps to reproduce

  1. Run rad init --dev and create a new application
  2. Replace the contents of app.bicep with:
import radius as radius

@description('The ID of your Radius environment. Automatically injected by the rad CLI.')
param environment string

@description('The ID of your Radius application. Automatically injected by the rad CLI.')
param application string

resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
  name: 'frontend'
  properties: {
    application: application
    container: {
      image: 'radius.azurecr.io/tutorial/webapp:edge'
    }
    connections: {
      // Define a connection to the redis container
      // Automatically injects conneciton information into the container
      redis: {
        source: db.id
      }
    }
  }
}

resource db 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
  name: 'db'
  properties: {
    environment: environment
    application: application
    // recipe is not specified, so it uses 'default' if present
  }
}
  1. Run rad deploy. It should succeed
  2. Run:
    rad recipe register azure --environment default --template-kind bicep --template-path radius.azurecr.io/recipes/azure/rediscaches:0.21 --link-type Applications.Link/redisCaches
  3. Update your app.bicep with:
import radius as radius

@description('The ID of your Radius environment. Automatically injected by the rad CLI.')
param environment string

@description('The ID of your Radius application. Automatically injected by the rad CLI.')
param application string

resource frontend 'Applications.Core/containers@2022-03-15-privatepreview' = {
  name: 'frontend'
  properties: {
    application: application
    container: {
      image: 'radius.azurecr.io/tutorial/webapp:edge'
    }
    connections: {
      // Define a connection to the redis container
      // Automatically injects conneciton information into the container
      redis: {
        source: db.id
      }
    }
  }
}

resource db 'Applications.Link/redisCaches@2022-03-15-privatepreview' = {
  name: 'db'
  properties: {
    environment: environment
    application: application
    recipe: {
      // Name a specific recipe to use
      name: 'azure'
    }
  }
}
  1. Deploy with rad deploy
  2. Get error

Observed behavior

$ rad deploy .\app.bicep
Building .\app.bicep...
Deploying template '.\app.bicep' for application 'recipes' and environment 'default' from workspace 'default'...

Deployment In Progress...

Failed               db              Applications.Link/redisCaches
Error: {
  "code": "DeploymentFailed",
  "message": "At least one resource deployment operation failed. Please see the details for the specific operation that failed.",
  "details": [
    {
      "code": "ResourceDeploymentFailure",
      "message": "Failed",
      "details": [
        {
          "code": "Internal",
          "message": "failed to delete resource \"/planes/kubernetes/local/namespaces/default-recipes/providers/core/Service/redis-ymbjcqyjzwkpg\": resource name may not be empty"
        }
      ]
    }
  ]
}

TraceId:  2d21d7295cbe32be5536d283be1b7569

Expected results

I would expect the Kubernetes service deletion to succeed and the deployment to succeed

Workaround

Run rad resource delete rediscaches db to delete the redis cache (and the resources within the recipe)

Version

RELEASE   VERSION   BICEP     COMMIT
0.21.1    v0.21.1   0.11.51   5e152fe79ad50d179a1339ae10c7d0a6e4e20686

AB#8135

@rynowak
Copy link
Contributor

rynowak commented Jun 7, 2023

Note that this is something we'll block in the future (recipe stickiness).

However this is a real bug, and a good way for us to test garbage collection for recipes. We should fix this and add a functional test for garbage collection.

@willtsai willtsai transferred this issue from radius-project/radius Sep 19, 2023
@AaronCrawfis AaronCrawfis transferred this issue from another repository Sep 19, 2023
@willtsai willtsai moved this to 📋 Backlog in Radius Roadmap Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants