2.2.6
Arch linux
CentOS 7
# -*- mode: ruby -*-
# vi: set ft=ruby :
require_relative '../config'
require_relative './scripts/load_deploy'
check_config
# Load sensitive AWS credentials from external file & validate configuration
aws_env = load_aws_env "../aws.yaml"
aws_env["PUPPET_ENV"] = "test"
aws_env["PUPPET_ROLE"] = "testserver"
Vagrant.configure("2") do |config|
config.vm.box = "database.box"
config.vm.box_url = "s3://database.box"
config.vm.network "forwarded_port", guest: 80, host: 8092
config.vm.network "forwarded_port", guest: 3306, host: 3306
config.vm.network "forwarded_port", guest: 5432, host: 5432
config.vm.network "forwarded_port", guest: 6379, host: 6379
config.vm.network "forwarded_port", guest: 9200, host: 9200
load_deployment_port_forwardings config
config.vm.synced_folder "~/.aws", "/root/.aws"
config.vm.synced_folder "~/.aws", "/home/tomcat/.aws"
config.vm.synced_folder "../..", "/root/bar"
config.vm.synced_folder "../../../frontend", "/var/www/static"
config.vm.synced_folder "../../../frontend/static", "/var/www/themes"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ['modifyvm', :id, "--memory", "4096"]
end
config.vm.provision "General setup", type: "shell" do |s|
s.path = "../scripts/setup.sh"
s.env = aws_env
end
config.vm.provision "Run puppet", type: "shell" do |s|
s.inline = "/root/bar/puppet/run.sh"
s.env = aws_env.merge(load_deployment_env)
end
config.vm.provision "Adjust URLs in database", type: "shell" do |s|
s.inline = "/root/adjust_database_urls.sh $1"
s.args = [aws_env["PUPPET_STACK"]]
end
end
In most cases the error I'm getting is:
An error occurred in the underlying SSH library that Vagrant uses.
The error message is shown below. In many cases, errors from this
library are caused by ssh-agent issues. Try disabling your SSH
agent or removing some keys and try again.
If the problem persists, please report a bug to the net-ssh project.
timeout waiting for next packet
rarely it is:
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.
Provisioning or starting the box to work consistently. Same Vagrant configuration is working fine on osx.
After a couple of tries, usually 4-8, provisioning the box will succeed. The config is very similar to the docs: https://www.vagrantup.com/docs/synced-folders/basic_usage.html
There are similar issues here and there.
Have tried most workarounds: Destroying the machine. Halting it first. Deleting the vagrant.d folder etc. but nothing seems to help
Hello @kongeor! Thanks for opening an issue. When opening a new issue on the Vagrant project, we ask that everyone provide a gist containing the behavior you're seeing with the --debug flag included. This helps us figure out what's actually going on. Thanks!
Hello @briancain!
Created the gist with debug enabled: https://gist.github.com/kongeor/739be65e67a69dbb72b211e9212c2ba9
thanks!
Thanks @kongeor ! I assume this timeout doesn't happen with other Vagrant boxes...? And also could you provide us with a reproducible Vagrantfile? Thanks!
@briancain I have added the entire Vagrantfile. No, other boxes work fine. What's also interesting is that this Vagrantfile is working fine on osx machines. Thanks!
Any update on this? Thanks!
@kongeor Have you tried what the error mentioned? i.e. _Try disabling your SSH
agent or removing some keys and try again._ ? I have yet to reproduce this issue, and I think generally it is probably mostly an issue with the underlying ssh agent on your linux system for the guest you are using. :thinking: The error itself is coming from the net-ssh library reading the packet stream...and considering it only seems to happen with that specific box, I imagine it's probably an issue with ssh on there rather than something Vagrant is doing.
@briancain
You (and Vagrant) were right!
It looks like the problem has to do with the Gnome Keyring. Not sure why it was working sometimes. :thinking:
I disabled the Gnome Keyring and switched to SSH agent as described here: https://wiki.archlinux.org/index.php/SSH_keys#SSH_agents
and I had no issues on my last two starts.
Thanks!
Sounds good @kongeor ! Glad it is working then. Sometimes tools Vagrant uses can be a bit finiky, but there's not much we can do if that's the case :smile: I'll go ahead and close this since it's working now! :tada:
Sorry @briancain but I think I rushed coming to conclusions.
I'm having exactly the same errors as before :/
An error occurred in the underlying SSH library that Vagrant uses.
The error message is shown below. In many cases, errors from this
library are caused by ssh-agent issues. Try disabling your SSH
agent or removing some keys and try again.
If the problem persists, please report a bug to the net-ssh project.
timeout waiting for next packet
Any progress on solving this issue? it seems a blocker for many vagrant users, I am having exactly the same issue with version 2.2.4 / Ubuntu 16.04 and LXC containers, I'm stuck and unable to deploy my containers on local machines, it seems to be a vagrant issue as 4 different machines are getting the same, two with ubuntu 16 and two with 18, the ssh_exception "timeout waiting for next packet" is too broad and can lead to many, many different reasons, I tried all the possible workaround by changing ssh configuration, stopping ssh-agent, increasing timeout, disabling many others things over ssh/sshd and I could even break my system, but I always get the same thing, if you guys could test mote and find out, it took 17 seconds to failure after start Setting hostname,
my machine is Ubuntu 16.04, my vagrant_box is centos7.4, my provider is lxc
thx and advance for any guidance that could help me fix this issue
Wilson
I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Most helpful comment
Sounds good @kongeor ! Glad it is working then. Sometimes tools Vagrant uses can be a bit finiky, but there's not much we can do if that's the case :smile: I'll go ahead and close this since it's working now! :tada: