Please note that the Vagrant issue tracker is in priority reserved for bug reports and enhancements. For general usage questions, please use the Vagrant mailing list:
https://groups.google.com/forum/#!forum/vagrant-up. Thank you!
Tip: Before submitting your issue, don't hesitate to remove the above introductory text, possible empty sections (e.g. References), and this tip.
Run vagrant -v to show the version. If you are not running the latest version
of Vagrant, please upgrade before submitting an issue.
Vagrant 2.1.2
This is the operating system that you run locally.
Win 10
This is the operating system you run in the virtual machine.
Ubuntu 16.04
# Copy-paste your Vagrantfile here (but don't include sensitive information such as passwords, authentication tokens, or email addresses)
# setup artifactory authentication
ENV['VAGRANT_SERVER_URL'] = "https://DOMAIN.COM/artifactory/api/vagrant/vagrant-local"
ENV['ATLAS_TOKEN'] = "SOME ACCESS TOKEN"
Vagrant.configure(2) do |config|
config.vm.box = "vagrant-default"
config.vm.box_url = "https://DOMAIN.COM/artifactory/api/vagrant/vagrant-local/vagrant-default"
end
Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.
Provide a link to a GitHub Gist containing the complete debug output:
https://www.vagrantup.com/docs/other/debugging.html. The debug output should
be very long. Do NOT paste the debug output in the issue, just paste the
link to the Gist.
What should have happened?
On the download of the box and maybe the up command there should be a promt that there is another server used. There should not be any wait!
What actually happened?
On every often used command (up, status, reload, provision) there is a warning prompted and a short wait. This is very annoying!
Vagrant has detected a custom Vagrant server in use for downloading
box files. An authentication token is currently set which will be
added to the box request. If the custom Vagrant server should not
be receiving the authentication token, please unset it.
Known Vagrant server: vagrantcloud.com
Custom Vagrant server: artifactory.DOMAIN.COM
1.
2.
3.
Are there any other GitHub issues (open or closed) that should be linked here?
For example:
Hi there,
This is done to prevent accidental leakage of the access token to a different location. We are discussing ways to support non Vagrant Cloud tokens to suppress the warning and delay. To prevent the delay now, you can just provide the token in the URL:
ENV['VAGRANT_SERVER_URL'] = "https://DOMAIN.COM/artifactory/api/vagrant/vagrant-local?access_token=SOME_ACCESS_TOKEN"
Cheers!
@chrisroberts Ah perfect! Thank you for that quickfix.
It would be great to have one of these options:
@chrisroberts - Just wanted to echo the need for this again; It makes sense to have the warning/delay for commands which actually need to reach out to the server (e.g. box update), but for more frequently called local commands like ssh/ssh-config this just painfully slows down a user's CLI workflow as well as in tools like JetBrains which interact with vagrant to run tests.
The suggested query string workaround doesn't work, because the access token isn't automatically added to other URLs vagrant makes requests to (such as metadata fetches during box updates).
The lag time is very unsettling.
I went into /opt/vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/plugins/commands/cloud/auth/middleware/add_authentication.rb
and commented out the sleep around line 58 -
if server_uri.host != TARGET_HOST && !self.class.custom_host_notified?
env[:ui].warn(I18n.t("cloud_command.middleware.authentication.different_target",
custom_host: server_uri.host, known_host: TARGET_HOST) + "\n")
#sleep CUSTOM_HOST_NOTIFY_WAIT
self.class.custom_host_notified!
end
Most helpful comment
@chrisroberts Ah perfect! Thank you for that quickfix.
It would be great to have one of these options: