Change:
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: The pods are stuck in with this error: What you expected to happen: I expect the pods to start. How to reproduce it (as minimally and precisely as possible): Running this daemon set on a GCE cluster on (both master and nodes): Anything else we need to know?: Environment: Kubernetes version (use ): Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.2", GitCommit:"", GitTreeState:"clean", BuildDate:"2017-07-21T08:23:22Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"windows/amd64"} Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.3", GitCommit:"", GitTreeState:"clean", BuildDate:"2017-08-03T06:43:48Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} Cloud provider or hardware configuration**: Google Container Engine OS (e.g. from /etc/os-release): N/A Kernel (e.g. ): N/A Install tools: N/A Others: N/A
There are no sig labels on this issue. Please by: a sig: e.g., to notify the contributor experience sig, OR the label manually: e.g., to apply the label Note: Method 1 will trigger an email to the group. You can find the group list and label list . The in the method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals
/sig node
/assign
Confirmed the bug in dockershim, filed to fix this.
Changed a environment and didn't make to reproduce the log problem. With provided manifests, the pod did fail in CrashLoopBackOff, but it is because not found in busybox image: And in container status, there is indeed errors of reading container logs: ! After changing the to , it should run properly. Although didn't fix the crash problem, it still helps on termination messages.
Yeah, that's what I thought. The log stuff is not the cause of the crashloop. Even you create symlink after fail to start container, it still doesn't fix the problem completely. After create the container, there is not log, and if is called at that time, you will still have this error. So the problem is not that we should create symlink after start failure, we should let tolerant log file not exist. Another problem with this issue is that I saw the termination message policy is . Why does kubelet still try to read message from the log?
Maybe we should return empty if the log file doesn't exist? This is because kubelet always fallback to logs if it fails to get from terminationMessagePath (see ).
That if block definitely doesn't belong there...
Or rather, I'm wondering if we should not be reporting the error at all when it's File.
We should never fall back to logs if it is File. Which code would do that (fallbackToLogs or false is always returned)
Opened a change to correctly fall back to logs if the termination message path file does not exist (as we do if the file is empty). While this may actually hide other errors (like ) it matches the intent of FallbackToLogsOnError.
did this work for you? I'm experiencing the same problem and opened an issue here:
these are my logs i am getting in kubernetes.. i am running from jenkins by using kubernetes-plugin making base image as jenkins/jnlp-slave whats this means exactly .. this error? failed to open log file "/var/log/pods/-ebf7-11e7-867e-": open /var/log/pods/-ebf7-11e7-867e- no such file or directory
Maybe you're here because you made the same mistake as I did: My image was trying to execute an ENTRYPOINT in a file that didn't exist. I discovered that by executing:

Discussion:
// StartContainer starts the container. func (ds *dockerService) StartContainer(containerID string) error { err := ds.client.StartContainer(containerID) <del> if err != nil { err = transformStartContainerError(err) return fmt.Errorf("failed to start container %q: %v", containerID, err) } // Create container log symlink. if err := ds.createContainerLogSymlink(containerID); err != nil { </del> <ins> // Create container log symlink for all containers (including failed ones). if linkError := ds.createContainerLogSymlink(containerID); linkError != nil { </ins> // Do not stop the container if we failed to create symlink because: //   1. This is not a critical failure. //   2. We don't have enough information to properly stop container here. // Kubelet will surface this error to user via an event. <del> return err </del> <ins> return linkError </ins> } <ins> if err != nil { err = transformStartContainerError(err) return fmt.Errorf("failed to start container %q: %v", containerID, err) } </ins> return nil }