Copying data from pod to local machine fails with: "tar executable file not found"

Solution Verified - Updated -

Issue

We want to copy data from a running pod to local machine storage.

While running 'oc cp' we get the following error:

[root@xxxx imagergistery-backup]# oc cp devops/yyyy-xxxx-5f6d8f7f7c-bzs8q:/nexus-data/ /imagergistery-backup/nexus

time="2025-05-11T00:09:10+03:00" level=error msg="exec failed: unable to start container process: exec: \"tar\": executable file not found in $PATH"
command terminated with exit code 255

Environment

  • Red Hat Openshift Container Platform 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content