Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Level2 - Error Loading State #92

Open
kgibson-insight opened this issue Aug 2, 2021 · 1 comment
Open

Level2 - Error Loading State #92

kgibson-insight opened this issue Aug 2, 2021 · 1 comment

Comments

@kgibson-insight
Copy link

Describe the bug

│ Error: Error loading state error
│ 
│   with data.terraform_remote_state.remote["foundations"],
│   on locals.remote_tfstates.tf line 19, in data "terraform_remote_state" "remote":
│   19:   backend = var.landingzone.backend_type
│ 
│ error loading the remote state: failed to lock azure state: 2 errors
│ occurred:
│       * blobs.Client#AcquireLease: Failure sending request: StatusCode=409 --
│ Original Error: Error occurred unmarshalling JSON - Error = 'invalid
│ character '<' looking for beginning of value' JSON = '<?xml version="1.0"
│ encoding="utf-8"?><Error><Code>LeaseAlreadyPresent</Code><Message>There is
│ already a lease present.
│ RequestId:37995ab0-501e-00e9-4eeb-87af64000000
│ Time:2021-08-02T22:10:36.1165552Z</Message></Error>'
│       * blob metadata "terraformlockid" was empty

To Reproduce
Sync repo and deploy level2 as instructed with rover:

rover -lz /tf/caf/walkthrough/landingzones/caf_solution \
-var-folder /tf/caf/walkthrough/configuration/sandpit/level2/networking/hub \
-tfstate hub.tfstate \
-level level2 \
-env sandpit \
-a apply
@shuft
Copy link
Contributor

shuft commented Oct 28, 2021

A bit late now to suggest this perhaps, but the error code LeaseAlreadyPresent suggests that a previous rover run has crashed and left the storage blob locked. You can manually break the lease in the Azure Portal, and try again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants