Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vagrant login fails #3119

Closed
thasmo opened this issue Mar 11, 2014 · 16 comments
Closed

vagrant login fails #3119

thasmo opened this issue Mar 11, 2014 · 16 comments

Comments

@thasmo
Copy link

thasmo commented Mar 11, 2014

On Cygwin (Windows 8.1) vagrant login fails:

vagrant login
In a moment we'll ask for your username and password to Vagrant Cloud.
After authenticating, we will store an access token locally. Your
login details will be transmitted over a secure connection, and are
never stored on disk locally.

If you don't have a Vagrant Cloud account, sign up at vagrantcloud.com

Username or Email: thasmo
Password (will be hidden): C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/ui.rb:150:in `noecho': Bad file descriptor (Errno::EBADF)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/ui.rb:150:in `ask'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-login-1.0.0/lib/vagrant-login/activated.rb:49:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/cli.rb:42:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/environment.rb:244:in `cli'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/bin/vagrant:147:in `<main>'
@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

The relevant debug log part is this:

 INFO interface: ask: Username or Email:
Username or Email: thasmo
 INFO interface: ask: Password (will be hidden):
Password (will be hidden):  INFO environment: Running hook: environment_unload
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x56362f8>
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/ui.rb:150:in `noecho': Bad file descriptor (Errno::EBADF)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/ui.rb:150:in `ask'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-login-1.0.0/lib/vagrant-login/activated.rb:49:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/cli.rb:42:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/lib/vagrant/environment.rb:244:in `cli'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.5.0/bin/vagrant:147:in `<main>'

@mitchellh
Copy link
Contributor

Hm, I can't reproduce this. We're not doing anything fancy here: https://github.com/mitchellh/vagrant/blob/24d8067c7b0b8b7042b6b92c44cd7e48c693a8b4/lib/vagrant/ui.rb#L150

Can you run an irb console and try that sort of thing on your own?

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

Sure, I'll try - what exactly should I run/execute? Thank you!

@mitchellh
Copy link
Contributor

That line, pretty much.

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

What I do/get:

# irb
irb(main):001:0> input = $stdin.noecho(&:gets)
NoMethodError: undefined method `noecho' for #<IO:<STDIN>>
        from (irb):1
        from /usr/bin/irb:12:in `<main>'
irb(main):002:0>

irb --version is "irb 0.9.6(09/06/30)"

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

But that's the irb from Cygwin itself.

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

ruby --version is "ruby 1.9.3p484 (2013-11-22) [x86_64-cygwin]"

@mitchellh
Copy link
Contributor

I'm in Cygwin too and ran both vagrant login and that in IRB and it worked... :(

@sneal
Copy link
Contributor

sneal commented Mar 11, 2014

Same here, not using Cygwin but Chef's embedded Ruby distro

irb(main):001:0> input = $stdin.noecho(&:gets)
NoMethodError: undefined method `noecho' for #<IO:<STDIN>>
        from (irb):1
        from C:/opscode/chef/embedded/bin/irb:12:in `<main>'
irb(main):002:0> exit

C:\Users\vagrant>ruby -v
ruby 1.9.3p448 (2013-06-27) [i386-mingw32]

Fails the same way no my Mac - same version of Ruby

@mitchellh
Copy link
Contributor

@sneal That was added in Ruby 2.0 (what Vagrant ships with). You'd need to try that.

@mitchellh
Copy link
Contributor

@thasmo One other thing you can try: modify the Vagrant source code directly to change that line I linked to just $stdin.gets. Does it work then? (it won't hide your password).

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

@mitchellh yes, that worked. How is this related to the Ruby version I run? Shouldn't Vagrant use it's own? Is it a misconfiguration by myself?

@mitchellh
Copy link
Contributor

@thasmo Its not related to the Ruby version, it is a Cygwin problem: you must have some Cygwin dependency (or missing one) that is not supporting the syscall to have noecho. I can fix this now though in a jank way.

@thasmo
Copy link
Author

thasmo commented Mar 11, 2014

Hm, weird. I can check that dependency thing when I'm at home. I installed Ruby via Cygwin package - not sure if it's coming from the original package repo or from cygwinports, which I use too.

@mitchellh
Copy link
Contributor

Fixed.

@mitchellh
Copy link
Contributor

@thasmo Its not a Ruby issue: Vagrant uses its own packaged Ruby. The issue is that your stdin is reporting it doesn't support the noecho functionality. Its likely an environmental variable issue...

@ghost ghost locked and limited conversation to collaborators Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants