TerribleDev / zanzibar

Ruby gem for interacting with a Secret Server installation
Other
20 stars 8 forks source link

Problem with requesting password from console #19

Open rnowosielski opened 8 years ago

rnowosielski commented 8 years ago

When I try to use Zanzibar 0.1.21 calling

sec = Zanzibar::Zanzibar.new(:domain => '****',
    :wsdl => "****",
    :globals => { ssl_verify_mode: :none } )

I get in this line an error with the following stack

$ rake develop --trace
** Invoke develop (first_time)
** Invoke setup_secrets (first_time)
** Execute setup_secrets
rake aborted!
Errno::EBADF: Bad file descriptor
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/zanzibar-0.1.21/lib/zanzibar.rb:69:in `noecho'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/zanzibar-0.1.21/lib/zanzibar.rb:69:in `prompt_for_password'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/zanzibar-0.1.21/lib/zanzibar.rb:34:in `initialize'
D:/StepCheck/Rakefile:175:in `new'
D:/StepCheck/Rakefile:175:in `block in <top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:248:in `call'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:248:in `block in execute'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:243:in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:243:in `execute'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:187:in `block in    invoke_with_call_chain'
C:/Ruby22-x64/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:180:in `invoke_with_call_chain'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:209:in `block in invoke_prerequisites'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:207:in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:207:in `invoke_prerequisites'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:186:in `block in invoke_with_call_chain'
C:/Ruby22-x64/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:180:in `invoke_with_call_chain'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/task.rb:173:in `invoke'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:150:in `invoke_task'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:106:in `each'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:106:in `block in top_level'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:115:in `run_with_threads'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:100:in `top_level'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:78:in `block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:176:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/lib/rake/application.rb:75:in `run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-11.0.1/bin/rake:33:in `<top (required)>'
C:/Ruby22-x64/bin/rake:23:in `load'
C:/Ruby22-x64/bin/rake:23:in `<main>'
Tasks: TOP => develop => setup_secrets
Please enter password for ***:
rnowosielski commented 8 years ago

The issue happens on Windows 7 with MINGW console.

maclennann commented 8 years ago

Thanks for the report, Rafal. My first guess is that the mingw console has some kind of trouble with io/console.

I'll see if I can get a Windows box up to repro. If that's the problem, it's probably pretty easy to swap out for highline or something else that's higher level.

maclennann commented 8 years ago

It looks like this issue effects HighLIne as well, since it uses io/console under the hood. So there's probably nothing much we can do here. Does the workaround at the bottom of the linked issue mean anything to you?

I'm going to leave this issue open, but don't plan on doing any work on it to support this one terminal type on one operating system, but if you find something that works feel free to file a PR or let us know.

jeremypaskalicimpress commented 7 years ago

I'm experiencing this same issue on Windows 7 with MINGW console. The workaround for me is to use the command prompt.

LexVocoder commented 6 years ago

In git bash, I got past this particular error with the following: winpty -- "$(which ruby)" "$(which zanzibar)" get --wsdl=... @maclennann