<p>I am trying to run this command in my Argo workflow</p>
<p><code>kubectl cp /tmp/appendonly.aof redis-node-0:/data/appendonly.aof -c redis -n redis</code></p>
<p>but I get this error</p>
<pre><code>Error from server (InternalError): an error on the server (&quot;invalid upgrade response: status code 200&quot;) has prevented the request from succeeding (get pods redis-node-0)
</code></pre>
<p>surprisingly when I am copying the file from a pod to local system then it is working, like this command <code>kubectl cp redis-node-0:/data/appendonly.aof tmp/appendonly.aof  -c redis -n redis</code></p>
<p>Any idea what might be causing it?</p>

Viplove
<p>Solution -
Not sure what was causing this issue but found this command in the <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#copy-files-and-directories-to-and-from-containers" rel="nofollow noreferrer">docs</a> that worked fine</p>
<p><code>tar cf - appendonly.aof | kubectl exec -i -n redis redis-node-0 -- tar xf - -C /data</code></p>
