opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
74 stars 58 forks source link

[BUG] Opensearch provider PGP key may be expired #163

Closed snarfmonkey closed 7 months ago

snarfmonkey commented 7 months ago

What is the bug?

When initializing a Terraform repository using the opensearch provider, I get the following error:

│ Error: Failed to install provider
│
│ Error while installing opensearch-project/opensearch v2.0.0-beta.1: error checking signature: openpgp: key expired

How can one reproduce the bug?

Add the opensearch provider and attempt to initialize the terraform repo:

providers.tf:

provider "opensearch" {
  url = "https://some-opensearch-url.us-east-1.es.amazonaws.com"
}

versions.tf:

terraform {
  required_version = ">= 1.6.0"

  required_providers {
    opensearch = {
      source  = "opensearch-project/opensearch"
      version = "2.2.0"
    }
  }
}

❯ terraform init

Initializing the backend...

Initializing provider plugins...
- Finding opensearch-project/opensearch versions matching "2.2.0"...
- Installing opensearch-project/opensearch v2.2.0...
╷
│ Error: Failed to install provider
│
│ Error while installing opensearch-project/opensearch v2.2.0: error checking signature: openpgp: key expired

What is the expected behavior?

Terraform initializes and uses the opensearch provider with a valid PGP key.

What is your host/environment?

Mac OS arm64, though it seems to be the case for amd64 as well.

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

I did a quick check on the releases and the key does appear to be expired:

❯ curl https://registry.terraform.io/v1/providers/opensearch-project/opensearch/2.2.0/download/linux/amd64 | jq -r '.signing_keys.gpg_public_keys[0].ascii_armor' | gpg --show-keys -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4143    0  4143    0     0  25614      0 --:--:-- --:--:-- --:--:-- 25732
pub   rsa4096 2023-02-28 [SC] [expired: 2024-02-28]
      A0C16CA6CFA8ABF4DB5338E1C9D54034F594D145
uid                      OpenSearch Terraform Provider (OpenSearch terraform provider official signing key) <opensearch@amazon.com>
sub   rsa4096 2023-02-28 [E] [expired: 2024-02-28]

gpg: WARNING: No valid encryption subkey left over.

❯ curl https://registry.terraform.io/v1/providers/opensearch-project/opensearch/2.2.0/download/linux/arm64 | jq -r '.signing_keys.gpg_public_keys[0].ascii_armor' | gpg --show-keys -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4143    0  4143    0     0  14415      0 --:--:-- --:--:-- --:--:-- 14435
pub   rsa4096 2023-02-28 [SC] [expired: 2024-02-28]
      A0C16CA6CFA8ABF4DB5338E1C9D54034F594D145
uid                      OpenSearch Terraform Provider (OpenSearch terraform provider official signing key) <opensearch@amazon.com>
sub   rsa4096 2023-02-28 [E] [expired: 2024-02-28]

gpg: WARNING: No valid encryption subkey left over.
418error commented 7 months ago

This appears to be a bug with the version of terraform you're using 1.6.0 https://github.com/hashicorp/terraform/issues/33984 Try downgrading or upgrading to resolve 👍

snarfmonkey commented 7 months ago

You are correct, thanks for the heads up! It's initializing now.