juju / terraform-provider-juju

A Terraform provider for Juju
Apache License 2.0
19 stars 32 forks source link

subordinate charm upgrades fail #466

Open mthaddon opened 2 months ago

mthaddon commented 2 months ago

Description

Trying to upgrade a subordinate fails.

Urgency

Casually reporting

Terraform Juju Provider version

0.11.0

Terraform version

v1.8.1-dev

Terraform Configuration(s)

terraform {
  required_version = ">= 1.6.6"
  required_providers {
    juju = {
      source  = "juju/juju"
      version = "~> 0.11.0"
    }
  }
}
provider "juju" {}

resource "juju_application" "telegraf" {
  name  = "telegraf"
  model = "test"

    charm {
    name     = "telegraf"
    revision = 75
  }

  units = 0
}

Reproduce / Test

juju bootstrap lxd
juju add-model test

juju deploy ubuntu
juju deploy telegraf --revision=72 --channel=latest/stable
juju relate ubuntu telegraf

# Wait for active/idle status on the two charms

terraform init
terraform import juju_application.telegraf test:telegraf
terraform apply

Debug/Panic Output

╷
│ Error: Client Error
│
│   with juju_application.telegraf,
│   on main.tf line 12, in resource "juju_application" "telegraf":
│   12: resource "juju_application" "telegraf" {
│
│ Unable to update application resource, got error: constraints do not apply to subordinate applications
╵

Notes & References

No response

cderici commented 2 months ago

@mthaddon what version of Juju is this?

mthaddon commented 2 months ago

@cderici sorry, this is on 3.1.8.

gianlucaperna commented 6 days ago

Hi, the same thing happened to me using both telegraf and autocert. Any suggestions on how to solve it?

Juju version: 3.5.1-ubuntu-amd64 Terraform version: v1.8.5-dev Juju provider version: v0.10.1 (but also with 0.11.0)

 Error: Client Error
│ 
│   with juju_application.autocert,
│   on main.tf line 29, in resource "juju_application" "autocert":
│   29: resource "juju_application" "autocert" {
│ 
│ Unable to update application resource, got error: constraints do not apply to subordinate applications
│ Error: Client Error
│ 
│   with module.subordinates.juju_application.telegraf[0],
│   on .terraform/modules/subordinates/subordinates/main.tf line 86, in resource "juju_application" "telegraf":
│   86: resource "juju_application" "telegraf" {
│ 
│ Unable to update application resource, got error: constraints do not apply to subordinate applications
hmlanigan commented 5 days ago

constraints do not apply to subordinate applications

This error is coming from juju itself. Investigation will be need to determine where to fix this issue. It is currently assigned to @jack-w-shaw