title: How to get more information for an error generated in libcontainer/rootfs_linux.go?
body: <p>Code used from github: <a href="https://github.com/opencontainers/runc/blob/master/libcontainer/rootfs_linux.go#L59" rel="nofollow noreferrer">https://github.com/opencontainers/runc/blob/master/libcontainer/rootfs_linux.go#L59</a></p>
  <p>This is the if block to debug for our interest....</p>
  <pre><code>if err := mountToRootfs(m, config.Rootfs, config.MountLabel, hasCgroupns); err != nil {
    return newSystemErrorWithCausef(err, &quot;mounting %q to rootfs at %q&quot;, m.Source, m.Destination)
  }
  </code></pre>
  <p>Here in the if condition, there is an error generated thru  newSystemErrorWithCausef function and which internally uses <a href="https://github.com/opencontainers/runc/blob/e17b96d7b4a32efbc2d75aa460b89c580d029c4d/libcontainer/generic_error.go#L44" rel="nofollow noreferrer">generic_error.go</a>, fmt.Sprintf to format the error string.
  In our integration, only once it hit this if block. And in the process of getting more details, I wanted to troubleshoot and understand why this happened.</p>
  <p>As of now tried using fmt.Printf(........) in line 55 and also just before if block of line 59.
  And also tried putting above statement in very first line of <a href="https://github.com/opencontainers/runc/blob/master/libcontainer/rootfs_linux.go" rel="nofollow noreferrer">prepareRootfs</a> function. And then tried newSystemErrorWithCause(err, &quot;some other message&quot;) in the first line of prepareRootfs function. Overall I dont see any information generated with my messages.</p>
  <p>Please provide any information to understand more of this issue. Please note I am not looking for why this error might have been caused. I am looking for how to get more information from that function of <a href="https://github.com/opencontainers/runc/blob/master/libcontainer/rootfs_linux.go" rel="nofollow noreferrer">prepareRootfs</a>.</p>