Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-60208

oc mirror shows no output in the console when executed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • 4.18.z, 4.19.z
    • oc-mirror
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      After installing oc and oc mirror, running oc mirror shows no output in the console and the command fails.
      This happens when the /tmp directory is mounted with the noexec option.

      $ oc-mirror version --output yaml --v2
      (no output)
      

      This is because oc-mirror copies itself to a path like /tmp/oc-mirror-<random numbers>/oc-mirror and tries to run it from there.
      If /tmp is mounted as noexec, it cannot run the copied binary.

      482189 execve("/tmp/oc-mirror-XXXXXXXXXXXX/oc-mirror", ["oc-mirror", "version", "--output", "yaml", "--v2"], 0xc000a8a0e0 /* 27 vars */ <unfinished ...>
      482171 nanosleep({tv_sec=0, tv_nsec=20000}, NULL) = 0
      482171 nanosleep({tv_sec=0, tv_nsec=20000},  <unfinished ...>
      482189 <... execve resumed>)            = -1 EACCES (Permission denied)
      

      To work around this, it is possible to set the TMPDIR environment variable to a directory that is not mounted with noexec.

      mkdir -p "$HOME/tmp_exec"
      export TMPDIR="$HOME/tmp_exec"
      

      According to the link below, mounting /tmp with noexec is a recommended security setting, so it is not uncommon for users to configure it this way:

      https://www.tenable.com/audits/items/DISA_STIG_Red_Hat_Enterprise_Linux_9_v2r4.audit:0a7fa4567a3e024255a57e75ce36b0c6

      So, it would be helpful if oc-mirror could detect this case and show a clear message in the console when it fails to run due to noexec on the target directory.

              luzuccar@redhat.com Luigi Mario Zuccarelli
              rhn-support-mmatsuta Masafumi Matsuta
              None
              None
              Nidan Gavali Nidan Gavali
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: