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

failed to connect: dial unix /var/run/libvirt/libvirt-sock: connect: no such file or directory #163

Closed
ahuston-0 opened this issue Oct 18, 2023 · 2 comments · Fixed by #164

Comments

@ahuston-0
Copy link
Contributor

ahuston-0 commented Oct 18, 2023

I'm getting the below error while running kubitect apply, it looks like its related to this issue in terraform-provider-libvirt that started after the 0.7.4 release.

│ Error: failed to connect: dial unix /var/run/libvirt/libvirt-sock: connect: no such file or directory
│
│   with provider["registry.terraform.io/dmacvicar/libvirt"].devops-host,
│   on main.tf line 25, in provider "libvirt":
│   25: provider "libvirt" {
│
╵
┌
│ Error: terraform plan failed: exit status 1

Here are the masked connection details I'm using in my kubitect.yml file

 connection:
      type: remote
      user: devops
      ip: 192.168.xxx.xxx
      ssh:
        port: xxx
        keyfile: "/home/devops/.ssh/id_ed25519"

In the meantime, if anyone else is experiencing this, I was able to fix the issue by making the below change in kubitect 3.2.2 and then building the repo. I know that may not be a long term solution, but I'm doing a lot of creating and destroying of my cluster while prototyping the final design and this was blocking that.

diff --git a/embed/terraform/versions.tf b/embed/terraform/versions.tf
index 6ee579c..7d2a1bd 100644
--- a/embed/terraform/versions.tf
+++ b/embed/terraform/versions.tf
@@ -8,7 +8,7 @@ terraform {
   required_providers {
     libvirt = {
       source  = "dmacvicar/libvirt"
-      version = "~> 0.7.1"
+      version = "0.7.1"
     }
   }
 }
(END)
@MusicDin
Copy link
Owner

Hi @ahuston-0,

Thanks for pointing out the issue. Kubitect should use a specific version of libvirt terraform provider (as it is using a specific version of Terraform) to avoid such issues.

Could you open a PR with this change? I will make sure to include it in 3.2.3 and 3.3.0.

@ahuston-0
Copy link
Contributor Author

Sure! will need a few hours but I can put something together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants