-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Packer 1.5.6+ does not use macOS system DNS resolver and cannot connect to host #9710
Comments
Hi thanks for reaching out. Based on timing and on those debug lines from the net library, I'm going to guess this was caused by f12269f We disabled cgo compilation because it started messing up static linking once we started building our release builds on linux; we didn't realize it was going to break this but it sounds like the golang net library isn't quite up to par with how cgo was for darwin. For now, the workaround is to rebuild packer yourself without the cgo disabling. You can do this by cloning the repo, making sure Line 17 in de5c587
make dev from Packer's root directory. This will add a new packer binary to bin/packer inside your packer root.
I'll try to figure out how to change this for future releases. |
@VladRassokhin I can confirm that building packer (latest (1.6.2)) from the repo fixes this as I attempted it last night. Incidentally, the 1.6.2 build seems to have also fixed a like hanging Ubuntu install issue I was having in my Windows lab |
Personally I'm happy with 1.5.5 for now, though I'd like to see that somehow fixed in newest official releases. I do understand that test for such case is quite complicated. |
@TheRedBull for my understanding, when you say:
are you building from macOS ? If yes, with what command-line? For me, macOS build, at least using |
@marco-m, you can try with the Nightly build: https://github.com/hashicorp/packer/releases/tag/nightly |
@marco-m the default make target is setup to use the Packer build script which is meant for releasing. I'll see about changing that for the future. In the meantime, the correct command to run is @azr I think the latest nightly releases are also using Linux with CGO disabled so DNS may still be an issue. But @marco-m you can give it a try. Otherwise the path forward, for now, is to build locally on your Mac using |
@marco-m no need for another issue. I'll make a Pr to change the default make target to not require that script; we don't release using that command anyway. |
So, any updates over 1.5 years? |
We are working on updating our release processes, which will help in addressing this issue. |
Overview of the Issue
Got "Timeout waiting for SSH" due to Packer's inability to correctly resolve host name, details and logs below.
Had to rollback to 1.5.5.
ping -c1 ssh_host
correctly resolves DNS and works.Reproduction Steps
packer-1.5.6 build -var ssh_host=HOST.DOMAIN config.json
Packer version
Packer v1.5.6
Packer v1.6.1
Simplified Packer Buildfile
Operating system and Environment details
Mac OS X 10.14.6 18G6020
Env:
Computer is connected to corporate network using VPN.
192.168.0.1 is IP address of WiFi router.
`/etc/resolv.conf` content
`scutil --dns`
Log Fragments and crash.log files
Packer 1.5.5 log
Packer 1.5.6 log
The text was updated successfully, but these errors were encountered: