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

Cannot connect to ipv6 address with explicitly specified port #1049

Open
1 task done
MaxMatti opened this issue Nov 19, 2023 · 2 comments · May be fixed by #1055
Open
1 task done

Cannot connect to ipv6 address with explicitly specified port #1049

MaxMatti opened this issue Nov 19, 2023 · 2 comments · May be fixed by #1055

Comments

@MaxMatti
Copy link

System Information

Linux distribution

NixOS

Terraform version

terraform -v
Terraform v1.6.4-dev
on linux_amd64
+ provider registry.terraform.io/dmacvicar/libvirt v0.7.4

Your version of Terraform is out of date! The latest version
is 1.6.4. You can update by downloading from https://www.terraform.io/downloads.html

Checklist

  • Is it a bug or something that does not work as expected? Please make sure you fill the version information below:

Description of Issue/Question

Setup

terraform {
  required_providers {
    libvirt = {
      source = "dmacvicar/libvirt"
    }
  }
}

provider "libvirt" {
  uri = "qemu+ssh://username@[::1]:22/system?name=qemu%3A%2F%2F%2Fsystem"
}

Steps to Reproduce Issue

$ terraform plan

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: failed to connect: dial tcp: address ::1:22: too many colons in address
│ 
│   with provider["registry.terraform.io/dmacvicar/libvirt"],
│   on host1.tf line 9, in provider "libvirt":
│    9: provider "libvirt" {
│ 
╵

Am I specifying the ip address incorrectly? I also tried without the [] but got the same error message.

@MaxMatti
Copy link
Author

It can be fixed by replacing one function call in line 148 of ssh.go like this:
patch.txt
Unfortunately I have no idea how to create a test for that (finding this bug was my first time reading any go source code), so I don't feel confident to create a pull request.

@MaxMatti MaxMatti linked a pull request Dec 17, 2023 that will close this issue
@scabala
Copy link
Contributor

scabala commented Sep 2, 2024

Somewhat related to #1058 (generic SSH improvements)

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