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

Downloading from tftp:// uses HEAD query #5477

Closed
borgand opened this issue Mar 13, 2015 · 3 comments · Fixed by #6540
Closed

Downloading from tftp:// uses HEAD query #5477

borgand opened this issue Mar 13, 2015 · 3 comments · Fixed by #6540
Assignees
Milestone

Comments

@borgand
Copy link

borgand commented Mar 13, 2015

I'm trying to get Vagrant to automatically fetch my boxfile from build server using TFTP protocol.

  config.vm.box_url = "tftp://tftp.host:/devbox.box"

This results in Vagrant using HEAD query at first which downloads the entire boxfile to STDOUT, before starting actual download.

Trying it directly with embedded curl works as expected:

/opt/vagrant/embedded/bin/curl --output /tmp/box tftp://tftp.host/devbox.box

But when using the same URL in Vagrantfile, it does not. DEBUG output shows this:

INFO box_add: Downloading box: tftp://tftp.host/devbox.box => /home/laas/.vagrant.d/tmp/box2f41853e07736bc3f7ba8f307ab44f0f11e9ae47
INFO downloader: HEAD: tftp://tftp.host/devbox.box
INFO subprocess: Starting process: ["/opt/vagrant/bin/../embedded/bin/curl", "-I", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.7.2", "--continue-at", "-", "-H", "Accept: application/json", "tftp://tftp.host/devbox.box"]

And after that curl starts to output binary data.

When not in DEBUG-mode, I can Ctrl-C while it's waiting for the HEAD to complete and then a regular download continues and successfully adds box (then exits due to interrupt). A next vagrant up will then successfully create a VM.

Other than the HEAD query, tftp:// protocol seems to work just fine, so could you please see why it issues this HEAD query.

@sethvargo
Copy link
Contributor

Hi @borgand

Vagrant needs to uses a HEAD request to check for the existence of a box before attempting to download.

@borgand
Copy link
Author

borgand commented Mar 17, 2015

Could you just skip HEAD in case of tftp:// protocol as TFTP can only read and write files and nothing more. If file does not exist, curl would error out as it would if the transfer got interrupted.

@borgand
Copy link
Author

borgand commented Mar 17, 2015

Off topic, but I wouldn't look at TFTP, if I could get scp:// URL working, but for some reason the embedded curl refuses to read host keys from ~/.ssh/known_hosts (both under Arch Linux and a different Ubuntu host). Should this be working?

@mitchellh mitchellh added bug and removed enhancement labels Jul 7, 2015
@sethvargo sethvargo added this to the 1.8 milestone Jul 10, 2015
@mitchellh mitchellh self-assigned this Nov 19, 2015
mitchellh added a commit that referenced this issue Nov 19, 2015
core: don't do HEAD request for box on non-HTTP [GH-5477]
@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants