Troubleshoot deployment issues

This guide provides step-by-step troubleshooting actions to remediate deployment issues. We hope you don’t need this guide. If you encounter an issue and aren’t able to address it via this guide, please raise an issue here.

1. Terraform failed to deploy the Charmed Aether SD-Core with Unable to create model error

Symptoms

The terraform apply -auto-approve command fails with an error indicating that the Juju model could not be created:

Plan: 72 to add, 0 to change, 0 to destroy.
juju_model.private5g: Creating...
│ Error: Client Error
│   with juju_model.private5g,
│   on main.tf line 1, in resource "juju_model" "private5g":
│    1: resource "juju_model" "private5g" {
│ Unable to create model, got error: failed to open kubernetes client: annotations map[controller.juju.is/id:ced7016b-3a63-4133-8988-cf33068c3cdf
│ model.juju.is/id:2abfe7ab-9e40-4e0d-8158-53450c47b2db] for namespace "private5g" not valid must include map[controller.juju.is/id:ced7016b-3a63-4133-8988-cf33068c3cdf
│ model.juju.is/id:9755936b-8084-4397-8a67-28773b361dfa] (not valid)

2. Terraform failed to deploy Charmed Aether SD-Core with Connection error, please check the controller_addresses property set on the provider error

Symptoms

The terraform apply -auto-approve command fails with an error indicating that the Juju controller couldn’t be connected to:

$ terraform apply --auto-approve
│ Error: Invalid provider configuration
│ Provider "registry.terraform.io/juju/juju" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in
│ the provider documentation.
│ Error: dial tcp 10.152.183.251:17070: i/o timeout
│   with provider["registry.terraform.io/juju/juju"],
│   on <empty> line 0:
│   (source code not available)
│ Connection error, please check the controller_addresses property set on the provider

Recommended Actions

Validate that the Juju controller exists.

First, list the available Juju controllers:

$ juju controllers
Use --refresh option with this command to see the latest information.

Controller           Model      User   Access     Cloud/Region        Models  Nodes  HA  Version
microk8s-localhost*  private5g  admin  superuser  microk8s/localhost       9      -   -  3.6.0  

If your controller does not show up in the list, please follow this guide to create a Juju controller.

Otherwise, follow this guide to remove your broken Juju controller.

Once the controller is removed, please make sure that the controller namespace is not found in your MicroK8s cluster:

$ kubectl get ns controller-<your-controller-name>
NAME                            STATUS   AGE
controller-<your-controller-name>   Active   20d

If your controller namespace appears as Active in the command output, remove the namespace manually:

$ kubectl delete ns controller-<your-controller-name>
namespace "controller-<your-controller-name>" deleted

After successful removal of the controller namespace, please follow this guide to create a new Juju controller.