<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto"><code class="notranslate">fetch</code> module</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.2.0 (detached HEAD c7052b42c7) last updated 2017/08/06 09:06:45 (GMT +300)
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]"><pre class="notranslate"><code class="notranslate">ansible 2.3.2.0 (detached HEAD c7052b42c7) last updated 2017/08/06 09:06:45 (GMT +300)
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">ansible is running from Ubuntu 16.04 and manages various debian jessie hosts.</p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto"><code class="notranslate">fetch</code> can't properly handle authentication failure for some reason.<br>
Seems to be duplicate of closed <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="168373991" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible/issues/16877" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible/issues/16877/hovercard" href="https://github.com/ansible/ansible/issues/16877">#16877</a></p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">NB: <code class="notranslate">gather_facts: false</code> matters.</p>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- hosts: all
  gather_facts: false
  tasks:
    - name: mktemp
      command: mktemp -td boot_id.XXXXXXXX
      register: tmp
      run_once: true
      delegate_to: localhost
    - name: fetch kernel/random/boot_id
      fetch: src=/proc/sys/kernel/random/boot_id dest={{tmp.stdout}}/{{inventory_hostname}} flat=yes fail_on_missing=yes"><pre class="notranslate">- <span class="pl-ent">hosts</span>: <span class="pl-s">all</span>
  <span class="pl-ent">gather_facts</span>: <span class="pl-c1">false</span>
  <span class="pl-ent">tasks</span>:
    - <span class="pl-ent">name</span>: <span class="pl-s">mktemp</span>
      <span class="pl-ent">command</span>: <span class="pl-s">mktemp -td boot_id.XXXXXXXX</span>
      <span class="pl-ent">register</span>: <span class="pl-s">tmp</span>
      <span class="pl-ent">run_once</span>: <span class="pl-c1">true</span>
      <span class="pl-ent">delegate_to</span>: <span class="pl-s">localhost</span>
    - <span class="pl-ent">name</span>: <span class="pl-s">fetch kernel/random/boot_id</span>
      <span class="pl-ent">fetch</span>: <span class="pl-s">src=/proc/sys/kernel/random/boot_id dest={{tmp.stdout}}/{{inventory_hostname}} flat=yes fail_on_missing=yes</span></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">I expected the host to report some sort of failure as with <code class="notranslate">ping</code> module:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible -m ping ooni-fdroid-build.infra.ooni.io
ooni-fdroid-build.infra.ooni.io | UNREACHABLE! =&gt; {
    &quot;changed&quot;: false, 
    &quot;msg&quot;: &quot;SSH Error: data could not be sent to remote host \&quot;ooni-fdroid-build.infra.ooni.io\&quot;. Make sure this host can be reached over ssh&quot;, 
    &quot;unreachable&quot;: true
}"><pre class="notranslate"><code class="notranslate">$ ansible -m ping ooni-fdroid-build.infra.ooni.io
ooni-fdroid-build.infra.ooni.io | UNREACHABLE! =&gt; {
    "changed": false, 
    "msg": "SSH Error: data could not be sent to remote host \"ooni-fdroid-build.infra.ooni.io\". Make sure this host can be reached over ssh", 
    "unreachable": true
}
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [fetch kernel/random/boot_id] *************************************************************************************************************************************************************************
task path: /home/darkk/oo/sysadmin/ansible/check-inventory.yml:16
Using module file /home/darkk/contrib-src/ansible/lib/ansible/modules/files/stat.py
&lt;ooni-fdroid-build.infra.ooni.io&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;ooni-fdroid-build.infra.ooni.io&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/darkk/.ansible/cp/7735c2afbf ooni-fdroid-build.infra.ooni.io '/bin/sh -c '&quot;'&quot;'/usr/bin/python &amp;&amp; sleep 0'&quot;'&quot;''
ok: [ooni-fdroid-build.infra.ooni.io] =&gt; {
    &quot;changed&quot;: false, 
    &quot;file&quot;: &quot;/proc/sys/kernel/random/boot_id&quot;, 
    &quot;msg&quot;: &quot;unable to calculate the checksum of the remote file&quot;
}"><pre class="notranslate"><code class="notranslate">TASK [fetch kernel/random/boot_id] *************************************************************************************************************************************************************************
task path: /home/darkk/oo/sysadmin/ansible/check-inventory.yml:16
Using module file /home/darkk/contrib-src/ansible/lib/ansible/modules/files/stat.py
&lt;ooni-fdroid-build.infra.ooni.io&gt; ESTABLISH SSH CONNECTION FOR USER: None
&lt;ooni-fdroid-build.infra.ooni.io&gt; SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/darkk/.ansible/cp/7735c2afbf ooni-fdroid-build.infra.ooni.io '/bin/sh -c '"'"'/usr/bin/python &amp;&amp; sleep 0'"'"''
ok: [ooni-fdroid-build.infra.ooni.io] =&gt; {
    "changed": false, 
    "file": "/proc/sys/kernel/random/boot_id", 
    "msg": "unable to calculate the checksum of the remote file"
}
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.1.0
  config file = 
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.1.0
  config file = 
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ubuntu 14.04<br>
Docker version 1.10.3, build 20f81dd (also tried version 1.11.0 with same error)<br>
Docker-Py version 1.8.0</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">I get the error "cannot unmarshal array into Go value" when I try to launch a docker container with volumes attached to it. The error only occurs when I specify a mounting point.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Just run <code class="notranslate">ansible-playbook test2.yml</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: dl2
  tasks:
  - name: Launch ubuntu
    docker:
      state: started
      image: ubuntu
      command: sleep 1d
      volumes:
        - &quot;/tmp:/inbox&quot;"><pre class="notranslate"><code class="notranslate">
---
- hosts: dl2
  tasks:
  - name: Launch ubuntu
    docker:
      state: started
      image: ubuntu
      command: sleep 1d
      volumes:
        - "/tmp:/inbox"
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>

<h5 dir="auto">ACTUAL RESULTS</h5>
<h6 dir="auto">short version of output</h6>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [dl2] *********************************************************************

TASK [setup] *******************************************************************
ok: [dl2]

TASK [Launch ubuntu] ***********************************************************
fatal: [dl2]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;Docker API Error: json: cannot unmarshal array into Go value of type string&quot;}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @test2.retry

PLAY RECAP *********************************************************************
dl2                        : ok=1    changed=0    unreachable=0    failed=1   
"><pre class="notranslate"><code class="notranslate">PLAY [dl2] *********************************************************************

TASK [setup] *******************************************************************
ok: [dl2]

TASK [Launch ubuntu] ***********************************************************
fatal: [dl2]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "Docker API Error: json: cannot unmarshal array into Go value of type string"}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @test2.retry

PLAY RECAP *********************************************************************
dl2                        : ok=1    changed=0    unreachable=0    failed=1   

</code></pre></div>
<h6 dir="auto">verbose version of output</h6>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="No config file found; using defaults
Loaded callback default of type stdout, v2.0

PLAYBOOK: test2.yml ************************************************************
1 plays in test2.yml

PLAY [dl2] *********************************************************************

TASK [setup] *******************************************************************
&lt;dl2&gt; ESTABLISH LOCAL CONNECTION FOR USER: daniel
&lt;dl2&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461 `&quot; &amp;&amp; echo &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461 `&quot; )'
&lt;dl2&gt; PUT /tmp/tmpg0NEE7 TO /home/daniel/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461/setup
&lt;dl2&gt; EXEC /bin/sh -c 'LANG=en_US LC_ALL=en_US LC_MESSAGES=en_US /usr/bin/python /home/daniel/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461/setup; rm -rf &quot;/home/daniel/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461/&quot; &gt; /dev/null 2&gt;&amp;1'
ok: [dl2]

TASK [Launch ubuntu] ***********************************************************
task path: .../test2.yml:4
&lt;dl2&gt; ESTABLISH LOCAL CONNECTION FOR USER: daniel
&lt;dl2&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048 `&quot; &amp;&amp; echo &quot;` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048 `&quot; )'
&lt;dl2&gt; PUT /tmp/tmpX_tBFI TO /home/daniel/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048/docker
&lt;dl2&gt; EXEC /bin/sh -c 'LANG=en_US LC_ALL=en_US LC_MESSAGES=en_US /usr/bin/python /home/daniel/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048/docker; rm -rf &quot;/home/daniel/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048/&quot; &gt; /dev/null 2&gt;&amp;1'
fatal: [dl2]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;invocation&quot;: {&quot;module_args&quot;: {&quot;cap_add&quot;: null, &quot;cap_drop&quot;: null, &quot;command&quot;: &quot;sleep 1d&quot;, &quot;count&quot;: 1, &quot;cpu_set&quot;: null, &quot;cpu_shares&quot;: 0, &quot;debug&quot;: false, &quot;detach&quot;: true, &quot;devices&quot;: null, &quot;dns&quot;: null, &quot;docker_api_version&quot;: &quot;1.22&quot;, &quot;docker_url&quot;: null, &quot;docker_user&quot;: null, &quot;domainname&quot;: null, &quot;email&quot;: null, &quot;entrypoint&quot;: null, &quot;env&quot;: null, &quot;env_file&quot;: null, &quot;expose&quot;: null, &quot;extra_hosts&quot;: null, &quot;hostname&quot;: null, &quot;image&quot;: &quot;ubuntu&quot;, &quot;insecure_registry&quot;: false, &quot;labels&quot;: {}, &quot;links&quot;: null, &quot;log_driver&quot;: null, &quot;log_opt&quot;: null, &quot;lxc_conf&quot;: null, &quot;memory_limit&quot;: &quot;0&quot;, &quot;memory_swap&quot;: &quot;0&quot;, &quot;name&quot;: null, &quot;net&quot;: null, &quot;password&quot;: null, &quot;pid&quot;: null, &quot;ports&quot;: null, &quot;privileged&quot;: false, &quot;publish_all_ports&quot;: false, &quot;pull&quot;: &quot;missing&quot;, &quot;read_only&quot;: null, &quot;registry&quot;: null, &quot;restart_policy&quot;: null, &quot;restart_policy_retry&quot;: 0, &quot;signal&quot;: null, &quot;state&quot;: &quot;started&quot;, &quot;stdin_open&quot;: false, &quot;stop_timeout&quot;: 10, &quot;timeout&quot;: 60, &quot;tls_ca_cert&quot;: null, &quot;tls_client_cert&quot;: null, &quot;tls_client_key&quot;: null, &quot;tls_hostname&quot;: null, &quot;tty&quot;: false, &quot;ulimits&quot;: null, &quot;use_tls&quot;: null, &quot;username&quot;: null, &quot;volumes&quot;: [&quot;/tmp:/inbox&quot;], &quot;volumes_from&quot;: null}, &quot;module_name&quot;: &quot;docker&quot;}, &quot;msg&quot;: &quot;Docker API Error: json: cannot unmarshal array into Go value of type string&quot;}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @test2.retry

PLAY RECAP *********************************************************************
dl2                        : ok=1    changed=0    unreachable=0    failed=1   "><pre class="notranslate"><code class="notranslate">No config file found; using defaults
Loaded callback default of type stdout, v2.0

PLAYBOOK: test2.yml ************************************************************
1 plays in test2.yml

PLAY [dl2] *********************************************************************

TASK [setup] *******************************************************************
&lt;dl2&gt; ESTABLISH LOCAL CONNECTION FOR USER: daniel
&lt;dl2&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461 `" )'
&lt;dl2&gt; PUT /tmp/tmpg0NEE7 TO /home/daniel/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461/setup
&lt;dl2&gt; EXEC /bin/sh -c 'LANG=en_US LC_ALL=en_US LC_MESSAGES=en_US /usr/bin/python /home/daniel/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461/setup; rm -rf "/home/daniel/.ansible/tmp/ansible-tmp-1461163032.16-7353653514461/" &gt; /dev/null 2&gt;&amp;1'
ok: [dl2]

TASK [Launch ubuntu] ***********************************************************
task path: .../test2.yml:4
&lt;dl2&gt; ESTABLISH LOCAL CONNECTION FOR USER: daniel
&lt;dl2&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048 `" &amp;&amp; echo "` echo $HOME/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048 `" )'
&lt;dl2&gt; PUT /tmp/tmpX_tBFI TO /home/daniel/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048/docker
&lt;dl2&gt; EXEC /bin/sh -c 'LANG=en_US LC_ALL=en_US LC_MESSAGES=en_US /usr/bin/python /home/daniel/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048/docker; rm -rf "/home/daniel/.ansible/tmp/ansible-tmp-1461163032.75-245772432711048/" &gt; /dev/null 2&gt;&amp;1'
fatal: [dl2]: FAILED! =&gt; {"changed": false, "failed": true, "invocation": {"module_args": {"cap_add": null, "cap_drop": null, "command": "sleep 1d", "count": 1, "cpu_set": null, "cpu_shares": 0, "debug": false, "detach": true, "devices": null, "dns": null, "docker_api_version": "1.22", "docker_url": null, "docker_user": null, "domainname": null, "email": null, "entrypoint": null, "env": null, "env_file": null, "expose": null, "extra_hosts": null, "hostname": null, "image": "ubuntu", "insecure_registry": false, "labels": {}, "links": null, "log_driver": null, "log_opt": null, "lxc_conf": null, "memory_limit": "0", "memory_swap": "0", "name": null, "net": null, "password": null, "pid": null, "ports": null, "privileged": false, "publish_all_ports": false, "pull": "missing", "read_only": null, "registry": null, "restart_policy": null, "restart_policy_retry": 0, "signal": null, "state": "started", "stdin_open": false, "stop_timeout": 10, "timeout": 60, "tls_ca_cert": null, "tls_client_cert": null, "tls_client_key": null, "tls_hostname": null, "tty": false, "ulimits": null, "use_tls": null, "username": null, "volumes": ["/tmp:/inbox"], "volumes_from": null}, "module_name": "docker"}, "msg": "Docker API Error: json: cannot unmarshal array into Go value of type string"}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @test2.retry

PLAY RECAP *********************************************************************
dl2                        : ok=1    changed=0    unreachable=0    failed=1   
</code></pre></div>