Skip to content

Error: Error updating initial version. SecretEmbedded.hash is required but was null #133

@JohannesRudolph

Description

@JohannesRudolph

❯ tofu apply

OpenTofu used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

OpenTofu will perform the following actions:

  # module.noop.meshstack_building_block_definition.this will be created
  + resource "meshstack_building_block_definition" "this" {
      + metadata               = {
          + owned_by_workspace = "playground-jrudo"
          + tags               = {
              + "BBEnvironment" = [
                  + "dev",
                ]
            }
          + uuid               = (known after apply)
        }
      + ref                    = (known after apply)
      + spec                   = {
          + description               = "Reference building block demonstrating meshStack's complete Terraform interface: all input types, file inputs, user permissions injection, and pre-run scripts."
          + display_name              = "meshStack NoOp Building Block"
          + notification_subscribers  = []
          + run_transparency          = false
          + symbol                    = (known after apply)
          + target_type               = "WORKSPACE_LEVEL"
          + use_in_landing_zones_only = false
        }
      + version_latest         = (known after apply)
      + version_latest_release = (known after apply)
      + version_spec           = {
          + deletion_mode              = "PURGE"
          + dependency_refs            = []
          + draft                      = true
          + implementation             = {
              + terraform = {
                  + async                          = false
                  + ref_name                       = "feature/noop-building-block-prerun"
                  + repository_path                = "modules/meshstack/noop/buildingblock"
                  + repository_url                 = "https://github.com/meshcloud/meshstack-hub.git"
                  + terraform_version              = "1.9.0"
                  + use_mesh_http_backend_fallback = true
                }
            }
          + inputs                     = {
              + "flag" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "Boolean flag chosen by the user"
                  + display_name           = "Flag"
                  + is_environment         = false
                  + type                   = "BOOLEAN"
                  + updateable_by_consumer = false
                },
              + "multi_select" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "One or more values from a predefined list"
                  + display_name           = "Multi Select"
                  + is_environment         = false
                  + selectable_values      = [
                      + "option-x",
                      + "option-y",
                      + "option-z",
                    ]
                  + type                   = "MULTI_SELECT"
                  + updateable_by_consumer = false
                },
              + "multi_select_json" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "One or more values from a predefined list, as a raw JSON string"
                  + display_name           = "Multi Select (JSON)"
                  + is_environment         = false
                  + selectable_values      = [
                      + "option-x",
                      + "option-y",
                      + "option-z",
                    ]
                  + type                   = "MULTI_SELECT"
                  + updateable_by_consumer = false
                },
              + "num" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "Integer chosen by the user"
                  + display_name           = "Number"
                  + is_environment         = false
                  + type                   = "INTEGER"
                  + updateable_by_consumer = false
                },
              + "sensitive-file.yaml" = {
                  + argument               = "\"\\\"secret\\\": \\\"s3cret\\\"\\n\""
                  + assignment_type        = "STATIC"
                  + description            = "An encrypted YAML file written to the working directory"
                  + display_name           = "Sensitive File (YAML)"
                  + is_environment         = false
                  + sensitive              = {}
                  + type                   = "FILE"
                  + updateable_by_consumer = false
                },
              + "sensitive_text" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "Sensitive string, masked in UI and logs"
                  + display_name           = "Sensitive Text"
                  + is_environment         = false
                  + sensitive              = {}
                  + type                   = "STRING"
                  + updateable_by_consumer = false
                },
              + "sensitive_yaml" = {
                  + argument               = jsonencode(
                        {
                          + example_key = "example_value"
                        }
                    )
                  + assignment_type        = "STATIC"
                  + description            = "Encrypted YAML/JSON value, decrypted at runtime"
                  + display_name           = "Sensitive YAML"
                  + is_environment         = false
                  + sensitive              = {}
                  + type                   = "CODE"
                  + updateable_by_consumer = false
                },
              + "single_select" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "One value from a predefined list"
                  + display_name           = "Single Select"
                  + is_environment         = false
                  + selectable_values      = [
                      + "option-a",
                      + "option-b",
                      + "option-c",
                    ]
                  + type                   = "SINGLE_SELECT"
                  + updateable_by_consumer = false
                },
              + "some-file.yaml" = {
                  + argument               = "\"\\\"greeting\\\": \\\"hello\\\"\\n\\\"items\\\":\\n- \\\"a\\\"\\n- \\\"b\\\"\\n- \\\"c\\\"\\n\""
                  + assignment_type        = "STATIC"
                  + description            = "A YAML file written to the working directory"
                  + display_name           = "Some File (YAML)"
                  + is_environment         = false
                  + type                   = "FILE"
                  + updateable_by_consumer = false
                },
              + "static" = {
                  + argument               = "\"hello from meshStack\""
                  + assignment_type        = "STATIC"
                  + description            = "A platform-engineer-defined string constant"
                  + display_name           = "Static String"
                  + is_environment         = false
                  + type                   = "STRING"
                  + updateable_by_consumer = false
                },
              + "static_code" = {
                  + argument               = jsonencode(
                        {
                          + key1 = "value1"
                          + key2 = "value2"
                        }
                    )
                  + assignment_type        = "STATIC"
                  + description            = "A platform-engineer-defined map"
                  + display_name           = "Static Code"
                  + is_environment         = false
                  + type                   = "CODE"
                  + updateable_by_consumer = false
                },
              + "text" = {
                  + assignment_type        = "USER_INPUT"
                  + description            = "Free-text string from the user"
                  + display_name           = "Text"
                  + is_environment         = false
                  + type                   = "STRING"
                  + updateable_by_consumer = false
                },
              + "user_permissions" = {
                  + assignment_type        = "USER_PERMISSIONS"
                  + description            = "Project team members and their roles as a structured list"
                  + display_name           = "User Permissions"
                  + is_environment         = false
                  + type                   = "CODE"
                  + updateable_by_consumer = false
                },
              + "user_permissions_json" = {
                  + assignment_type        = "USER_PERMISSIONS"
                  + description            = "Project team members and their roles as a raw JSON string"
                  + display_name           = "User Permissions (JSON)"
                  + is_environment         = false
                  + type                   = "CODE"
                  + updateable_by_consumer = false
                },
            }
          + only_apply_once_per_tenant = false
          + outputs                    = {
              + "flag" = {
                  + assignment_type = "NONE"
                  + display_name    = "Flag"
                  + type            = "STRING"
                },
              + "multi_select" = {
                  + assignment_type = "NONE"
                  + display_name    = "Multi Select"
                  + type            = "STRING"
                },
              + "multi_select_json" = {
                  + assignment_type = "NONE"
                  + display_name    = "Multi Select (JSON)"
                  + type            = "STRING"
                },
              + "num" = {
                  + assignment_type = "NONE"
                  + display_name    = "Number"
                  + type            = "STRING"
                },
              + "sensitive_file_yaml" = {
                  + assignment_type = "NONE"
                  + display_name    = "Sensitive File (YAML)"
                  + type            = "STRING"
                },
              + "sensitive_text" = {
                  + assignment_type = "NONE"
                  + display_name    = "Sensitive Text"
                  + type            = "STRING"
                },
              + "sensitive_yaml" = {
                  + assignment_type = "NONE"
                  + display_name    = "Sensitive YAML"
                  + type            = "STRING"
                },
              + "single_select" = {
                  + assignment_type = "NONE"
                  + display_name    = "Single Select"
                  + type            = "STRING"
                },
              + "some_file_yaml" = {
                  + assignment_type = "NONE"
                  + display_name    = "Some File (YAML)"
                  + type            = "STRING"
                },
              + "static" = {
                  + assignment_type = "NONE"
                  + display_name    = "Static"
                  + type            = "STRING"
                },
              + "static_code" = {
                  + assignment_type = "NONE"
                  + display_name    = "Static Code"
                  + type            = "STRING"
                },
              + "text" = {
                  + assignment_type = "NONE"
                  + display_name    = "Text"
                  + type            = "STRING"
                },
              + "user_permissions" = {
                  + assignment_type = "NONE"
                  + display_name    = "User Permissions"
                  + type            = "STRING"
                },
              + "user_permissions_json" = {
                  + assignment_type = "NONE"
                  + display_name    = "User Permissions (JSON)"
                  + type            = "STRING"
                },
            }
          + permissions                = []
          + runner_ref                 = (known after apply)
          + state                      = (known after apply)
          + version_number             = (known after apply)
        }
      + versions               = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  OpenTofu will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.noop.meshstack_building_block_definition.this: Creating...
╷
│ Error: Error updating initial version
│ 
│   with module.noop.meshstack_building_block_definition.this,
│   on .terraform/modules/noop/modules/meshstack/noop/meshstack_integration.tf line 28, in resource "meshstack_building_block_definition" "this":
│   28: resource "meshstack_building_block_definition" "this" {
│ 
│ Building block 'meshStack NoOp Building Block', uuid=4d64cd60-1b7f-42f1-9185-b095f94f93ab was just created, and the initial version '7b287b1f-79ca-4e57-87e8-07a167094ffd'
│ failed to update with given version_spec configuration. Most likely schema validation is insufficient and the API received an invalid or incomplete JSON payload.
│ Error: request failed with status 400 (not 2XX successful)
│ error response: {"message":"SecretEmbedded.hash is required but was null.","errorCode":"BadRequest","errorId":"4NHpHBeKkd"}
╵

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions