2.2.3
vagrant-hostsupdater (1.1.1.160, global)
vagrant-share (1.1.9, global)
vagrant-vbguest (0.17.2, global)
MacOS 10.14.3
ubuntu/xenial64 (virtualbox, 20190208.0.0)
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "forwarded_port", host: 8888, guest: 80, host_ip: "localhost"
config.vm.network "private_network", ip: "192.168.42.10"
config.vm.hostname = "dev.example.com"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provision "file", source: "conf/vagrant", destination: "/home/vagrant"
end
https://gist.github.com/angoras/e1138fc79b1b56da892298ff1ca39274
The directory (including some files) should be copied into the guest, as described here:
https://www.vagrantup.com/docs/provisioning/file.html
The script terminates with the above error.
The problem is this line:
config.vm.provision "file", source: "conf/vagrant", destination: "/home/vagrant"
It used to work, but with the latest update, 2.2.3, it stopped working. If every file is copied separately it still works, but not when defined on the directory level. Maybe it has got something to do with [GH-10570]?
Hello @angoras - I don't think that issue is related. It's taking already existing variables and just printing information.
What does your folder config/vagrant look like? What files are inside? If you pick a different folder to sync with say a simple text file, does it work like expected? Thanks!
Oh, okay. I just noticed you are using a file provisioner. I have to ask, is conf/vagrant a file, or a folder? The debug output makes me think it's a folder.
@briancain Yes, it's a folder with some text files and a subfolder with additional text files.
@angoras - if you want to sync a folder, you need to use the synced_folders config option:
config.vm.synced_folder "conf/vagrant", "home/vagrant"
The file provisioner is only for files, not folders. That would explain the odd behavior. Thanks!
@briancain But this is not a synced folder, it's just copied during the provision. Like the last example here:
https://www.vagrantup.com/docs/provisioning/file.html
@angoras - you can use rsync for that if you just one a one time copy to the guest:
The rsync synced folder does a one-time one-way sync from the machine running to the machine being started by Vagrant.
https://www.vagrantup.com/docs/synced-folders/rsync.html
config.vm.synced_folder "conf/vagrant", "home/vagrant, type: "rsync"
@briancain The "file" provisioner is used to copy folders into the VM, and it works with my configuration, but not with my coworkers, who gets the same error messages as @angoras.
Also the documentation clearly says this
The Vagrant file provisioner allows you to upload a file or directory from the host machine to the guest machine.
You can see that for yourself here: https://www.vagrantup.com/docs/provisioning/file.html
So, you saying to use the synced folders instead is _not helping_ my coworker or @angoras getting their "used-to-be-working-previously" configuration working again with a new version, that apparently has a regression.
I will try and get the debug output and version numbers for ruby, gem, vagrant etc. once my coworker gets to the office.
EDIT: sorry for the harsh tone. But this is really something driving me up the wall very easily, completely ignoring the original issue and instead just offering a replacement, when clearly the original approach is a regression that used to be working before.
@dgollub - Okay, it does look like the file provisioner for whatever reason does support folders.
@angoras - I've also tried to reproduce the error, and it doesn't happen with the latest version:
config.vm.define "bork" do |b|
b.vm.box = "bento/ubuntu-18.04"
b.vm.provision "Sandbox", type: "file",
source: "linux-sandbox/Vagrantfile",
destination: "/home/vagrant/test/Vagrantfile"
b.vm.provision "file",
source: "conf/vagrant",
destination: "/home/vagrant"
b.vm.provider :virtualbox
end
brian@localghost:vagrant-sandbox % tree conf ยฑ[โโ][master]
conf
โโโ vagrant
โโโ scripts
โโโ linux
โย ย โโโ a folder
โย ย โย ย โโโ test.sh
โย ย โโโ folder
โย ย โย ย โโโ hello.sh
โย ย โโโ hello.sh
โย ย โโโ install-docker.sh
โย ย โโโ install-vagrant.sh
โย ย โโโ install-vbox.sh
โย ย โโโ setup-debug-env.sh
โย ย โโโ test.sh
โโโ windows
โโโ admin.ps1
โโโ hello.ps1
โโโ info.ps1
โโโ setuphyperv.ps1
โโโ setup.ps1
6 directories, 13 files
brian@localghost:vagrant-sandbox % be vagrant up bork ยฑ[โโ][master]
Bringing machine 'bork' up with 'virtualbox' provider...
==> bork: Importing base box 'bento/ubuntu-18.04'...
==> bork: Matching MAC address for NAT networking...
==> bork: Checking if box 'bento/ubuntu-18.04' version '201812.27.0' is up to date...
==> bork: Setting the name of the VM: vagrant-sandbox_bork_1550098092413_82183
==> bork: Fixed port collision for 22 => 2222. Now on port 2200.
==> bork: Clearing any previously set network interfaces...
==> bork: Preparing network interfaces based on configuration...
bork: Adapter 1: nat
==> bork: Forwarding ports...
bork: 22 (guest) => 2200 (host) (adapter 1)
==> bork: Booting VM...
==> bork: Waiting for machine to boot. This may take a few minutes...
bork: SSH address: 127.0.0.1:2200
bork: SSH username: vagrant
bork: SSH auth method: private key
bork:
bork: Vagrant insecure key detected. Vagrant will automatically replace
bork: this with a newly generated keypair for better security.
bork:
bork: Inserting generated public key within guest...
bork: Removing insecure key from the guest if it's present...
bork: Key inserted! Disconnecting and reconnecting using new SSH key...
==> bork: Machine booted and ready!
==> bork: Checking for guest additions in VM...
bork: The guest additions on this VM do not match the installed version of
bork: VirtualBox! In most cases this is fine, but in rare cases it can
bork: prevent things such as shared folders from working properly. If you see
bork: shared folder errors, please make sure the guest additions within the
bork: virtual machine match the version of VirtualBox you have installed on
bork: your host and reload your VM.
bork:
bork: Guest Additions Version: 5.2.22
bork: VirtualBox Version: 6.0
==> bork: Mounting shared folders...
bork: /vagrant => /home/brian/code/vagrant-sandbox
==> bork: Running provisioner: Sandbox (file)...
bork: /home/brian/code/vagrant-sandbox/linux-sandbox/Vagrantfile => /home/vagrant/test/Vagrantfile
==> bork: Running provisioner: file...
bork: /home/brian/code/vagrant-sandbox/conf/vagrant/. => /home/vagrant
brian@localghost:vagrant-sandbox % be vagrant ssh bork ยฑ[โโ][master]
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Wed Feb 13 22:48:41 UTC 2019
System load: 0.32 Processes: 91
Usage of /: 2.4% of 61.80GB Users logged in: 0
Memory usage: 12% IP address for eth0: 10.0.2.15
Swap usage: 0%
0 packages can be updated.
0 updates are security updates.
vagrant@vagrant:~$ tree scripts/
scripts/
โโโ linux
โย ย โโโ a folder
โย ย โย ย โโโ test.sh
โย ย โโโ folder
โย ย โย ย โโโ hello.sh
โย ย โโโ hello.sh
โย ย โโโ install-docker.sh
โย ย โโโ install-vagrant.sh
โย ย โโโ install-vbox.sh
โย ย โโโ setup-debug-env.sh
โย ย โโโ test.sh
โโโ windows
โโโ admin.ps1
โโโ hello.ps1
โโโ info.ps1
โโโ setuphyperv.ps1
โโโ setup.ps1
4 directories, 13 files
vagrant@vagrant:~$ exit
logout
Connection to 127.0.0.1 closed.
I've used the same path names as the original issue, and Vagrant is able to copy everything just fine as expected. It would be helpful to know what is exactly in your folder that you are expecting to copy over to the guest. My guess is maybe there's an issue with the name of a file you have in that folder.
Still, I will still stand by my original suggestion and say that the synced_folder option (with rsync if you must only sync once) is still a _much more sane option_ for something like this. The file provisioner uses scp to copy files, and there are differences across platforms that make this difficult and very bug prone with something like copying folders. The synced_folder option is much more reliable in this case for what you are trying to do.
@briancain Thanks for your reply. I have gathered additional information, and this all - to me at least - points to a combination of the Vagrant source itself in tandem with the new macOS 10.14.x as source for the issue.
Unfortunately I do not have a Linux nor a Windows host machine to verify whether or not this is purely a Vagrant issue or purely a macOS 10.14.x issue.
Anyway, here is more information, and I did this all on my MacBook Pro with macOS 10.14.2 (18C54).
Vagrantfile part
config.vm.provision "file", source: "scripts/vagrant/docker-build-postgres", destination: "docker-build-postgres"
docker-build-postgres is a folder with two files in it, Dockerfile and docker-postgres-setup.sql.
Starting point is Vagrant version 2.2.0, installed when I was still on macOS 10.13.x, and back then using the file provisioner with a directory still worked as described in the documentation.
However my coworker got a new MacBook Pro with macOS: 10.14.3 (18D109) and installed Vagrant 2.2.3, and the provisioning using the file provisioner with a directory fails with this error message:
==> default: Running provisioner: file...
default: /<redacted>/scripts/vagrant/docker-build-postgres/. => docker-build-postgres
/opt/vagrant/embedded/gems/2.2.3/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state': scp: error: unexpected filename: . (RuntimeError)
Debug output says basically the same the one @angoras posted.
I then went ahead and upgrade my Vagrant to 2.2.3 as well, and tried vagrant halt followed by vagrant up --provision --debug &> vagrant.log. And low and behold, same error.
So I tried downgrading to the following versions:
5.2.26 r128414 (Qt5.6.3) which is not supported by 1.9.8.Also, the 2.1.5 log had this extra debug output, that the 2.2.0 and 2.2.3 one did not have (I am referring to the DEBUG guest/ssh statements):
DEBUG guest: Searching for cap: shell_expand_guest_path
DEBUG guest: Checking in: ubuntu
DEBUG guest: Checking in: debian
DEBUG guest: Checking in: linux
DEBUG guest: Found cap: shell_expand_guest_path in linux
INFO guest: Execute capability: shell_expand_guest_path [#<Vagrant::Machine: default (VagrantPlugins::ProviderVirtualBox::Provider)>, "docker-build-postgres"] (ubuntu)
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: echo; printf docker-build-postgres (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
INFO ssh: Execute: mkdir -p "docker-build-postgres" (sudo=false)
DEBUG ssh: stderr: 41e57d38-b4f7-4e46-9c38-13873d338b86-vagrant-ssh
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /<redacted>/scripts/vagrant/docker-build-postgres/. to docker-build-postgres
DEBUG ssh: Re-using SSH connection.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x00000001025eece8>
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x00000001026cf1a8>
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x00000001026a66e0>
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x0000000102c1f338>
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x0000000102c1f3b0>
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: scp: error: unexpected filename: .
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO environment: Released process lock: machine-action-dad4bf7d416570a9657e2e4aa872778f
INFO environment: Running hook: environment_unload
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 1 hooks defined.
INFO runner: Running action: environment_unload #<Vagrant::Action::Builder:0x00000001026df990>
/opt/vagrant/embedded/gems/2.1.5/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state': scp: error: unexpected filename: . (RuntimeError)
from /opt/vagrant/embedded/gems/2.1.5/gems/net-scp-1.2.1/lib/net/scp.rb:365:in `block (3 levels) in start_command'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/channel.rb:610:in `do_close'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:573:in `channel_closed'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:682:in `channel_close'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:549:in `dispatch_incoming_packets'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:249:in `ev_preprocess'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/event_loop.rb:101:in `each'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/event_loop.rb:101:in `ev_preprocess'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/event_loop.rb:29:in `process'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:228:in `process'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:181:in `block in loop'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:181:in `loop'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/session.rb:181:in `loop'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-ssh-5.0.2/lib/net/ssh/connection/channel.rb:272:in `wait'
from /opt/vagrant/embedded/gems/2.1.5/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:295:in `block in upload'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:691:in `block in scp_connect'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:339:in `connect'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:689:in `scp_connect'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/communicators/ssh/communicator.rb:292:in `upload'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/provisioners/file/provisioner.rb:42:in `block in provision'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/provisioners/file/provisioner.rb:5:in `tap'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/provisioners/file/provisioner.rb:5:in `provision'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/provision.rb:138:in `run_provisioner'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/environment.rb:526:in `hook'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/provision.rb:126:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/provision.rb:126:in `block in call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/provision.rb:103:in `each'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/provision.rb:103:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/box_check_outdated.rb:82:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builtin/call.rb:53:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/plugins/providers/virtualbox/action/check_virtualbox.rb:26:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/warden.rb:34:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/builder.rb:116:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `block in run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/util/busy.rb:19:in `busy'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/action/runner.rb:66:in `run'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/machine.rb:239:in `action_raw'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/machine.rb:208:in `block in action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/environment.rb:614:in `lock'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/machine.rb:194:in `call'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/machine.rb:194:in `action'
from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
This line here looks suspicious DEBUG ssh: Uploading: /<redacted>/scripts/vagrant/docker-build-postgres/. to docker-build-postgres. Why does the path end with docker-build-postgres/. and not simply docker-build-postgres/ or docker-build-postgres? That . should not be there I'd think. Or maybe it should, but whatever macOS 10.14 changed under the hood doesn't like it any longer?! This is just a guess of course.
More details.
My environment is as follows
macOS: 10.14.2 (18C54)
$ vagrant --version
Vagrant 2.2.3
$ which gem
/usr/local/bin/gem
$ gem --version
3.0.1
$ which ruby
/usr/local/bin/ruby
$ ruby --version
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]
$ which scp
/usr/bin/scp
$ ls -la /usr/bin/scp
-rwxr-xr-x 1 root wheel 80896 Nov 30 16:38 /usr/bin/scp
Coworker:
macOS: 10.14.3 (18D109)
$ vagrant --version
Vagrant 2.2.3
$ which gem
/usr/bin/gem
$ gem --version
2.5.2.3
$ which ruby
/usr/bin/ruby
$ ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
For now we decided to list all files separately in the Vagrantfile instead of using the folder directly with the file provisioner. That works for us. But maybe this analysis helps someone else figure out what is going on.
Also, since this is a real regression, this issue should be re-opened in my opinion (or create a new one with a better title maybe).
@briancain
I've used the same path names as the original issue, and Vagrant is able to copy everything just fine as expected. It would be helpful to know what is exactly in your folder that you are expecting to copy over to the guest. My guess is maybe there's an issue with the name of a file you have in that folder.
Thanks for investigating. I really don't think the filenames has got anything to do with it. They have been the same for almost a year, and worked across many versions of both vagrant and MacOS. I'm sorry to say that I upgraded both vagrant from 2.2.2 to 2.2.3 and MacOS from 10.14.2 to 10.14.3 at the same time, so I don't know where the problem originated.
Still, I will still stand by my original suggestion and say that the synced_folder option (with rsync if you must only sync once) is still a _much more sane option_ for something like this. The file provisioner uses
scpto copy files, and there are differences across platforms that make this difficult and very bug prone with something like copying folders. The synced_folder option is much more reliable in this case for what you are trying to do.
Thanks, I will try that instead. Maybe this should be mentioned in the documentation then? :-)
The problem is with a recent OpenSSH patch. See my analysis here: https://github.com/lavabit/robox/issues/40.
Hey all. I'm going to go ahead and close this one in favor of https://github.com/hashicorp/vagrant/issues/10675 as it seems to have more information as to the actual bug here with net-scp. Thanks!
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
@briancain Thanks for your reply. I have gathered additional information, and this all - to me at least - points to a combination of the Vagrant source itself in tandem with the new macOS 10.14.x as source for the issue.
Unfortunately I do not have a Linux nor a Windows host machine to verify whether or not this is purely a Vagrant issue or purely a macOS 10.14.x issue.
Anyway, here is more information, and I did this all on my MacBook Pro with macOS 10.14.2 (18C54).
Vagrantfile part
docker-build-postgresis a folder with two files in it,Dockerfileanddocker-postgres-setup.sql.Starting point is Vagrant version 2.2.0, installed when I was still on macOS 10.13.x, and back then using the
fileprovisioner with a directory still worked as described in the documentation.However my coworker got a new MacBook Pro with macOS: 10.14.3 (18D109) and installed Vagrant 2.2.3, and the provisioning using the
fileprovisioner with a directory fails with this error message:Debug output says basically the same the one @angoras posted.
I then went ahead and upgrade my Vagrant to 2.2.3 as well, and tried
vagrant haltfollowed byvagrant up --provision --debug &> vagrant.log. And low and behold, same error.So I tried downgrading to the following versions:
5.2.26 r128414 (Qt5.6.3)which is not supported by 1.9.8.Also, the 2.1.5 log had this extra debug output, that the 2.2.0 and 2.2.3 one did not have (I am referring to the
DEBUG guest/sshstatements):This line here looks suspicious
DEBUG ssh: Uploading: /<redacted>/scripts/vagrant/docker-build-postgres/. to docker-build-postgres. Why does the path end withdocker-build-postgres/.and not simplydocker-build-postgres/ordocker-build-postgres? That.should not be there I'd think. Or maybe it should, but whatever macOS 10.14 changed under the hood doesn't like it any longer?! This is just a guess of course.More details.
My environment is as follows
Coworker:
For now we decided to list all files separately in the Vagrantfile instead of using the folder directly with the
fileprovisioner. That works for us. But maybe this analysis helps someone else figure out what is going on.Also, since this is a real regression, this issue should be re-opened in my opinion (or create a new one with a better title maybe).