Bug 1314817 - oc rsync commands return inconsistent error message when pod is not found [NEEDINFO]
Summary: oc rsync commands return inconsistent error message when pod is not found
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Wang Haoran
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-04 15:37 UTC by Ricardo Martinelli de Oliveira
Modified: 2022-02-14 18:56 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 17:13:24 UTC
Target Upstream Version:
Embargoed:
rmartine: needinfo?


Attachments (Terms of Use)

Description Ricardo Martinelli de Oliveira 2016-03-04 15:37:41 UTC
Description of problem:
I tried to copy a file from my pod to my local laptop and it returned this error:

$ oc rsync broker-amq-2-h3rz4:/etc/amq-secret-volume/broker.ts .
WARNING: cannot use rsync: rsync not available in containerWARNING: cannot use tar: tar not available in containererror: tar not available in container

However, the commands exist in my pod:

sh-4.2$ whereis tar                                                             
tar: /usr/bin/tar                                                               
sh-4.2$ whereis rsync                                                           
rsync: /usr/bin/rsync 

After setting --loglevel to 4 I found out that the real issue is that the pod cannot be found:

$ oc rsync broker-amq-2-h3rz4:/etc/amq-secret-volume/broker.ts . --loglevel=4
I0304 11:54:28.802886   30104 loader.go:241] Config loaded from file /home/rmartine/.kube/config
I0304 11:54:28.804266   30104 loader.go:241] Config loaded from file /home/rmartine/.kube/config
I0304 11:54:28.804400   30104 util.go:54] Setting root command to: oc
I0304 11:54:28.804412   30104 util.go:59] The sibling command is: oc rsh
I0304 11:54:28.804425   30104 copyrsync.go:44] Rsh command: oc rsh --loglevel=4
I0304 11:54:28.805737   30104 loader.go:241] Config loaded from file /home/rmartine/.kube/config
I0304 11:54:28.807214   30104 loader.go:241] Config loaded from file /home/rmartine/.kube/config
I0304 11:54:30.113404   30104 copyrsync.go:65] Copying files with rsync
I0304 11:54:30.113425   30104 execlocal.go:19] Local executor running command: rsync -a --blocking-io --omit-dir-times --numeric-ids -v -e oc rsh --loglevel=4 broker-amq-2-h3rz4:/etc/amq-secret-volume/broker.ts .
I0304 11:54:31.681136   30104 execlocal.go:26] Error from local command execution: exit status 255
I0304 11:54:31.681198   30104 execremote.go:28] Remote executor running command: rsync --version
I0304 11:54:31.957391   30104 execremote.go:49] Error from remote execution: pods "broker-amq-2-h3rz4" not found
I0304 11:54:31.957509   30104 util.go:24]
I0304 11:54:31.957580   30104 util.go:25] error: pods "broker-amq-2-h3rz4" not found
I0304 11:54:31.957617   30104 copymulti.go:28] Error output:
WARNING: cannot use rsync: rsync not available in containerI0304 11:54:31.957671   30104 copytar.go:116] Copying files with tar
I0304 11:54:31.957802   30104 copytar.go:143] Creating local tar file /tmp/rsync688996689 from remote path /etc/amq-secret-volume/broker.ts
I0304 11:54:31.957837   30104 copytar.go:205] Tarring /etc/amq-secret-volume/broker.ts remotely
I0304 11:54:31.957869   30104 copytar.go:212] Remote tar command: tar -C /etc/amq-secret-volume -c broker.ts
I0304 11:54:31.957897   30104 execremote.go:28] Remote executor running command: tar -C /etc/amq-secret-volume -c broker.ts
I0304 11:54:32.235728   30104 execremote.go:49] Error from remote execution: pods "broker-amq-2-h3rz4" not found
I0304 11:54:32.235776   30104 execremote.go:28] Remote executor running command: tar --version
I0304 11:54:32.511036   30104 execremote.go:49] Error from remote execution: pods "broker-amq-2-h3rz4" not found
I0304 11:54:32.511087   30104 util.go:24]
I0304 11:54:32.511100   30104 util.go:25] error: pods "broker-amq-2-h3rz4" not found
I0304 11:54:32.511157   30104 copymulti.go:28] Error output:
WARNING: cannot use tar: tar not available in containerF0304 11:54:32.511200   30104 helpers.go:96] error: tar not available in container

Version-Release number of selected component (if applicable):
3.1.x

How reproducible:
Everytime when oc rsync cannot find the pod.

Steps to Reproduce:
1. Run oc rsync command using an arbitrary pod name

Actual results:
oc rsync returns: "WARNING: cannot use rsync: rsync not available in containerWARNING: cannot use tar: tar not available in container"

Expected results:
oc rsync returns an error message that the pod with specified name cannot be found

Additional info:
Use --loglevel flag to capture additional information.

Comment 1 Fabiano Franz 2016-03-08 15:04:14 UTC
Fixed in https://github.com/openshift/origin/pull/7804

Comment 2 Wang Haoran 2016-03-09 05:45:17 UTC
verified with:
openshift v1.1.3-536-gda71953
kubernetes v1.2.0-alpha.7-703-gbc4550d
etcd 2.2.5

[root@ip-172-18-7-39 ~]# oc get pod
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-xu5xs   1/1       Running   0          51m
router-1-vks1o            1/1       Running   1          51m

[root@ip-172-18-7-39 ~]# oc rsync /tmp/test/ podnotexist:/tmp/test/
Error from server: pods "podnotexist" not found

Comment 3 Ricardo Martinelli de Oliveira 2016-03-09 12:30:48 UTC
As an additional request to this bug, the error message could give some suggestions like: "Check if the pod exists or if you run 'oc project' to the project where the pod is running"


Note You need to log in before you can comment on or make changes to this bug.