Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

[BUG] Terraform - Failed to get existing workspaces: containers.Client#ListBlobs: Code="ContainerNotFound" #474

Description

@code-bucket-user

Describe the bug
During the execution of gitops action, it is failure on steps - name: Apply Terraform configuration.
Terraform backend configured properly as per the standard. steps -uses: microsoft/nubesgen-actions/gitops-apply-terraform@v0.13.0.
But it is throwing bellow error

**Error:** Failed to get existing workspaces: containers.Client#ListBlobs: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="ContainerNotFound" Message="The specified container does not exist.\nRequestId:*****

Where as existing backend configuration running perfectly during manual execution using terraform init / terraform init -reconfigure

Observations
Actual issue is in the gitops action template code -backend-config="container_name=tfstate" \, if it is take the container name dynamically from backend configuration then it should not be a problem. But for that we need to change in the action template code. So for now if I use tfsate as a container name, it is working perfectly.

To Reproduce
Steps to reproduce the behavior:

  1. Create an Storage account.

  2. Create a Blob Storage Container.

  3. Configure backend "azurerm" {
    resource_group_name = "rg-sample-dev-us"
    storage_account_name = "st001sampleus"
    container_name = "sample-container-us-1"
    key = "terraform.tfstate"
    access_key = "********"
    }

  4. Run the gitops action.

Expected behavior
Initializing the backend...

Successfully configured the backend "azurerm"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing modules...

Initializing provider plugins...

  • Finding aztfmod/azurecaf versions matching "1.2.26"...
  • Finding hashicorp/azurerm versions matching "~> 3.0"...
  • Installing aztfmod/azurecaf v1.2.26...
  • Installed aztfmod/azurecaf v1.2.26 (self-signed, key ID 3D457F4D69B172D6)
  • Installing hashicorp/azurerm v3.78.0...
  • Installed hashicorp/azurerm v3.78.0 (signed by HashiCorp)

Screenshots
Please find the attached screenshot
Error_1

Desktop (please complete the following information):

  • OS: [e.g. Windows 10]
  • Browser [e.g. chrome]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions