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

[WIP] 🌱 capd: inspect container when container bootstrap fails #4416

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Mar 31, 2021

What this PR does / why we need it:
Adds more debug information in case the container creation does not work. For context, please see #4405 (comment)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Improves observability to debug #4405

@sbueringer
Copy link
Member Author

Let's try to hit the issue and find out if the docker inspect works and helps.
/test pull-cluster-api-e2e-full-main

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 31, 2021
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 31, 2021
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move this within the PR for adding more info to the logs, so we can cross check the problem in logs as well

@@ -431,3 +435,12 @@ func (m *Machine) machineImage(version *string) string {

return fmt.Sprintf("%s:%s", defaultImageName, versionString)
}

func logInspectContainer(ctx context.Context, log logr.Logger, name string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit
If you passing ctx you can use log := ctrl.LoggerFrom(ctx) (no need to pass the logger)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Is the pattern in general to just pass the context and always get the logger from there? (in cases where we have to pass the context anyway, which is probably almost everywhere)

@sbueringer
Copy link
Member Author

sbueringer commented Mar 31, 2021

I think we should move this within the PR for adding more info to the logs, so we can cross check the problem in logs as well

How do you mean this?

The logger itself should have and print the name and namespace of the machine afaik. But I think you're referring to something else.

Of course open to all suggestions I'm not familiar with the code at all :)

@sbueringer
Copy link
Member Author

sbueringer commented Mar 31, 2021

That wasn't the error I was looking for :) (will be fixed in #4415)
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vincepri after the PR has been reviewed.
You can assign the PR to them by writing /assign @vincepri in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 31, 2021
@sbueringer
Copy link
Member Author

I hit the issue, unfortunately there was nothing conclusive in the docker inspect output: https://gist.github.com/sbueringer/581a793084fd129d97816b8529ecdc81

Cherry-picked #4414 for now, maybe that helps

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

Just realized that I can also just find the root cause on this PR with a few test runs. I'll play around a bit, let's discuss afterwards which of the changes we consider merging into the main branch.

For now: added docker logs

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

7 similar comments
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer sbueringer changed the title [WIP] 🐛 capd: inspect container when container bootstrap fails [WIP] 🌱 capd: inspect container when container bootstrap fails Apr 1, 2021
@sbueringer
Copy link
Member Author

sbueringer commented Apr 1, 2021

/test pull-cluster-api-e2e-full-main
(I think the error occurs only at certain times, possibly when there is high load in the CI cluster through noisy neighbour effects)

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

1 similar comment
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

1 similar comment
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

3 similar comments
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

sbueringer commented Apr 2, 2021

Now with a new kind image which uses /bin/echo instead of echo when piping into head -n 1:

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 2, 2021
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@sbueringer sbueringer force-pushed the pr-capd-inspect-on-container-creation-error branch from f0e7a5a to 0d74d6d Compare April 2, 2021 15:36
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 2, 2021
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-full-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main
/test pull-cluster-api-e2e-full-main

@k8s-ci-robot
Copy link
Contributor

@sbueringer: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-e2e-full-main 0d74d6d link /test pull-cluster-api-e2e-full-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@sbueringer
Copy link
Member Author

I'll close this PR as it served it's purpose (and found an issue in kind). I'll open a new (clean) one for the addition of docker inspect/logs.
/close

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Closed this PR.

In response to this:

I'll close this PR as it served it's purpose (and found an issue in kind). I'll open a new (clean) one for the addition of docker inspect/logs.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants