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

Please enter a password for the new user: stty: standard input: Invalid argument #28

Closed
millisami opened this issue Mar 2, 2013 · 6 comments

Comments

@millisami
Copy link

@fnichol , I tried with the latest release of knife-server and its works.
But at the end, it complains about the WARNING: No knife configuration file found
I tried it twice:

  1. adding knife.rb in ./.chef directory
  2. adding knife.rb file in the local dir itself
    Both didn't work.
    I followed it on the README as well, but where should I put the knife.rb file.
    One may be in the ~/.chef/knife.rb, this file is also there.
    But I want it to be in the project local directory.
192.168.33.10 Deleting user knifey ...
192.168.33.10 
192.168.33.10 
192.168.33.10 Finished in 49.75 seconds
192.168.33.10 
192.168.33.10 70 examples, 0 failures
192.168.33.10 
192.168.33.10        Pedant suite finished
192.168.33.10 
192.168.33.10 -----> Bootstraping Chef Server on chef11.server.com is complete.
192.168.33.10 
WARNING: No knife configuration file found
Creating initial API user...
Please enter a password for the new user: stty: standard input: Invalid argument
stty: standard input: Invalid argument
stty: standard input: Invalid argument

Created user[root]
Configuration file written to /root/.chef/knife.rb

Where to put it?

@fnichol
Copy link
Owner

fnichol commented Mar 2, 2013

Did you get a fully working Chef Server at the end?

Most of the output post "-----> Bootstraping…" is STDOUT from the Chef server. Under the covers a knife configure --initial is performed for the root user which sets up a knife.rb and root Chef user. The best I could do was to pipe a password into the knife configure command.

Maybe there is a way to silence these errors as they are standard operation procedure

@erikh
Copy link
Contributor

erikh commented Mar 3, 2013

my guess is knife configure -i is running stty noecho or similar. stty sane might fix it, or ensuring pty allocation is done with ssh (-t argument to cli tool, not sure with net-ssh) might also.

if the latter is the case, this might fix the sudo issues as well.

@millisami
Copy link
Author

Though the server gets installed and works.
@erikh 's suggestion might work, but I don't have any much knowledge about that stty noecho or stty name

The following is the structure:

root@chef11-on-vagrant:/etc/chef-server# tree
.
├── admin.pem
├── chef-server.rb
├── chef-server-running.json
├── chef-server-secrets.json
├── chef-validator.pem
└── chef-webui.pem

0 directories, 6 files
root@chef11-on-vagrant:/etc/chef-server# cd /root/.chef/
root@chef11-on-vagrant:~/.chef# tree
.
├── knife.rb
└── root.pem

0 directories, 2 files
root@chef11-on-vagrant:~/.chef#

@erikh
Copy link
Contributor

erikh commented Mar 3, 2013

It probably doesn't "really" matter, but it's a UI wart I suppose.

millisami notifications@github.com wrote:

Though the server gets installed and works.
@erikh 's suggestion might work, but I don't have any much knowledge
about that stty noecho or stty name


Reply to this email directly or view it on GitHub:
#28 (comment)

Sent from my Android phone with K-9 Mail. Please excuse my brevity.

@erikh
Copy link
Contributor

erikh commented Mar 24, 2013

So, I'm pretty sure I solved this dealing with a separate issue in chef-workflow -- you can tell Net::SSH to request a pty, which I had to do for sudo in certain cases.

Here's the relevant code, working great for my needs over there: https://github.com/chef-workflow/chef-workflow/blob/master/lib/chef-workflow/support/ssh.rb#L47-L51

Worth a shot at least.

@fnichol
Copy link
Owner

fnichol commented Sep 12, 2014

I had another look at this issue and while requesting a pty does help resolve these kinds of issues, it looks our particular error happens at least one further fork-and-exec down (by way of net-ssh running a knife command which is then using sudo).

As a less than ideal resolution, I have redirected this warning (on stderr) to a temporary logfile in f6145bf and made the plugins die whenever a non-zero exit code is thrown from any remote SSH command by default in 2123b64.

It is my hope that by removing the innocuous warning, keeping track of it (just in case) and dying at the first sign of trouble will keep us honest enough here.

Thank you all!

@fnichol fnichol closed this as completed Sep 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants