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

[Regression]: Missing container logs when container exited #2887

Open
strowk opened this issue Nov 13, 2024 · 1 comment
Open

[Regression]: Missing container logs when container exited #2887

strowk opened this issue Nov 13, 2024 · 1 comment
Labels
bug An issue with the library

Comments

@strowk
Copy link

strowk commented Nov 13, 2024

Testcontainers version

0.32.0

Using the latest Testcontainers version?

No

Host OS

Linux

Host arch

ARM

Go version

1.22.4

Docker version

Running on CI, cannot run this there

Docker info

Running on CI, cannot run this there

What happened?

Somewhere between versions v0.27.0 and v0.32.0 this library stopped printing out container logs whenever container failed and now I just have "failed to start container: container exited with code 1" in output. Please return previous behavior that helped troubleshooting.

Relevant log output

failed to start container: container exited with code 1

Additional information

No response

@strowk strowk added the bug An issue with the library label Nov 13, 2024
@mdelapenya
Copy link
Member

mdelapenya commented Dec 4, 2024

Hi @strowk could you provide an code snippet or a reproduction repo for this? The error message you mentioned happens in the checkState function, that happens inside the wait strategies. So it seems something is causing the containers not to reach the desired state, but instead being in the "exited" one:

func checkState(state *types.ContainerState) error {
	switch {
	case state.Running:
		return nil
	case state.OOMKilled:
		return errors.New("container crashed with out-of-memory (OOMKilled)")
	case state.Status == "exited":
		return fmt.Errorf("container exited with code %d", state.ExitCode)
	default:
		return fmt.Errorf("unexpected container status %q", state.Status)
	}
}

Also it's interesting that the failed to start container log entry appears in our codebase for the testable examples in the modules, that's why I'm very interested in seeing your repro code to be able to debug it and find the root cause for this issue.

Could you provide that? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
Development

No branches or pull requests

2 participants