Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

klog.sh fails with kubecf/cap 2.0 #3474

Closed
greygoo opened this issue May 29, 2020 · 1 comment
Closed

klog.sh fails with kubecf/cap 2.0 #3474

greygoo opened this issue May 29, 2020 · 1 comment

Comments

@greygoo
Copy link
Member

greygoo commented May 29, 2020

Describe the bug
When running klog.sh with a kubecf deployment, it fails on copying log files from the log container in the adapter-0 pod with command terminated with exit code 126

To Reproduce
this is how klog.sh behaves:

> ./bin/klog.sh 
Pod acceptance-tests-530a82ca6917486c-w6ksb = Failed
  - acceptance-tests-acceptance-tests logs: Kube
  - output-persist logs: Kube
  Descriptions ...
Pod adapter-0 = Running
  - adapter-adapter logs: CF Kube
  - loggregator-agent-loggregator-agent logs: CF Kube
  - loggr-forwarder-agent-loggr-forwarder-agent logs: CF Kube
  - logs logs: CF

> echo $?
126

running it with bash -x reveals that this is the failing command:

> kubectl cp --namespace scf --container logs adapter-0:/var/vcap/sys/log/ /home/chullerlocal/klog/scf/adapter-0/logs/
command terminated with exit code 126

Expected behavior
klog.sh should collect and package the log files..

Environment

  • cap2.0 RC2
  • klog.sh
  • deployment was on aks

Additional context
I checked for differences between the pod klog.sh fails upon and ones where it works:

  • in the log container of the adapter-0 pod (the one klog.sh fails):

    • no tar command was available
    • permissions in the log dir:
          adapter-0:/ # ls -lh /var/vcap/sys/log/
          total 12K
          drwxr-sr-x 2 vcap vcap 4.0K May 27 15:04 adapter
          drwxr-sr-x 2 vcap vcap 4.0K May 27 15:04 loggr-forwarder-agent
          drwxr-sr-x 2 vcap vcap 4.0K May 27 15:04 loggregator_agent
      
  • in the loggr-forwarder-agent-loggr-forwarder-agent container in the adapter-0 pod (works with klog.sh):

    • tar command available
    • permissions in the log dir:
          /:/var/vcap/jobs/adapter# ls -lh /var/vcap/sys/log/
          total 12K
          drwxr-sr-x 2 vcap adm 4.0K May 27 15:04 adapter
          drwxr-sr-x 2 vcap adm 4.0K May 27 15:04 loggr-forwarder-agent
          drwxr-sr-x 2 vcap adm 4.0K May 27 15:04 loggregator_agent
      
@mook-as
Copy link
Member

mook-as commented May 29, 2020

If you are using kubecf, please be sure to use the kubecf version of klog.sh.

@f0rmiga f0rmiga closed this as completed Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants