-
Notifications
You must be signed in to change notification settings - Fork 458
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
uri parameter in the provider block is broken/being ignored #1036
Comments
I think i know what's the problem. #1030 makes the username a required parameter. If not set then the ssh connection is ignored. |
Please include the URI you're using |
I am facing this same problem with latest Terraform and 0.7.4. All the virtual machines are created to local machine instead of remote machine. The uri I am using is in format uri = "qemu+ssh://virtuser@10.0.0.10/system" Managed to continue with: |
@nohoster what do you mean #1030 makes the username required? What makes you think it's that PR? There have been a number of larger changes since the last release |
All versions 0.7.* ignore uri and work only local. 0.6.14 work good. provider "libvirt" { |
Hi, my uri is "qemu+ssh://192.168.1.100:2221/system?known_hosts_verify=ignore". │ Error: failed to connect: dial unix /var/run/libvirt/libvirt-sock: connect: no such file or directory That's because it's trying to use a local connection I did a test just know with just some bare code: terraform { and it gave me the same error, so the user in the uri is not the problem. So that PR is not the problem. To add more info, after I downgraded to 0.7.1 and made a successful connection, I was able to update to 0.7.4 and it's working again. |
Can it be related to this PR which was merged recently? |
I'm on terraform 1.6.1 and I can't get 0.7.* to work. 0.6.14 seems to. I've not tried anything older. My uri is qemu+ssh://username@hostname/system. |
Same here. Are there any plans to fix this? |
I was checking this, I removed the changes done in #1030 and tried a rebuild to verify if this was the change that broke anything. It will still try to connect to a local libvirt socket. My guess would be that the following commit introduced this: 6a406f7 but I might be wrong. I think those changes might have been done due to updating the required go-libvirt package if i do a diff between 0.7.1 and 0.7.4. Here the 'New' function has been deprecated and replaced with NewWithDialer, the change in the commit reflects this. I have very limited Go knowledge myself but looking at the code maybe it is defaulting to unix in the code below for some reason e.g. the URI is not parsed properly or missing something: func (u *ConnectionURI) transport() string {
parts := strings.Split(u.Scheme, "+")
if len(parts) > 1 {
return parts[1]
}
if u.Host != "" {
return "tls"
}
return "unix"
} Or the dialers are not picked up properly. At this point, I have no idea how to debug this. You can also find a discussion about dialers below: |
I believe this issue has the same root cause that the issue that I helped identify in #1040 . Can you retry with the fix that was merged earlier today? |
With version 0.7.4 (latest as of this moment) I still see this issue. |
Yes, that's the release the issue was initially made for. There has been the above mentioned fix merged to master since then. |
How can I test it w/o compiling it manually? |
You will need to compile it manually and configure terraform to look for the compiled provider |
Any reason why there hasn't been a new release? |
When will there be a release with this fix? |
Exactly. I don't know why the issue is clused when there is no new release yet. |
Until there is a new release with the fix, people needing an urgent workaround can add the "name" parameter, which makes the bugged function return before the bug manifests. For instance, if the URI is In this example, the name parameter is set to Please remember to remove the workaround when the new version is released, as this is a bit dirty ^^ |
Thank you, this workaround seems to work. |
0.7.6 works with the standard uri syntax. |
System Information
Linux distribution
Ubuntu..
Terraform version
1.6.0
Provider and libvirt versions
v0.7.4
It seems the uri is being ignored on the most recent version. It just tries to use a local libvirt sock instead of making the ssh connection. Luckily I still had the 0.7.1 version in disk so I changed it and it's working again. The problem is I can't download that version due to the key signing issue.
The text was updated successfully, but these errors were encountered: