title: Unable to find user root: no matching entries in passwd file in Docker
body: <p>I have containers for multiple Atlassian products; <code>JIRA</code>, <code>Bitbucket</code> and <code>Confluence</code>. When I'm trying to access the running containers I'm usually using:</p>
  
  <pre><code>docker exec -it -u root ${DOCKER_CONTAINER} bash
  </code></pre>
  
  <p>With this command I'm able to access as usual, but after running a script to extract and compress log files, I can't access that one container anymore. </p>
  
  <h2>Excerpt from the 'clean up script'</h2>
  
  <p>This is the first point of failure, and the script is running once each week (scheduled by Jenkins). </p>
  
  <pre><code>docker cp ${CLEAN_UP_SCRIPT} ${DOCKER_CONTAINER}:/tmp/${CLEAN_UP_SCRIPT}
  if [ $? -eq 0 ]; then
    docker exec -it -u root ${DOCKER_CONTAINER} bash -c "cd ${LOG_DIR} &amp;&amp; /tmp/compressOldLogs.sh ${ARCHIVE_FILE}"
  fi
  </code></pre>
  
  <p>When the script executes these two lines towards the Bitbucket container the result is:</p>
  
  <pre><code>unable to find user root: no matching entries in passwd file
  </code></pre>
  
  <p>It's failing on the 'docker cp'-command, but only towards the Bitbucket container. After the script has ran, the container is unaccessible with both the 'bitbucket' (defined in Dockerfile) and 'root' users. </p>
  
  <p>I was able to copy <code>/etc/passwd</code> out of the container, and it contains all of the users as expected. When trying to access by uid, I get the following error:</p>
  
  <pre><code>rpc error: code = 2 desc = oci runtime error: exec failed: process_linux.go:75: starting setns process caused "fork/exec /proc/self/exe: no such file or directory"
  </code></pre>
  
  <h2>Dockerfile for Bitbucket image:</h2>
  
  <pre><code>FROM                        java:openjdk-8-jre
  
  ENV BITBUCKET_HOME          /var/atlassian/application-data/bitbucket
  ENV BITBUCKET_INSTALL_DIR   /opt/atlassian/bitbucket
  ENV BITBUCKET_VERSION       4.12.0
  ENV DOWNLOAD_URL            https://downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-${BITBUCKET_VERSION}.tar.gz
  
  ARG user=bitbucket
  ARG group=bitbucket
  ARG uid=1000
  ARG gid=1000
  
  RUN mkdir -p $(dirname $BITBUCKET_HOME) \
      &amp;&amp; groupadd -g ${gid} ${group} \
      &amp;&amp; useradd -d "$BITBUCKET_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user}
  
  RUN mkdir -p                                ${BITBUCKET_HOME} \
      &amp;&amp; mkdir -p                             ${BITBUCKET_HOME}/shared \
      &amp;&amp; chmod -R 700                         ${BITBUCKET_HOME} \
      &amp;&amp; chown -R ${user}:${group}            ${BITBUCKET_HOME} \
      &amp;&amp; mkdir -p                             ${BITBUCKET_INSTALL_DIR}/conf/Catalina \
      &amp;&amp; curl -L --silent                     ${DOWNLOAD_URL} | tar -xz --strip=1 -C "$BITBUCKET_INSTALL_DIR" \
      &amp;&amp; chmod -R 700                         ${BITBUCKET_INSTALL_DIR}/ \
      &amp;&amp; chown -R ${user}:${group}            ${BITBUCKET_INSTALL_DIR}/
  
  ${BITBUCKET_INSTALL_DIR}/bin/setenv.sh
  
  USER        ${user}:${group}
  
  EXPOSE      7990
  EXPOSE      7999
  
  WORKDIR     $BITBUCKET_INSTALL_DIR
  CMD         ["bin/start-bitbucket.sh", "-fg"]
  </code></pre>
  
  <h2>Additional info:</h2>
  
  <ul>
  <li>Docker version 1.12.0, build 8eab29e</li>
  <li>docker-compose version 1.8.0, build f3628c7</li>
  <li>All containers are running at all times, even Bitbucket works as usual after the issue occurres</li>
  <li>The issue disappears after a restart of the container</li>
  </ul>