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

Mac OS X: ansible task that tests ssh_connection after deployment fails with time out after 600s #1833

Closed
AdityaSantoso opened this issue Jul 3, 2020 · 3 comments

Comments

@AdityaSantoso
Copy link

I got a timeout after waiting for 600s for the VM to be available

At the end of the execution, I received this error:

TASK [Wait 600 seconds for target connection to become reachable/usable] ***********
failed: [localhost -> 20.188.197.95] (item=20.188.197.95) => {"ansible_loop_var": "item", "changed": false, "elapsed": 777, "item": "20.188.197.95", "msg": "timed out waiting for ping module test success: Failed to connect to the host via ssh: command-line line 0: garbage at end of line; \"1/.ansible/cp/8f2f3ad237\"."}

To Reproduce

Steps to reproduce the behavior:

  1. Create a user with a space in its name, thereby making its home directory having space inside
  2. Run ./algo

Expected behavior

The deployment should happen successfully

Additional context

In general, it seems to happen as long as there is white space in the path of ANSIBLE_SSH_CONTROL_PATH_DIR, which is by default ~/.ansible/cp

@AdityaSantoso
Copy link
Author

To work around this issue, I had to add some entries in the ansible.cfg in the root:

Under [defaults]:
local_tmp = <some paths without space>

And [ssh_connection]:
control_path_dir = <another path without space>

@davidemyers
Copy link
Contributor

Do you mean you created a user with a space in config.cfg, or do you mean your macOS user name has a space in it? macOS Catalina will not allow me to create a user name with a space in it.

@AdityaSantoso
Copy link
Author

The latter. I am on Mac OS Mojave, but I suspect it might be a very narrow corner case, because this is what I did:

  • I created an admin user with full name e.g. John Doe. This will create a user with account name johndoe and home directory /Users/johndoe
  • I restored my Mac content from Time Machine, but there is already user John Doe in the Time Machine. So the OS created another user with the same full name John Doe and account name johndoe but with a home directory /Users/johndoe 1

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