Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,10 @@ private void tryStart() {
}

if (inspectContainerResponse == null) {
throw new IllegalStateException("Wait strategy failed. Container is removed", e);
throw new IllegalStateException(
"Wait strategy failed. Container " + containerId + " is removed",
e
);
}

InspectContainerResponse.ContainerState state = inspectContainerResponse.getState();
Expand Down Expand Up @@ -538,14 +541,26 @@ private void tryStart() {

if (containerId != null) {
// Log output if startup failed, either due to a container failure or exception (including timeout)
final String containerLogs = getLogs();

if (containerLogs.length() > 0) {
String containerLogs = null;
try {
containerLogs = getLogs();
} catch (NotFoundException e2) {
logger().error("Could not retrieve logs for container {}: container not found", containerId, e2);
} catch (Exception e2) {
logger().error("Could not retrieve logs for container {}", containerId, e2);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if (containerLogs != null && !containerLogs.isEmpty()) {
logger().error("Log output from the failed container:\n{}", containerLogs);
} else {
logger().error("There are no stdout/stderr logs available for the failed container");
}
stop();

String failedContainerId = containerId;
try {
stop();
} catch (Exception e2) {
logger().debug("Failed to stop container {}", failedContainerId, e2);
}
}

throw new ContainerLaunchException("Could not create/start container", e);
Expand Down