title: Bazel build fails with "Executing genrule @six_archive//:copy_six failed" error while building syntaxnet
body: <p>I'm trying to follow the instructions at <a href="https://github.com/tensorflow/models/tree/master/syntaxnet" rel="nofollow">syntaxnet's github page</a> to build syntaxnet parser models.</p>
  
  <p><strong>My system is a Debian Wheezy</strong>. Shouldn't be very different from Ubuntu 14.04 LTS or 15.05. I have compiled bazel 0.2.2 (as opposed to 0.2.2b) from source and it appears to work correctly.</p>
  
  <p>Whenever I launch the <code>bazel test syntaxnet/... util/utf8/...</code> command, no tests are executed (all skipped) with some quite cryptic error messages. Here's an example:</p>
  
  <pre><code>root@host:~/tensorflow_syntaxnet/models/syntaxnet# ../../bazel/output/bazel test syntaxnet/... util/utf8/...
  Extracting Bazel installation...
  .............
  INFO: Found 65 targets and 12 test targets...
  ERROR: /root/.cache/bazel/_bazel_root/74c6bab7a21f28ad02405b720243d086/external/six_archive/BUILD:1:1: Executing genrule @six_archive//:copy_six failed: namespace-sandbox failed: error executing command /root/.cache/bazel/_bazel_root/74c6bab7a21f28ad02405b720243d086/syntaxnet/_bin/namespace-sandbox ... (remaining 5 argument(s) skipped).
  unshare failed with EINVAL even after 101 tries, giving up.
  INFO: Elapsed time: 95.469s, Critical Path: 22.46s
  //syntaxnet:arc_standard_transitions_test                             NO STATUS
  //syntaxnet:beam_reader_ops_test                                      NO STATUS
  //syntaxnet:graph_builder_test                                        NO STATUS
  //syntaxnet:lexicon_builder_test                                      NO STATUS
  //syntaxnet:parser_features_test                                      NO STATUS
  //syntaxnet:parser_trainer_test                                       NO STATUS
  //syntaxnet:reader_ops_test                                           NO STATUS
  //syntaxnet:sentence_features_test                                    NO STATUS
  //syntaxnet:shared_store_test                                         NO STATUS
  //syntaxnet:tagger_transitions_test                                   NO STATUS
  //syntaxnet:text_formats_test                                         NO STATUS
  //util/utf8:unicodetext_unittest                                      NO STATUS
  
  Executed 0 out of 12 tests: 12 were skipped.
  </code></pre>
  
  <p>I'm using Oracle Java 8 JDK as recommended, and my compiler is:</p>
  
  <pre><code>~/tensorflow_syntaxnet/models/syntaxnet# gcc --version
  gcc (Debian 4.7.2-5) 4.7.2
  Copyright (C) 2012 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  </code></pre>
  
  <p>Tried looking into the <code>namespace-sandbox</code> binary that's mentioned in the error message, but before I dive deep into this, I thought I'd ask here.</p>
  
  <pre><code>~/tensorflow_syntaxnet/models/syntaxnet# ls -l /root/.cache/bazel/_bazel_root/74c6bab7a21f28ad02405b720243d086/syntaxnet/_bin/namespace-sandbox
  lrwxrwxrwx 1 root root 108 May 13 14:52 /root/.cache/bazel/_bazel_root/74c6bab7a21f28ad02405b720243d086/syntaxnet/_bin/namespace-sandbox -&gt; /root/.cache/bazel/_bazel_root/install/ca381eaad1c931167a6355cb8a2b98cf/_embedded_binaries/namespace-sandbox
  ~/tensorflow_syntaxnet/models/syntaxnet# readlink /root/.cache/bazel/_bazel_root/74c6bab7a21f28ad02405b720243d086/syntaxnet/_bin/namespace-sandbox
  /root/.cache/bazel/_bazel_root/install/ca381eaad1c931167a6355cb8a2b98cf/_embedded_binaries/namespace-sandbox
  </code></pre>
  
  <p>Command seems to work fine though:</p>
  
  <pre><code>~/tensorflow_syntaxnet/models/syntaxnet# file $(readlink /root/.cache/bazel/_bazel_root/74c6bab7a21f28ad02405b720243d086/syntaxnet/_bin/namespace-sandbox)
  /root/.cache/bazel/_bazel_root/install/ca381eaad1c931167a6355cb8a2b98cf/_embedded_binaries/namespace-sandbox: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[md5/uuid]=0xecfd97b6a6b9a193b045be13654bd55b, not stripped
  ~/tensorflow_syntaxnet/models/syntaxnet# /root/.cache/bazel/_bazel_root/install/ca381eaad1c931167a6355cb8a2b98cf/_embedded_binaries/namespace-sandbox
  No command specified.
  Usage: /root/.cache/bazel/_bazel_root/install/ca381eaad1c931167a6355cb8a2b98cf/_embedded_binaries/namespace-sandbox [-S sandbox-root] -- command arg1
    provided: /root/.cache/bazel/_bazel_root/install/ca381eaad1c931167a6355cb8a2b98cf/_embedded_binaries/namespace-sandbox
  Mandatory arguments:
    -S &lt;sandbox-root&gt;  directory which will become the root of the sandbox
    --  command to run inside sandbox, followed by arguments
  
  Optional arguments:
    -W &lt;working-dir&gt;  working directory
    -T &lt;timeout&gt;  timeout after which the child process will be terminated with SIGTERM
    -t &lt;timeout&gt;  in case timeout occurs, how long to wait before killing the child with SIGKILL
    -d &lt;dir&gt;  create an empty directory in the sandbox
    -M/-m &lt;source/target&gt;  system directory to mount inside the sandbox
      Multiple directories can be specified and each of them will be mounted readonly.
      The -M option specifies which directory to mount, the -m option specifies where to
      mount it in the sandbox.
    -n if set, a new network namespace will be created
    -r if set, make the uid/gid be root, otherwise use nobody
    -D  if set, debug info will be printed
    -l &lt;file&gt;  redirect stdout to a file
    -L &lt;file&gt;  redirect stderr to a file
    @FILE read newline-separated arguments from FILE
  </code></pre>
  
  <p>Any idea?</p>
  
  <p><strong>UPDATE</strong>: I have done exactly the same steps on a Ubuntu 14.04 LTS (my small workstation, as opposed to the production server running Debian) and everything works well there, with all tests passing. I wonder what's the difference.</p>