Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

providercache: Improve installation error message #31898

Merged
merged 1 commit into from Sep 29, 2022

Conversation

radeksimko
Copy link
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
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

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

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.

None yet

2 participants