Closed rocktavious closed 2 weeks ago
The customer downgraded to 1.1.0 and it fixed / worked.
We experienced a similar issue when attempting the jump from 1.1.1 to 1.2.3 for resource opslevel_check_repository_file
Error: Unable to Read Previously Saved State for UpgradeResourceState
with opslevel_check_repository_file.adr-m-0004,
on adr_m_0004.tf line 112, in resource "opslevel_check_repository_file" "adr-m-0004":
112: resource "opslevel_check_repository_file" "adr-m-0004" {
There was an error reading the saved resource state using the prior resource
schema defined for version 0 upgrade.
Please report this to the provider developer:
AttributeName("file_contents_predicate"): invalid JSON, expected "[", got "{"
Here is the snippet
resource "opslevel_check_repository_file" "adr-m-0004" {
name = "ADR-M-0004-has-serverless-or-lambda-file"
enable_on = "2024-08-31T00:00:00.000000Z"
use_absolute_root = false
category = opslevel_rubric_category.repository.id
level = opslevel_rubric_level.gold.id
owner = data.opslevel_team.core_tech_engineering_operations.id
filter = opslevel_filter.adr-m-0004.id
directory_search = false
filepaths = [
"serverless.yaml",
"serverless.yml",
"atlantis/infrastructure/advertstatisticserver-lambda.tf",
"atlantis/infrastructure/loadfromreservoir-lambda.tf",
"terraform/infrastructure/lambda.tf"
]
file_contents_predicate = {
type = "does_not_exist"
}
notes = "See here for more information about the compliance with the ADR: [REDACTED]
lifecycle {
ignore_changes = [
enabled,
enable_on
]
}
}
Using 1.1.1 here is the redacted state for this object.
terragrunt state show opslevel_check_repository_file.adr-m-0004
# opslevel_check_repository_file.adr-m-0004:
resource "opslevel_check_repository_file" "adr-m-0004" {
category = "REDACTED"
description = "None of these repo files 'serverless.yaml', 'serverless.yml', 'atlantis/infrastructure/advertstatisticserver-lambda.tf', 'atlantis/infrastructure/loadfromreservoir-lambda.tf', 'terraform/infrastructure/lambda.tf' exists."
directory_search = false
enable_on = "2024-08-31T00:00:00.000000Z"
enabled = false
file_contents_predicate = {
type = "does_not_exist"
}
filepaths = [
"serverless.yaml",
"serverless.yml",
"atlantis/infrastructure/advertstatisticserver-lambda.tf",
"atlantis/infrastructure/loadfromreservoir-lambda.tf",
"terraform/infrastructure/lambda.tf",
]
filter = "REDACTED"
id = "REDACTED"
level = "REDACTED"
name = "ADR-M-0004-has-serverless-or-lambda-file"
notes = "See here for more information about the compliance with the ADR: REDACTED"
owner = "REDACTED"
use_absolute_root = false
}
Other affected resources in our codebase:
HTH the investigation
Similar issue reported here in customer-support-issues
Released 1.1.4 as a stop gap for jumping to 1.2.5
Add a callout in our migration guide
A customer was trying to use our 1.2.1 release and ran into this error message
The configuration was
Not entirely sure if this is a state upgrader problem or if we didn't handle the schema version correctly.