vagrant
vagrant copied to clipboard
Encoding::UndefinedConversionError on vagrant up
I saw that issue was reported before and it's closed now but suddenly I'm getting this error again on windows 10:
`C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in `encode!': "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError)
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in `to_wide_string'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:67:in `create_environment_pointer'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:28:in `start'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/windows/process.rb:70:in `launch_process'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/childprocess-4.0.0/lib/childprocess/abstract_process.rb:81:in `start'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:155:in `block in execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:26:in `block (2 levels) in safe_chdir'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:25:in `chdir'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:25:in `block in safe_chdir'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:24:in `synchronize'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/safe_chdir.rb:24:in `safe_chdir'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:154:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/subprocess.rb:22:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/powershell.rb:174:in `version'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/powershell.rb:195:in `validate_install!'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/powershell.rb:96:in `execute_cmd'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/platform.rb:82:in `block in windows_admin?'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/util/platform.rb:84:in `windows_admin?'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/plugins/providers/hyperv/provider.rb:20:in `usable?'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:361:in `block in default_provider'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/registry.rb:49:in `block in each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/registry.rb:48:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/registry.rb:48:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:347:in `default_provider'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:943:in `guess_provider'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:955:in `find_configured_plugins'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:983:in `process_configured_plugins'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/lib/vagrant/environment.rb:178:in `initialize'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/bin/vagrant:168:in `new'
from C:/HashiCorp/Vagrant/embedded/gems/2.2.14/gems/vagrant-2.2.14/bin/vagrant:168:in `<main>'
`
I upgraded to Vagrant 2.2.14 but this problem was on previous version 2.2.8.
It works with vagrant version 2.2..6 although I had to downgrade VirtualBox to 6.0.4.
Windows 10 version:
So starting from vagrant version 2.2.8 I have this error.
@arturbanul 这个问题你解决了吗 我今天和你遇到的问题一样 不知道问题出现在哪里 安装路径中没有中文的路径
@phpSign110 As I remember I changed python to some previous version and it started to work. Kind of workaround.
I had the same issue and solved it today. (14.03.2021)
You should go to "C:\HashiCorp\Vagrant\embedded\gems\2.2.14\gems\vagrant-2.2.14\bin" address and open "vagrant" file. At the beginning of the file, you will see "#!/usr/bin/env ruby
" Paste the below 2 lines after this first line.
Encoding.default_external = Encoding.find('Windows-1251')
Encoding.default_internal = Encoding.find('Windows-1251')
Be careful, they are "1251", not "1250". Solved. :)
I'm having the exact same error on a fresh install.
@m4h1r fix did not work for me.
Edit: downgrading to vagrant 2.2.6 and vbox 6.0.24 works.
@RosayGaspard I was going to ask you to check the version. But I believe you solved with version downgrading.
@m4h1r what will be chcp
command output in cmd and powershell on your end?
ps. in my case I had to rollback the following commit https://github.com/enkessler/childprocess/commit/0230cf96ce2fb15eb7c9538b14d75f7b50f3e505
@m4h1r what will be
chcp
command output in cmd and powershell on your end?ps. in my case I had to rollback the following commit enkessler/childprocess@0230cf9
I got it on Git Bash.
have you tried on Windows Terminal?
No, I use mostly use Git Bash for everything.
I had the same issue and solved it today. (14.03.2021) You should go to "C:\HashiCorp\Vagrant\embedded\gems\2.2.14\gems\vagrant-2.2.14\bin" address and open "vagrant" file. At the beginning of the file, you will see "
#!/usr/bin/env ruby
" Paste the below 2 lines after this first line.Encoding.default_external = Encoding.find('Windows-1251') Encoding.default_internal = Encoding.find('Windows-1251')
Be careful, they are "1251", not "1250". Solved. :)
thanks! It works for me
Having similar problem:
C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in 'encode!': "\xD0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError)
Encoding.default_external = Encoding.find('Windows-1251') Encoding.default_internal = Encoding.find('Windows-1251')
Doesn't work for me.
Having similar problem:
C:/HashiCorp/Vagrant/embedded/gems/2.2.16/gems/childprocess-4.0.0/lib/childprocess/windows/process_builder.rb:44:in 'encode!': "\xD0" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to UTF-16LE (Encoding::UndefinedConversionError)
Encoding.default_external = Encoding.find('Windows-1251') Encoding.default_internal = Encoding.find('Windows-1251')
Doesn't work for me.
Have the same issue on PowerShell. Was able to avoid it by using "cmd" instead.
Can confirm switching from Windows Terminal to cmd cleared the error,
I'm using Windows Terminal, with rolled back https://github.com/enkessler/childprocess/commit/0230cf96ce2fb15eb7c9538b14d75f7b50f3e505
How does one vote for a bug report? Thumbs up? Thumbs down? ;) In any case, I also ran into this issue: fresh Vagrant 2.2.16 install, first command from the quickstart (vagrant init hashicorp/bionic64
).
So I did some more digging. Even simple commands like vagrant --help
produce this error. I also tried to use cmd (instead of Windows Terminal) but I'm getting the same error there.
Since this seems to be a bug in enkessler/childprocess, maybe @sds can shed some light onto this issue? (I myself am not a Ruby developer so I wouldn't even know where start looking.)
encountered this in a "git bash" shell, opened a "Command Prompt" window instead and did a vagrant init
in there and it worked fine.
Can confirm switching from Windows Terminal to cmd cleared the error,
In my case, it was just enough to switch to the "Command Prompt" profile within the Windows Terminal.
Adding a possible solution to this problem as a Chinese user: make sure the installation path doesn't have any Chinese characters! This may also work for users of other languages such as Russian, Thai, Japanese, etc. Make sure that the path is in English only.