Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Panic when invalid key provided to data tls_public_key #39

Closed
harryrose opened this issue Jan 14, 2019 · 2 comments
Closed

Panic when invalid key provided to data tls_public_key #39

harryrose opened this issue Jan 14, 2019 · 2 comments

Comments

@harryrose
Copy link
Contributor

Terraform Version

Terraform v0.11.10

Affected Resource(s)

  • data tls_public_key

Terraform Configuration Files

data "tls_public_key" "example" {
  private_key_pem = "corrupt"
}

Panic Output

https://gist.github.com/harryrose/7332ec751d8a63281095a5f24fd3c54b

Expected Behavior

What should have happened?
Graceful error message

Actual Behavior

What actually happened?
Panic

Steps to Reproduce

  1. terraform apply

Important Factoids

Fixed locally, raising this bug to give something to anchor it to. Will raise a PR.

harryrose added a commit to harryrose/terraform-provider-tls that referenced this issue Jan 14, 2019
harryrose added a commit to harryrose/terraform-provider-tls that referenced this issue Jan 14, 2019
@kmoe
Copy link
Member

kmoe commented Jun 26, 2020

Retested with Terraform v0.12.26, provider.tls v2.1.1, did not reproduce bug. Error message is sufficiently graceful:

❤ @up ➜  tls  terraform apply
data.tls_public_key.example: Refreshing state...
tls_private_key.k8s_etcd_ca: Refreshing state... [id=979106205151042a51849aff04584c73c824a0fa]
tls_self_signed_cert.k8s_etcd_ca: Refreshing state... [id=100567033980718210270153786675855296964]

Error: failed to decode PEM block containing private key of type "unknown"

  on main.tf line 1, in data "tls_public_key" "example":
   1: data "tls_public_key" "example" {

Please reopen if you're still experiencing this issue.

@kmoe kmoe closed this as completed Jun 26, 2020
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants