Failed to connect to the host via ssh: command-line line 0: garbage at end of line;

3,285 views
Skip to first unread message

Laurent Goussard

unread,
Oct 19, 2017, 4:42:19 AM10/19/17
to Ansible Project
Hello,

I tried to fill in a bug report, but it seems it's more a question than a bug :

Since I've added a business dropbox to my existing personnal dropbox, ansible cannot read my symlinked inventory file anymore and always return an error :

    "msg": "Failed to connect to the host via ssh: command-line line 0: garbage at end of line; \"(Personnelle)/OSX/mackup/.ansible/cp/eead3d7599\".\r\n", 

What did happen ?
How can I get rid of this issue ?

Zimidar Boy

unread,
Oct 19, 2017, 11:11:53 AM10/19/17
to Ansible Project
Can you please paste your code then it makes more sense.

Zimidar Boy

unread,
Oct 19, 2017, 11:17:58 AM10/19/17
to Ansible Project
According to its something with  paths that are passed on without proper escaping or quoting,

Laurent Goussard

unread,
Oct 19, 2017, 11:18:14 AM10/19/17
to Ansible Project
Sure ! That's why I was linking the bug report, but here is the command I use :

ansible chaos -m ping


And here is the error I get back :

ansible 2.4.0.0
  config file
= /Users/loranger/.ansible.cfg
  configured
module search path = [u'/Users/loranger/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python
module location = /usr/local/Cellar/ansible/2.4.0.0/libexec/lib/python2.7/site-packages/ansible
  executable location
= /usr/local/bin/ansible
  python version
= 2.7.14 (default, Sep 25 2017, 09:54:19) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]
Using /Users/loranger/.ansible.cfg as config file
setting up inventory plugins
Parsed /Users/loranger/.ansible/hosts/composer inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/dujour.conf inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/hosts inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/northern.conf inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/perso.conf inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/phoenix.disable inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/puccia.conf inventory source with ini plugin
Parsed /Users/loranger/.ansible/hosts/raspberry.conf inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/local/Cellar/ansible/2.4.0.0/libexec/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc
META
: ran handlers
Using module file /usr/local/Cellar/ansible/2.4.0.0/libexec/lib/python2.7/site-packages/ansible/modules/system/ping.py
<chaos> ESTABLISH SSH CONNECTION FOR USER: None
<chaos> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 'ControlPath=/Users/loranger/Dropbox (Personnelle)/OSX/mackup/.ansible/cp/eead3d7599' chaos '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1508359150.0-45696358822537 `" && echo ansible-tmp-1508359150.0-45696358822537="` echo $HOME/.ansible/tmp/ansible-tmp-1508359150.0-45696358822537 `" ) && sleep 0'"'"''
<chaos> (255, '', 'command-line line 0: garbage at end of line; "(Personnelle)/OSX/mackup/.ansible/cp/eead3d7599".\r\n')
chaos
| UNREACHABLE! => {
   
"changed": false,
   
"msg": "Failed to connect to the host via ssh: command-line line 0: garbage at end of line; \"(Personnelle)/OSX/mackup/.ansible/cp/eead3d7599\".\r\n",
   
"unreachable": true
}

I hope it could help, thanks !

Zimidar Boy

unread,
Oct 19, 2017, 11:46:22 AM10/19/17
to Ansible Project
As per my understanding ControlPath=/Users/loranger/Dropbox   (Personnelle)/OSX/mackup/.ansible/cp/eead3d7599' the space between dropbox and   (Personnelle) is giving you error.  set up a symlink or path with no spaces. Is that make any sense.


On Thursday, October 19, 2017 at 4:42:19 AM UTC-4, Laurent Goussard wrote:

Laurent Goussard

unread,
Oct 25, 2017, 4:14:30 AM10/25/17
to Ansible Project
Thank you for your reply.

I too believe the issue comes from this space, but I didn't manage anything :

Adding a business dropbox created the new dropbox, moved the existing one to its new name and symlinked it to the old existing path :
lrwxr-xr-x    1 loranger  staff      37 16 oct 09:30 Dropbox -> /Users/loranger/Dropbox (Personnelle)
drwx
------@  21 loranger  staff     672 18 oct 18:28 Dropbox (DuJour)
drwx
------@  34 loranger  staff    1088 18 oct 09:43 Dropbox (Personnelle)
d

I'm not sure what I can do here, and why the space seems to be unescaped as it should be

ls -la .ansible
lrwxr
-xr-x  1 loranger  staff  43 12 mai 11:06 .ansible -> /Users/loranger/Dropbox/OSX/mackup/.ansible


Werner Flamme

unread,
Oct 25, 2017, 4:36:11 AM10/25/17
to ansible...@googlegroups.com
Laurent Goussard [25.10.2017 10:14]:
> Thank you for your reply.
>
> I too believe the issue comes from this space, but I didn't manage anything
> :
>
> Adding a business dropbox created the new dropbox, moved the existing one
> to its new name and symlinked it to the old existing path :
> lrwxr-xr-x 1 loranger staff 37 16 oct 09:30 Dropbox -> /Users/
> loranger/Dropbox (Personnelle)
> drwx------@ 21 loranger staff 672 18 oct 18:28 Dropbox (DuJour)
> drwx------@ 34 loranger staff 1088 18 oct 09:43 Dropbox (Personnelle)
> d
>
> I'm not sure what I can do here, and why the space seems to be unescaped as
> it should be
>
> ls -la .ansible
> lrwxr-xr-x 1 loranger staff 43 12 mai 11:06 .ansible -> /Users/loranger/
> Dropbox/OSX/mackup/.ansible


So, in your configuration you use ~/Dropbox, and ansible expands this
syslink to ~/"Dropbox (personelle)", for some reason without quoting it.

Is there any cance that you rename "Dropbox (personelle)" to something
like "Dropbox_(personelle)" or "Dropbox_personelle" to avoid spaces (and
parentheses)?

The best solution would be ansible using quotes with file paths, but to
get this you should open a bug with ansible and post your case as an
example why ;).

Werner

--


Laurent Goussard

unread,
Oct 25, 2017, 9:05:17 AM10/25/17
to Ansible Project
Thanks for you support

I tried to rename my folder, but each time Dropbox.app is started, it force-rename the dropboxes and breaks everything again.
I also tried to fill in a bug report, but my issue was closed as they consider it as a user question.

I'm stuck :/

Werner Flamme

unread,
Oct 25, 2017, 9:23:38 AM10/25/17
to ansible...@googlegroups.com
Laurent Goussard [25.10.2017 15:05]:
> Thanks for you support
>
> I tried to rename my folder, but each time Dropbox.app is started, it
> force-rename the dropboxes and breaks everything again.
> I also tried to fill in a bug report, but my issue was closed as they
> consider it as a user question.
>
> I'm stuck :/

Laurent,

I suggest you manually create a new folder, named like
Dropbox_personelle, and tell the dropbox instance that currently syncs
with "Dropbox (personelle)" to use Dropbox_personelle instead. This way,
you should have all content of "Dropbox (personelle)" at the new place,
too (after a short time). Later, you might delete it from "Dropbox
(personelle)" because that folder is no longer in use. Or you keep it as
a backup ;)

Do not forget to redirect the ~/Dropbox symlink to the new folder ;)

Werner
--


Laurent Goussard

unread,
Oct 25, 2017, 4:37:52 PM10/25/17
to Ansible Project
I could not figure out how to choose another folder from dropbox, so I quit the dropbox app, renamed the faulty dropbox folder to ~/Dropbox and created a symlink from ~/Dropbox (Personnelle) to ~/Dropbox

It's a crappy workaround, but it works.

Meanwhile I did open a new issue and tried to reach the Dropbox support regarding this problem.

Whereas it's definitely a Dropbox's fault to use such non-unix compliant pathes, I'm astonished I'm the only one with this kind of “space bug”

Thanks again for your help, Werner & Zimidar !

Werner Flamme

unread,
Oct 26, 2017, 3:28:57 AM10/26/17
to ansible...@googlegroups.com
Laurent,

yesterday, my Dropbox app did not want to work, today, it does.

When I left-click on the Dropbox icon and choose "Preferences...", there
is a tab "Sync". In the lower part of this tab there is "Dropbox
location", where I read "Choose a location for your Dropbox. A folder
named 'Dropbox' will be created inside the folder you choose." This
might be the point to choose another folder.

I'm not sure whether anyone alse uses Dropbox to store configuration
files. Usually, Ansible will be used from inside a company's intranet,
and so there are other possibilities to share files or to have them
available from multiple workplaces.

I'm glad you reached your goal, though just using a workaround, and that
my writing could be of any use.

Werner


Laurent Goussard [25.10.2017 22:37]:
> I could not figure out how to choose another folder from dropbox, so I quit
> the dropbox app, renamed the faulty dropbox folder to ~/Dropbox and created
> a symlink from ~/Dropbox (Personnelle) to ~/Dropbox
>
> It's a crappy workaround, but it works.
>
> Meanwhile I did open a new issue
> <https://github.com/ansible/ansible/issues/32166> and tried to reach the
--


Reply all
Reply to author
Forward
0 new messages