"'Connection' object has no attribute 'shell'" when attempting to establish an accelerated connection

224 views
Skip to first unread message

David Karnowski

unread,
Jul 15, 2014, 10:54:38 AM7/15/14
to ansible...@googlegroups.com
I received the below error when trying to run a playbook.

I'm running your latest dev Ansible pulled from github (1.7).

I'm new to Ansible and am setting it up on my PC for the first time, although we have it running elsewhere in our organization and am playing with their existing playbooks.

Here's the change (hack) I put in your code to work around the issue:

> diff ./build/lib.linux-x86_64-2.7/ansible/runner/connection_plugins/accelerate.py /usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection_plugins/accelerate.py
103a104,105
>         if not getattr(self.ssh, 'shell', None):
>             self.ssh.shell = utils.plugins.shell_loader.get('sh')

It's probably not the best solution to the problem, but FYI.

thanks,
David


> ansible-playbook reports.yml -vvvv --check --user=root --connection=ssh

PLAY
[lab2] *******************************************************************

GATHERING FACTS
***************************************************************
attempting connection to
172.16.8.191 via the accelerated port 5099
connection to
172.16.8.191 failed, retrying...
connection to
172.16.8.191 failed, retrying...
connection to
172.16.8.191 failed, retrying...
Could not connect via the accelerated connection, exceeded # of tries
Falling back to ssh to startup accelerated mode
attempting to start up the accelerate daemon
...
<172.16.8.191> ESTABLISH CONNECTION FOR USER: root
fatal
: [172.16.8.191] => Traceback (most recent call last):
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", line 528, in _executor                                                                                  
    exec_rc
= self._executor_internal(host, new_stdin)                                              
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", line 630, in _executor_internal                                                                        
   
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)                                                                              
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", line 801, in _executor_internal_inner                                                                  
    conn
= self.connector.connect(actual_host, actual_port, actual_user, actual_pass, actual_transport, actual_private_key_file)                                                                          
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection.py", line 34, in connect                                                                                  
   
self.active = conn.connect()                                                                    
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection_plugins/accelerate.py", line 146, in connect                                                              
    res
= self._execute_accelerate_module()                                                          
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/connection_plugins/accelerate.py", line 104, in _execute_accelerate_module                                            
    tmp_path
= self.runner._make_tmp_path(self.ssh)                                                  
 
File "/usr/local/lib/python2.7/dist-packages/ansible-1.7-py2.7.egg/ansible/runner/__init__.py", line 1036, in _make_tmp_path                                                                            
    cmd
= conn.shell.mkdtemp(basefile, use_system_tmp, tmp_mode)                                    
AttributeError: 'Connection' object has no attribute 'shell'




Bryan Beaudreault

unread,
Aug 26, 2014, 7:05:59 PM8/26/14
to ansible...@googlegroups.com
Seeing this same issue.  Is there a better fix?

Michael DeHaan

unread,
Aug 26, 2014, 7:17:07 PM8/26/14
to ansible...@googlegroups.com
Haven't heard any reports of this - apologies on not having a reply to the July 15th thread, must have missed it.

Can you please share what you do on a clean VM to replicate the issue and the output of 'ansible --version' ?

I am hoping "PC" does not mean Windows host, as we definitely only support managing Windows nodes, not running Ansible from Windows pythons.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b81d8d17-2f13-4e07-afc2-c587ead8a76f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Ed Hein

unread,
Aug 28, 2014, 3:52:54 AM8/28/14
to ansible...@googlegroups.com
Hi,

I've just encountered the same issue. Ansible 1.7.1 from Debian Testing Repository. OP proposed fix helps.

I can reproduce it with this playbook:
- hosts: testsetup
  accelerate: yes
  accelerate_port: 4711
  tasks:
    - command: /bin/ls

Cya, Ed

Michael DeHaan

unread,
Aug 28, 2014, 7:59:08 AM8/28/14
to ansible...@googlegroups.com
Ok, I'll file a bug on this now so it can be fixed for later.  

Thanks!




Michael DeHaan

unread,
Aug 28, 2014, 5:03:52 PM8/28/14
to ansible...@googlegroups.com
This was addressed on the devel branch today, and will be a part of a future 1.7.2 update which we'll do soon.

Thanks!


Reply all
Reply to author
Forward
0 new messages