VAGRANT_HOME special characters don't work
lfbittencourt opened this issue · comments
After some hours, I figured out that Vagrant can't unpackage boxes to VAGRANT_HOME when Windows (7) username has special characters like "é". Debugging, I've seen that if username is Pelé, for example, Vagrant attempts move the file to something like C:/Users/Pel\0xE9/.vagrant.d/tmp, causing a "failed writing body" error.
I know that a username like that is weird and I still can set another value to VAGRANT_HOME, but seems like a little bug to me.
Yes I would consider this a bug as well. Thanks!
What shell are you running this in?
I did it in Command Prompt.
I actually can't reproduce this. It worked fine in my installation of Vagrant 1.3 on Windows. :( Any thoughts?
Actually, I saw this issue on a coworker's machine. Let me create another user with the same special char on my own machine and try to reproduce the error. I will post the debug output as soon as I can.
OK, reproduced that. I created an user "Berté" and tried to start a Vagrant instance with a common Vagrantfile. The output of vagrant up
was:
C:\Users\Berté\Desktop\vagrant>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Box 'boilerplate' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading or copying the box...
?[0KAn error occurred while downloading the remote file. The error)-:--)
message, if any, is reproduced below. Please fix this error and try
again.
Failed writing body (0 != 1205)
Then I enabled VAGRANT_LOG to get more information about the error. Here's the output:
C:\Users\Berté\Desktop\vagrant>SET VAGRANT_LOG=INFO
C:\Users\Berté\Desktop\vagrant>vagrant up
INFO global: Vagrant version: 1.2.3
INFO manager: Registered plugin: box command
INFO manager: Registered plugin: destroy command
INFO manager: Registered plugin: halt command
INFO manager: Registered plugin: init command
INFO manager: Registered plugin: package command
INFO manager: Registered plugin: plugin command
INFO manager: Registered plugin: provision command
INFO manager: Registered plugin: reload command
INFO manager: Registered plugin: resume command
INFO manager: Registered plugin: ssh command
INFO manager: Registered plugin: ssh-config command
INFO manager: Registered plugin: status command
INFO manager: Registered plugin: suspend command
INFO manager: Registered plugin: up command
INFO manager: Registered plugin: ssh communicator
INFO manager: Registered plugin: Arch guest
INFO manager: Registered plugin: Debian guest
INFO manager: Registered plugin: Fedora guest
INFO manager: Registered plugin: FreeBSD guest
INFO manager: Registered plugin: Gentoo guest
INFO manager: Registered plugin: Linux guest.
INFO manager: Registered plugin: OmniOS guest.
INFO manager: Registered plugin: OpenBSD guest
INFO manager: Registered plugin: PLD Linux guest
INFO manager: Registered plugin: RedHat guest
INFO manager: Registered plugin: Solaris guest.
INFO manager: Registered plugin: SUSE guest
INFO manager: Registered plugin: Ubuntu guest
INFO manager: Registered plugin: Arch host
INFO manager: Registered plugin: BSD host
INFO manager: Registered plugin: Fedora host
INFO manager: Registered plugin: FreeBSD host
INFO manager: Registered plugin: Gentoo host
INFO manager: Registered plugin: Linux host
INFO manager: Registered plugin: OpenSUSE host
INFO manager: Registered plugin: Windows host
INFO manager: Registered plugin: kernel
INFO manager: Registered plugin: kernel
INFO manager: Registered plugin: VirtualBox provider
INFO manager: Registered plugin: ansible
INFO manager: Registered plugin: CFEngine Provisioner
INFO manager: Registered plugin: chef
INFO manager: Registered plugin: puppet
INFO manager: Registered plugin: shell
INFO vagrant: `vagrant` invoked: ["up"]
INFO environment: Environment initialized (#<Vagrant::Environment:0x2cad3f8>)
INFO environment: - cwd: C:/Users/Berté/Desktop/vagrant
INFO environment: Home path: C:/Users/Berté/.vagrant.d
INFO environment: Local data path: C:/Users/Berté/Desktop/vagrant/.vagrant
INFO environment: Running hook: environment_load
INFO environment: Initializing config...
INFO loader: Set :default = "C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/config/default.rb"
INFO loader: Set :root = #<Pathname:C:/Users/Bert?/Desktop/vagrant/Vagrantfile>
INFO loader: Loading configuration in order: [:default, :home, :root]
INFO hosts: Host class: VagrantPlugins::HostWindows::Host
INFO runner: Running action: #<Vagrant::Action::Builder:0x2d1d718>
INFO cli: CLI: [] "up" []
INFO environment: Getting machine: default (virtualbox)
INFO environment: Uncached load of machine.
INFO loader: Set :vm_default = []
INFO loader: Loading configuration in order: [:default, :home, :root, :vm_default]
INFO environment: Provider-supported box formats: [:virtualbox]
INFO box_collection: Searching for box: boilerplate (virtualbox) in C:/Users/Berté/.vagrant.d/boxes/boilerplate/virtualbox/metadata.json
INFO box_collection: Searching for V1 box: boilerplate
INFO box_collection: Box not found: boilerplate (virtualbox)
INFO machine: Initializing machine: default
INFO machine: - Provider: VagrantPlugins::ProviderVirtualBox::Provider
INFO machine: - Box:
INFO machine: - Data dir: C:/Users/Berté/Desktop/vagrant/.vagrant/machines/default/virtualbox
INFO base: VBoxManage path: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "--version"]
INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_4_2
INFO base: VBoxManage path: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
INFO command: With machine: default (VirtualBox (new VM))
INFO interface: info: Bringing machine 'default' up with 'virtualbox' provider...
Bringing machine 'default' up with 'virtualbox' provider...
INFO batch_action: Enabling parallelization by default.
INFO batch_action: Disabling parallelization because provider doesn't support it: virtualbox
INFO batch_action: Batch action will parallelize: false
INFO batch_action: Starting action: #<Vagrant::Machine:0x683b20> up {:parallel=>true, :provision_enabled=>true, :provision_types=>nil}
INFO machine: Calling action: up on provider VirtualBox (new VM)
INFO runner: Running action: #<Vagrant::Action::Builder:0x2c18a30>
INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckVirtualbox:0x2cf0e50>
INFO base: VBoxManage path: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "--version"]
INFO meta: Using VirtualBox driver: VagrantPlugins::ProviderVirtualBox::Driver::Version_4_2
INFO base: VBoxManage path: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
INFO subprocess: Starting process: ["C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe", "list", "hostonlyifs"]
INFO warden: Calling action: #<Vagrant::Action::Builtin::ConfigValidate:0x2cf0e20>
INFO warden: Calling action: #<Vagrant::Action::Builtin::Call:0x2cf0e08>
INFO runner: Running action: #<Vagrant::Action::Builder:0x2cf2188>
INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::Created:0x2cf00b8>
INFO runner: Running action: #<Vagrant::Action::Warden:0x2c33730>
INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckAccessible:0x2c336d0>
INFO warden: Calling action: #<Vagrant::Action::Builtin::HandleBoxUrl:0x2c336b8>
INFO box_collection: Searching for box: boilerplate (virtualbox) in C:/Users/Berté/.vagrant.d/boxes/boilerplate/virtualbox/metadata.json
INFO box_collection: Searching for V1 box: boilerplate
INFO box_collection: Box not found: boilerplate (virtualbox)
INFO interface: info: Box 'boilerplate' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
[default] Box 'boilerplate' was not found. Fetching box from specified URL for
the provider 'virtualbox'. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
INFO runner: Running action: #<Vagrant::Action::Builder:0x2bd4f18>
INFO warden: Calling action: #<Vagrant::Action::Builtin::BoxAdd:0x294eeb0>
INFO box_add: Downloading box to: C:/Users/Berté/.vagrant.d/tmp/box1378499179
INFO interface: info: Downloading or copying the box...
Downloading or copying the box...
INFO downloader: Downloader starting download:
INFO downloader: -- Source: http://static.dzestudio.com.br/vagrant/boilerplate.box
INFO downloader: -- Destination: C:/Users/Berté/.vagrant.d/tmp/box1378499179
INFO subprocess: Starting process: ["C:\\HashiCorp\\Vagrant\\bin\\\\..\\embedded\\bin/curl.EXE", "--fail", "--location", "--max-redirs", "10", "--output", "C:/Users/Bert\x82/.vagrant.d/tmp/box1378499179", "http://static.dzestudio.com.br/vagrant/boilerplate.box"]
?[0KO interface: info:
?[0K INFO interface: info: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--) INFO interface: inf
?[0K
?[0K INFO interface: info: Progress: 0% (Rate: 2489/s, Estimated time remaining:
42:00:31)
Progress: 0% (Rate: 2489/s, Estimated time remaining: 42:00:31) INFO interface:
?[0K:
?[0K WARN downloader: Downloader exit code: 23
ERROR warden: Error occurred: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try again.
Failed writing body (0 != 1205)
INFO warden: Beginning recovery process...
INFO warden: Calling recover: #<Vagrant::Action::Builtin::BoxAdd:0x294eeb0>
INFO warden: Recovery complete.
ERROR warden: Error occurred: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try again.
Failed writing body (0 != 1205)
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
INFO warden: Beginning recovery process...
INFO warden: Recovery complete.
ERROR warden: Error occurred: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try again.
Failed writing body (0 != 1205)
INFO warden: Beginning recovery process...
INFO warden: Calling recover: #<Vagrant::Action::Builtin::Call:0x2cf0e08>
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 environment: Running hook: environment_unload
INFO runner: Running action: #<Vagrant::Action::Builder:0x2c2be88>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::DownloaderError: An error occurred while downl
oading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Failed writing body (0 != 1205)>
ERROR vagrant: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try again.
Failed writing body (0 != 1205)
ERROR vagrant: C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/util/downloader.rb:138:in `download!'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builtin/box_add.rb:39:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/warden.rb:34:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builder.rb:116:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/runner.rb:61:in `block in run'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/util/busy.rb:19:in `busy'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/runner.rb:61:in `run'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builtin/handle_box_url.rb:55:in `block in call'<internal:prelude>:10:in `synchronize'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builtin/handle_box_url.rb:33:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/warden.rb:34:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/warden.rb:34:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/runner.rb:61:in `block in run'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/util/busy.rb:19:in `busy'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/runner.rb:61:in `run'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builtin/call.rb:51:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/warden.rb:34:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/warden.rb:34:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/warden.rb:34:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/builder.rb:116:in `call'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/runner.rb:61:in `block in run'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/util/busy.rb:19:in `busy'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/action/runner.rb:61:in `run'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/machine.rb:147:in `action'
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.2.3/lib/vagrant/batch_action.rb:63:in `block (2 levels) in run'
INFO interface: error: An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try again.
Failed writing body (0 != 1205)
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Failed writing body (0 != 1205)
Since I setted VAGRANT_HOME to "C:\Windows\Temp" and everything worked fine, my guess is that the error is exactly in the line below, specifically in the Bert\x82 thing:
INFO subprocess: Starting process: ["C:\\HashiCorp\\Vagrant\\bin\\\\..\\embedded\\bin/curl.EXE", "--fail", "--location", "--max-redirs", "10", "--output", "C:/Users/Bert\x82/.vagrant.d/tmp/box1378499179", "http://static.dzestudio.com.br/vagrant/boilerplate.box"]
Can you recreate the same scenario now?
What about this problem?
I have exactly same problem because I have not english user name in windows:
INFO downloader: -- Source: http://files.vagrantup.com/precise32.box
INFO downloader: -- Destination: C:/Users/Андрей/.vagrant.d/tmp/box1380827249
...
INFO subprocess: Starting process: ["C:\\HashiCorp\\Vagrant\\bin\\\\..\\embedded\\bin/curl.EXE", "--fail", "--location"
, "--max-redirs", "10", "--user-agent", "Vagrant/1.3.3", "--output", "C:/Users/\x80\xAD\xA4\xE0\xA5\xA9/.vagrant.d/tmp/b
ox1380827249", "http://files.vagrantup.com/precise32.box"]
...
←[0K INFO interface: info: Progress: 100% (Rate: 107/s, Estimated time remaining: --:--:--)
0 281M 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:-- 0Warning: Failed to create the file
Warning: C:/Users/??????/.vagrant.d/tmp/box1380827249: No such file or
Warning: directory
After changing VAGRANT_HOME to normal english path all works good.
Same here.
+1
+1
Here's another issue I ran into I think for the same reason :
$> vagrant up
[...]
[proxy] Mounting shared folders...
[proxy] -- /vagrant
Failed to mount folders in Linux guest. This is usually beacuse
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` /vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` /vagrant /vagrant
I had put my vagrant box directory inside c:\cygwin64\home\$USER
where USER
is my first name "Jérémy", with the accents. After moving the directory to C:\Vagrant
everything went fine.
Since I spent some time tracking this down without finding any workaround on google I thought I might post this here for referencing purpose.
+1
I'm not sure if both problems are related, but I can't put special chars in the vb.name
setting either. However, I can do this normally in VirtualBox.
@mitchellh Should I open another issue or keep it in this one?
This remains an issue with Vagrant 1.6.2:
C:\Users\Илья\test>vagrant
Vagrant failed to initialize at a very early stage:
The home directory you specified is not accessible. The home
directory that Vagrant uses must be both readable and writable.
You specified: C:/Users
The problem with the username can be solved by the following fix:
diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb
index 6e51667..d0262e4 100644
--- a/lib/vagrant/util/platform.rb
+++ b/lib/vagrant/util/platform.rb
@@ -121,7 +121,7 @@ module Vagrant
# Traverse each part and join it into the resulting path
original.each do |single|
Dir.entries(path).each do |entry|
- if entry.downcase == single.downcase
+ if entry.encode('UTF-8').downcase == single.encode('UTF-8').downcase
path = path.join(entry)
end
end
Vagrant completes initialization after that. However, another problem appears:
C:\Users\Илья\test>vagrant
Usage: vagrant [options] <command> [<args>]
-v, --version Print the version and exit.
-h, --help Print this help.
Common commands:
box manages boxes: installation, removal, etc.
connect connect to a remotely shared Vagrant environment
destroy stops and deletes all traces of the vagrant machine
global-status outputs status Vagrant environments for this user
halt stops the vagrant machine
help shows the help for a subcommand
init initializes a new Vagrant environment by creating a Vagrantfile
login log in to Vagrant Cloud
package packages a running vagrant environment into a box
plugin manages plugins: install, uninstall, update, etc.
provision provisions the vagrant machine
rdp connects to machine via RDP
reload restarts vagrant machine, loads new Vagrantfile configuration
resume resume a suspended vagrant machine
share share your Vagrant environment with anyone in the world
ssh connects to machine via SSH
ssh-config outputs OpenSSH valid configuration to connect to the machine
status outputs status of the vagrant machine
suspend suspends the machine
up starts and provisions the vagrant environment
version prints current and latest Vagrant version
For help on any individual command run `vagrant COMMAND -h`
Additional subcommands are available, but are either more advanced
or not commonly used. To see all subcommands, run the command
`vagrant list-commands`.
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/capability_host.rb:117:in `inspect': inspected result must be ASCII only
or use the same encoding with default external (Encoding::CompatibilityError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/capability_host.rb:117:in `autodetect_capability_host'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/capability_host.rb:36:in `initialize_capabilities!'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/host.rb:13:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/environment.rb:363:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/environment.rb:363:in `host'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/environment.rb:168:in `block in action_runner'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/action/runner.rb:33:in `call'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/action/runner.rb:33:in `run'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/environment.rb:346:in `hook'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/environment.rb:556:in `unload'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/bin/vagrant:169:in `<main>'
Please notice that the same is true for the hostname.
With a hostname that constains umlauts I get this stacktrace (Version 1.6.3):
D:/dev/Vagrant/embedded/gems/gems/childprocess-0.5.3/lib/childprocess/windows/process_builder.rb:63:in `join': incompatible character encodings: CP850 and ASCII-8BIT (Encoding::CompatibilityError)
from D:/dev/Vagrant/embedded/gems/gems/childprocess-0.5.3/lib/childprocess/windows/process_builder.rb:63:in `create_environment_pointer'
from D:/dev/Vagrant/embedded/gems/gems/childprocess-0.5.3/lib/childprocess/windows/process_builder.rb:28:in `start'
from D:/dev/Vagrant/embedded/gems/gems/childprocess-0.5.3/lib/childprocess/windows/process.rb:68:in `launch_process'
from D:/dev/Vagrant/embedded/gems/gems/childprocess-0.5.3/lib/childprocess/abstract_process.rb:82:in `start'
from D:/dev/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/subprocess.rb:103:in `block in execute'
from D:/dev/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/safe_chdir.rb:26:in `block (2 levels) in safe_chdir'
from D:/dev/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/safe_chdir.rb:25:in `chdir'
from D:/dev/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/safe_chdir.rb:25:in `block in safe_chdir'
I saw this for the first time on a Mac today. My username has no "funny" characters, and the VM's hostname is something like example.dev
. The command vagrant up
ran fine, but then vagrant ssh
crashed with the following error. At that point everything crashed with the same error, provision
, halt
, destroy
... even destroy --force
and simply vagrant
.
/Applications/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler/runtime.rb:222:in `split': invalid byte sequence in UTF-8 (ArgumentError)
from /Applications/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler/runtime.rb:222:in `setup_environment'
from /Applications/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler/runtime.rb:15:in `setup'
from /Applications/Vagrant/embedded/gems/gems/bundler-1.6.2/lib/bundler.rb:127:in `setup'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:71:in `<main>'
I was talking about the hosts hostname, have you checked out that one as well?
May be relevant: Ruby, the Web, more of the world now uses UTF-8 by default. Windows uses UTF-16.
Just a small workaround to fix this:
I have set the enviroment variable "GEM_HOME" to an other directory on my disk and now everything works as expected.
I manged to skip that error with setting env var: VAGRANT_HOME to path with only ASCII chars. But fixing that will be great thing.
please fix this. :(
This is what I get, every time I use vagrant:
C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:224:in `join': incompatible character encodings: CP852 and Windows-1250 (
Encoding::CompatibilityError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:224:in `setup_environment'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler/runtime.rb:15:in `setup'
from C:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.6.6/lib/bundler.rb:127:in `setup'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.5/bin/vagrant:71:in `<main>'
I had similar problem with capistrano, but it was solved when I've updated Ruby from 2.0 to 2.1.
Maybe it is the solution?
I'm ~80% certain that upgrading the Vagrant installer to Ruby 2.1 will fix this issue. Ruby core has spent a lot of time fixing all the encoding issues.
@sethvargo At least the issue with special chars in vb.name
remains even upgrading to Ruby 2.1.
Same issue here on Win 7. I have an "é" in my username and I'm getting the encoding error. Creating and using another user just for the vm would be a hassle. Any workarounds for this?
workaround: set VAGRANT_HOME to another directory. I set mine to c:\vagrant
Even if Ruby fixes the issue, the underlying provider (vmware, vbox) likely won't support it 😦
@luisrudge Thank you Luis, that did the trick.
Just a heads up for those that want to use this fix, Luis's solution is limited to the current session so remember to put that line in your bash profile.
I'm on Windows and I set globally to that directory, so it's always working!
Just to confirm, setting VAGRANT_HOME and GEM_HOME to a ASCII only path will fix this issue without any other (at least not detected) problems.
in windows you can do on a elevated cmd prompt (run as admin):
setx VAGRANT_HOME "X:/your/path"
setx GEM_HOME "X:/gem/path"
I know this won't fix the issue, but might help others who come here searching for a sollution or quick fix :)
I got a similar error when using rsync, it appears that the problem did not comme from vagrant but rather from different locale between host and vm.
After setting the same locale on my vm as my host i don't have this problem anymore.
Ohai everyone! Given the nature of this (and related issues), I have created #4966. Please add your thoughts and ideas there. While it is feasible for Vagrant to fix these types of encoding issues, there are known issues with the underlying providers (VirtualBox, etc) that are likely to be affected. As such, I think the best pathway forward is for Vagrant to expose a warning message to users when their path contains "invalid" characters so it is obvious to the user the issue at hand.
+1
+1
C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/plugins/providers/virtualbox/driver/version_5_0.rb:582:in `read_state': invalid byte sequence in UTF-8 (ArgumentError)
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/plugins/providers/virtualbox/provider.rb:101:in `state'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/machine.rb:514:in `state'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/machine.rb:145:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/vagrantfile.rb:79:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/vagrantfile.rb:79:in `machine'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/environment.rb:700:in `machine'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/plugin/v2/command.rb:180:in `block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/plugin/v2/command.rb:213:in `block in with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/plugin/v2/command.rb:212:in `map'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/plugin/v2/command.rb:212:in `with_target_vms'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/plugins/commands/reload/command.rb:37:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/cli.rb:54:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/lib/vagrant/environment.rb:275:in `cli'
from C:/HashiCorp/Vagrant/embedded/gems/2.0.4/gems/vagrant-2.0.4/bin/vagrant:151:in `<main>'
For me the following worked:
1.) Go to c:\Users
2.) Create a symlink/ junction from c:\Users\newfolder --> c:\Users\special_character_folder
3.) CMD: set VAGRANT_HOME "C:/users/newfolder"
4.) restart windows
5.) start cmd and switch to c:\Users\newfolder
6.) execute "vagrant up"
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.