Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./minikube logs -f do not work #2447

Closed
lichen2013 opened this issue Jan 23, 2018 · 11 comments
Closed

./minikube logs -f do not work #2447

lichen2013 opened this issue Jan 23, 2018 · 11 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. r/2019q2 Issue was last reviewed 2019q2

Comments

@lichen2013
Copy link

Is this a BUG REPORT or FEATURE REQUEST?: BUG REPORT

Please provide the following details:

Environment:

Minikube version: v0.24.1

  • OS: CentOS-7
  • VM Driver: none
  • Install tools:
    curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube
    

What happened:

  • Run command ./minikube start --vm-driver=none
  • Command end successfully, and a local k8s cluster is running as expected: kubectl commands works.
  • Run command ./minikube logs, gets the logs of the running localkube instance as expected
  • Run command ./minikube logs -f, nothing shows up.

What you expected to happen:

The help message for minikube logs says:

-f, --follow Show only the most recent journal entries, and continuously print new entries as they are appended to the journal.

I hope this command can work as it says.

How to reproduce it:

  • Run command ./minikube logs -f
  • Run command ./minikube logs and check the latest message timestamps, confirms new logs do exist during the time we run ./minikube logs -f.

Anything else do we need to know:

cat /tmp/minikube.INFO

Log file created at: 2018/01/23 11:38:11
Running on machine: GLB-Shanghai-ChenLi-003
Binary: Built with gc go1.9.1 for linux/amd64
Log line format: [IWEF]mmdd hh:mm:ss.uuuuuu threadid file:line] msg
I0123 11:38:11.666772    7165 notify.go:109] Checking for updates...
I0123 11:38:11.718853    7165 exec_runner.go:49] Run with output: if [[ `systemctl` =~ -\.mount ]] &>/dev/null; then
  sudo journalctl -f -u localkube
else
  tail -n +1 -f /var/lib/localkube/localkube.err /var/lib/localkube/localkube.out
fi
@lichen2013
Copy link
Author

The actual command running to get logs is sudo journalctl -f -u localkube, and if I directly run this command in terminal, it works well.

So, the issue is, why the output do not show in terminal ?

lichen2013 pushed a commit to lichen2013/minikube that referenced this issue Jan 23, 2018
CombinedOutput waits command complete. When we run a long
run command, such as continuously get new log entries, it
failed to get run results and then we can not get logs from
stdout.

Fixes: kubernetes#2447
@r2d4 r2d4 added the kind/bug Categorizes issue or PR as related to a bug. label Jan 23, 2018
lichen2013 pushed a commit to lichen2013/minikube that referenced this issue Jan 24, 2018
CombinedOutput function provided by os.exec return
bytes array after command complete. When we run a long
run command, such as continuously get new log entries,
it failed to get run results and then no logs to stdout.

Fixes: kubernetes#2447
lichen2013 pushed a commit to lichen2013/minikube that referenced this issue Feb 1, 2018
CombinedOutput function return after command complete.
When we run a long run command, such as continuously get
new log entries, it failed to get run results.

Fixes: kubernetes#2447
@lichen2013
Copy link
Author

The same issue can be produce when we have vm-driver virtualbox

lichen2013 pushed a commit to lichen2013/minikube that referenced this issue Feb 5, 2018
CombinedOutput function return after command complete.
When we run a long run command, such as continuously get
new log entries, it failed to get run results.

Fixes: kubernetes#2447
dlorenc pushed a commit that referenced this issue Feb 5, 2018
CombinedOutput function return after command complete.
When we run a long run command, such as continuously get
new log entries, it failed to get run results.

Fixes: #2447
@fatfatson
Copy link

the same issue in macos10.12 minikube28.0
when using -f, nothing appears

@svelleweetakealot
Copy link

I'm also not seeing anything when following from minikube log cli

How I reproduced:

  • start a tmux session and split panes
  • in pane 1 run
minikube logs -f
  • in pane2 run
minikube ssh
sudo journalctl -u kubelet -f
  • then I disable the kube-dns addon to see what happened. The manual ssh + journal on pane2 updated, pane1 did not.

I'll add any logs you feel are pertinent, but not sure what to attach..

I'm using

  • minikube: v0.28.2.
  • HostOS: Linux
  • Vmdriver: Virtualbox

Are there pointers on debugging? Perhaps I'm doing something daft without realising it.

@lichen2013
Copy link
Author

lichen2013 commented Aug 22, 2018

I guess this is related to the commit 79682c2

@tstromberg
Copy link
Contributor

This is still broken in v0.34.0. Funny enough, you'll see the logs if you use minikube logs -f --alsologtostderr, however.

@tstromberg tstromberg added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Feb 19, 2019
@tstromberg tstromberg self-assigned this Feb 22, 2019
@jonnyelliot
Copy link

I'm seeing this in v0.35.0. I'm using the workaround provided by @tstromberg to get around this issue.

@tstromberg tstromberg modified the milestones: v1.0.0, v1.0.1-candidate Mar 20, 2019
@tstromberg tstromberg added the r/2019q2 Issue was last reviewed 2019q2 label Apr 4, 2019
@tstromberg tstromberg removed this from the v1.0.1-candidate milestone Apr 8, 2019
@tstromberg tstromberg added this to the v1.1.0-candidate milestone Apr 16, 2019
@tstromberg tstromberg removed this from the v1.1.0-candidate milestone May 1, 2019
@tstromberg tstromberg added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels May 30, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 28, 2019
@tstromberg tstromberg added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 20, 2019
@tstromberg
Copy link
Contributor

This is still a thing.

@govargo
Copy link
Contributor

govargo commented Nov 5, 2019

I found that minikube logs -f works again.

My env:
OS: macOS 10.14.5
minikube: v1.5.2
driver: hyperkit(v0.20190201-11-gc0dd46) and virtualbox(6.0.8r130520)

Did someone fix this?

@tstromberg
Copy link
Contributor

Yes, apparently @medyagh unintentionally fixed this bug in a code refactor that landed in v1.5.1: #5530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. r/2019q2 Issue was last reviewed 2019q2
Projects
None yet
Development

No branches or pull requests

9 participants