Actions
Bug #7585
closedceph-deploy should handle requiretty failures
% Done:
0%
Source:
Community (user)
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
This is unacceptable:
[ec2-user@ip-172-31-44-218 ~]$ cd my-cluster/ [ec2-user@ip-172-31-44-218 my-cluster]$ ceph-deploy -vvv new ip-172-31-44-219 [ceph_deploy.cli][INFO ] Invoked (1.3.5): /usr/bin/ceph-deploy -vvv new ip-172-31-44-219 [ceph_deploy.new][DEBUG ] Creating new cluster named ceph [ceph_deploy.new][DEBUG ] Resolving host ip-172-31-44-219 [ceph_deploy.new][DEBUG ] Monitor ip-172-31-44-219 at 172.31.44.219 [ceph_deploy.new][INFO ] making sure passwordless SSH succeeds [ip-172-31-44-219][DEBUG ] connected to host: ip-172-31-44-218 [ip-172-31-44-219][INFO ] Running command: ssh -CT -o BatchMode=yes ip-172-31-44-219 [ceph_deploy.new][WARNIN] could not connect via SSH [ceph_deploy.new][INFO ] creating a passwordless id_rsa.pub key file [ceph_deploy.new][DEBUG ] connected to host: ip-172-31-44-218 [ceph_deploy.new][INFO ] Running command: ssh-keygen -t rsa -N -f /home/ec2-user/.ssh/id_rsa [ceph_deploy.new][DEBUG ] Generating public/private rsa key pair. [ceph_deploy.new][DEBUG ] Your identification has been saved in /home/ec2-user/.ssh/id_rsa. [ceph_deploy.new][DEBUG ] Your public key has been saved in /home/ec2-user/.ssh/id_rsa.pub. [ceph_deploy.new][DEBUG ] The key fingerprint is: [ceph_deploy.new][DEBUG ] 70:3d:6c:9c:4d:8c:d1:55:de:ff:18:bd:52:76:91:2a ec2-user@ip-172-31-44-218 [ceph_deploy.new][DEBUG ] The key's randomart image is: [ceph_deploy.new][DEBUG ] +--[ RSA 2048]----+ [ceph_deploy.new][DEBUG ] | .=.....| [ceph_deploy.new][DEBUG ] | +.+o .o| [ceph_deploy.new][DEBUG ] | . . B . oo| [ceph_deploy.new][DEBUG ] | o . . ..o| [ceph_deploy.new][DEBUG ] | S E ..o+| [ceph_deploy.new][DEBUG ] | . oo+| [ceph_deploy.new][DEBUG ] | ....| [ceph_deploy.new][DEBUG ] | . | [ceph_deploy.new][DEBUG ] | | [ceph_deploy.new][DEBUG ] +-----------------+ [ceph_deploy.new][INFO ] will connect again with password prompt sudo: sorry, you must have a tty to run sudo [ip-172-31-44-219][DEBUG ] connected to host: ip-172-31-44-219 Traceback (most recent call last): File "/usr/bin/ceph-deploy", line 21, in <module> sys.exit(main()) File "/usr/lib/python2.6/site-packages/ceph_deploy/util/decorators.py", line 62, in newfunc return f(*a, **kw) File "/usr/lib/python2.6/site-packages/ceph_deploy/cli.py", line 133, in main return args.func(args) File "/usr/lib/python2.6/site-packages/ceph_deploy/new.py", line 115, in new ssh_copy_keys(host, args.username) File "/usr/lib/python2.6/site-packages/ceph_deploy/new.py", line 79, in ssh_copy_keys distro = hosts.get(hostname, username) # XXX Add username File "/usr/lib/python2.6/site-packages/ceph_deploy/hosts/__init__.py", line 37, in get conn.import_module(remotes) File "/usr/lib/python2.6/site-packages/ceph_deploy/lib/remoto/connection.py", line 47, in import_module self.remote_module = ModuleExecute(self.gateway, module, self.logger) File "/usr/lib/python2.6/site-packages/ceph_deploy/lib/remoto/connection.py", line 53, in __init__ self.channel = gateway.remote_exec(module) File "/usr/lib/python2.6/site-packages/ceph_deploy/lib/remoto/lib/execnet/gateway.py", line 120, in remote_exec gateway_base.dumps_internal((source, call_name, kwargs))) File "/usr/lib/python2.6/site-packages/ceph_deploy/lib/remoto/lib/execnet/gateway_base.py", line 952, in _send raise IOError("cannot send (already closed?)") IOError: cannot send (already closed?) [ec2-user@ip-172-31-44-218 my-cluster]$
Updated by Alfredo Deza about 10 years ago
To replicate the issue, in `/etc/sudoers` the following needs to be present:
Defaults requiretty
A lot of distro's have this disabled by default. Here is another look at the output after enabling it:
ceph-deploy new node2 [ceph_deploy.cli][INFO ] Invoked (1.3.5): /Users/alfredo/.virtualenvs/ceph-deploy/bin/ceph-deploy new node2 [ceph_deploy.new][DEBUG ] Creating new cluster named ceph [ceph_deploy.new][DEBUG ] Resolving host node2 [ceph_deploy.new][DEBUG ] Monitor node2 at 192.168.111.101 [ceph_deploy.new][INFO ] making sure passwordless SSH succeeds [node2][DEBUG ] connected to host: papaya.local [node2][INFO ] Running command: ssh -CT -o BatchMode=yes node2 [ceph_deploy.new][WARNIN] could not connect via SSH [ceph_deploy.new][INFO ] will connect again with password prompt vagrant@192.168.111.101's password: sudo: sorry, you must have a tty to run sudo [node2][DEBUG ] connected to host: node2 Traceback (most recent call last): File "/Users/alfredo/.virtualenvs/ceph-deploy/bin/ceph-deploy", line 8, in <module> load_entry_point('ceph-deploy==1.3.5', 'console_scripts', 'ceph-deploy')() File "/Users/alfredo/python/ceph-deploy/ceph_deploy/util/decorators.py", line 62, in newfunc return f(*a, **kw) File "/Users/alfredo/python/ceph-deploy/ceph_deploy/cli.py", line 136, in main return args.func(args) File "/Users/alfredo/python/ceph-deploy/ceph_deploy/new.py", line 95, in new ssh_copy_keys(host, args.username) File "/Users/alfredo/python/ceph-deploy/ceph_deploy/new.py", line 60, in ssh_copy_keys distro = hosts.get(hostname, username) # XXX Add username File "/Users/alfredo/python/ceph-deploy/ceph_deploy/hosts/__init__.py", line 37, in get conn.import_module(remotes) File "/Users/alfredo/python/ceph-deploy/ceph_deploy/lib/remoto/connection.py", line 47, in import_module self.remote_module = ModuleExecute(self.gateway, module, self.logger) File "/Users/alfredo/python/ceph-deploy/ceph_deploy/lib/remoto/connection.py", line 53, in __init__ self.channel = gateway.remote_exec(module) File "/Users/alfredo/python/ceph-deploy/ceph_deploy/lib/remoto/lib/execnet/gateway.py", line 117, in remote_exec channel = self.newchannel() File "/Users/alfredo/python/ceph-deploy/ceph_deploy/lib/remoto/lib/execnet/gateway_base.py", line 967, in newchannel return self._channelfactory.new() File "/Users/alfredo/python/ceph-deploy/ceph_deploy/lib/remoto/lib/execnet/gateway_base.py", line 743, in new raise IOError("connexion already closed: %s" % (self.gateway,)) IOError: connexion already closed: <Gateway id='gw1' not-receiving, thread model, 0 active channels>
Updated by Alfredo Deza about 10 years ago
- Status changed from New to In Progress
Updated by Alfredo Deza about 10 years ago
- Status changed from In Progress to Resolved
Pull request opened https://github.com/ceph/ceph-deploy/pull/171
And merged into ceph-deploy's master branch with hash: 1a66615
Actions