Skip to content

providercache: Improve installation error message#31898

Merged
kmoe merged 1 commit intomainfrom
f-providercache-improve-err-msg
Sep 29, 2022
Merged

providercache: Improve installation error message#31898
kmoe merged 1 commit intomainfrom
f-providercache-improve-err-msg

Conversation

@radeksimko
Copy link
Copy Markdown
Member

Target Release

1.4.x

Draft CHANGELOG entry

ENHANCEMENTS

  • providercache: show why a provider couldn't be installed (e.g. lack of permissions)

Context

On Windows, when Terraform doesn't have TMP or other environment variable which would hint where to create temporary files, the stdlib ioutil.TempDir() chooses C:\Windows. This directory in turn typically requires elevated privileges for writing which common user does not have.

See also hashicorp/terraform-exec#337

Before

Error: Failed to install provider

Error while installing hashicorp/local v2.2.3: failed to open temporary file
to download from
https://releases.hashicorp.com/terraform-provider-local/2.2.3/terraform-provider-local_2.2.3_windows_amd64.zip

After

Error: Failed to install provider

Error while installing hashicorp/local v2.2.3: failed to open temporary file
to download from
https://releases.hashicorp.com/terraform-provider-local/2.2.3/terraform-provider-local_2.2.3_windows_amd64.zip:
open C:\Windows\terraform-provider1818936128: Access is denied.

Copy link
Copy Markdown
Member

@kmoe kmoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@kmoe kmoe merged commit 196ff4c into main Sep 29, 2022
@radeksimko radeksimko deleted the f-providercache-improve-err-msg branch September 29, 2022 12:37
@github-actions
Copy link
Copy Markdown
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

@github-actions
Copy link
Copy Markdown
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, 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 Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants