Hello everyone,
I used to have a simple shell.nix
on a project that I only occasionally play with. I have done updates to this project using terraform from my nixos before ( last occurence 0ct 27 this year )
with import <nixpkgs> {config.allowUnfree=true;};
mkShell {
name = "nix dev env";
packages = [
terraform
kubernetes-helm
msmtp
bind.dnsutils
k9s
];
}
So a vanilla terraform really. yestrday I wanted to push a small fix and I got
│ - Failed to obtain provider schema: Could not load the schema for provider registry.terraform.io/hashicorp/null: failed to instantiate provider "registry.terraform.io/hashicorp/null" to obtain schema:
│ Unrecognized remote plugin message:
│ Failed to read any lines from plugin's stdout
│ This usually means
│ the plugin was not compiled for this architecture,
│ the plugin is missing dynamic-link libraries necessary to run,
│ the plugin is not executable by this process due to file permissions, or
│ the plugin failed to negotiate the initial go-plugin protocol handshake
│
│ Additional notes about plugin:
│ Path: .terraform/providers/registry.terraform.io/hashicorp/null/3.2.2/linux_amd
64/terraform-provider-null_v3.2.2_x5
│ Mode: -rwxr-xr-x
│ Owner: 1000 [jean] (current: 1000 [jean])
│ Group: 100 [users] (current: 100 [users])
│ ELF architecture: EM_X86_64 (current architecture: amd64)
I tried removing the .terraform
directory and running init
again but got another error this time :
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/null v3.2.2: failed to open temporary file to download from https://releases.hashicorp.com/terraform-provider-null/3.2.2/terraform-provider-null_3.2.2_linux_amd64.zip: open
│ /tmp/nix-shell-123481-0/terraform-provider3862495864: no such file or directory
looking around, I notice that there are terraform-providers for all the plugins I use. I try to replace my naive terraform import and use terraform.withPlugins instead
with import <nixpkgs> {config.allowUnfree=true;};
mkShell {
name = "nix dev env";
packages = [
(
terraform.withPlugins(p:[
p.null
])
)
kubernetes-helm
msmtp
bind.dnsutils
k9s
];
}
I drop both .terraform
and the .terraform.lock.hcl
then run init
again.
To no avail but with a different error this time.
│ - Failed to obtain provider schema: Could not load the schema for provider registry.terraform.io/hashicorp/null: failed to instantiate provider "registry.terraform.io/hashicorp/null" to obtain schema:
│ Unrecognized remote plugin message:
│ Failed to read any lines from plugin's stdout
│ This usually means
│ the plugin was not compiled for this architecture,
│ the plugin is missing dynamic-link libraries necessary to run,
│ the plugin is not executable by this process due to file permissions, or
│ the plugin failed to negotiate the initial go-plugin protocol handshake
│
│ Additional notes about plugin:
│ Path: .terraform/providers/registry.terraform.io/hashicorp/null/3.2.3/linux_amd64/terraform-provider-null_3.2.3
│ Mode: -r-xr-xr-x
│ Owner: 0 [root] (current: 1000 [jean])
│ Group: 0 [root] (current: 100 [users])
running .terraform/providers/registry.terraform.io/hashicorp/null/3.2.3/linux_amd64/terraform-provider-null_3.2.3
directly yields
This binary is a plugin. These are not meant to be executed directly.
Please execute the program that consumes these plugins, which will
load any plugins automatically
which seems to point that it does and can run
I’m a bit at a loss as to how I can fix my install at this point. I don’t really care if the plugins versions have changed and introduced incompatibilities with my tf files. They are small and I don’t use fancy plugins so fixing the issues shouldn’t be a problem, but I can’t run anything for now
the only “major” change I did recently is upgrading to 24.11
I further tried to use the terraform package from unstable but it fared no better.
What am I doing wrong ?