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

Latest released version 0.11.0 fails to instantiate provider "registry.terraform.io/elastic/ec" to obtain schema: fork/exec on Windows operating system #853

Open
4 tasks done
avwsolutions opened this issue Sep 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@avwsolutions
Copy link

Readiness Checklist

  • I am running the latest version ==> Tried terraform v1.9.5 and older v1.4.7.
  • I checked the documentation and found no answer ==> Followed the correct instruction to upgrade a provider.
  • I checked to make sure that this issue has not already been filed ==> No recent found on this particular issue.
  • I am reporting the issue to the correct repository (for multi-repository projects) ==> It's the one.

Expected Behavior

terraform plan should generate a plan file that contains the EC(E) platform infrastructure deployment based on the tf defined resources and current state. This fails.

Current Behavior

terraform init --upgrade runs smoothly and downloads the artifact to the directory structure. So the artifact is available to be executed. Also the file permissions are set the same as the older downloaded versions, so this isn't conflicted.

terraform plan generates an Error: Failed to load plugin schemas on WIndows 11, which relates to loading the actual schema of the provider. This fails with a fork/exec to instantiate the provider. See full message below.

│ registry.terraform.io/elastic/ec: failed to instantiate provider "registry.terraform.io/elastic/ec" to obtain schema: fork/exec

│ .terraform/providers/registry.terraform.io/elastic/ec/0.11.0/windows_amd64/terraform-provider-ec_v0.11.0.exe: Access is denied... 

Downgrading to an older version like 0.10.0 solves the issue.

## Terraform definition

Steps to Reproduce

  1. Bump the terraform provider (ec) version = "0.11.0" .
  2. terraform init -upgrade.
  3. terraform plan
  4. Failure happens.

Context

We cannot upgrade to the latest released version and benefit the new features and fixes.

Possible Solution

Seems like a Build issue.

Your Environment

  • Version used: 3.6.2
  • Running against Elastic Cloud Enterprise
  • Environment name and version (e.g. Go 1.9): Git Bash using VS Code.
  • Server type and version: Windows 11 for the Terraform CLI v1.9.5
  • Operating System and version: Affected is Windows 11

Logs

$ terraform init --upgrade

Initializing the backend...

Upgrading modules...

- elastic-environments in ..\..\..\modules\elastic-environments 

Initializing provider plugins...

- Finding elastic/ec versions matching "0.11.0"...
- Installing elastic/ec v0.11.0...
- Installed elastic/ec v0.11.0 (signed by a HashiCorp partner, key ID 7FE579EDEC6DAA7B) 

Partner and community providers are signed by their developers.

If you'd like to know more about provider signing, you can read about it here:

https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has made some changes to the provider dependency selections recorded

in the .terraform.lock.hcl file. Review those changes and commit them to your

version control system if they represent changes you intended to make.

Terraform has been successfully initialized!
 
You may now begin working with Terraform. Try running "terraform plan" to see

any changes that are required for your infrastructure. All Terraform commands

should now work.

If you ever set or change modules or backend configuration for Terraform,

rerun this command to reinitialize your working directory. If you forget, other

commands will detect it and remind you to do so if necessary.


$ terraform plan

╷

│ Error: Failed to load plugin schemas

│

│ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider

│ registry.terraform.io/elastic/ec: failed to instantiate provider "registry.terraform.io/elastic/ec" to obtain schema: fork/exec

│ .terraform/providers/registry.terraform.io/elastic/ec/0.11.0/windows_amd64/terraform-provider-ec_v0.11.0.exe: Access is denied... 
@avwsolutions avwsolutions added the bug Something isn't working label Sep 4, 2024
@gigerdo
Copy link
Member

gigerdo commented Sep 9, 2024

I tried the same on windows with the amd64 provider and couldn't reproduce it: The provider could be executed.

It sounds like the locally installed provider exe maybe has the wrong access permissions (So terraform can't read it).

One thing to try would be to delete the provider and re-download them:

  • Delete .terraform/providers/registry.terraform.io/elastic
  • Run terraform init again so it re-downloads the provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants