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

fix: Point to the engine restart command as part of the context switch failure remediation to not conflict with lower level commands #1191

Merged
merged 5 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/cli/commands/kurtosis_context/context_switch/switch.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func SwitchContext(
"needs to be stopped before the context can be switched. The engine status can be obtained running"+
"kurtosis %s %s and it can be stopped manually by running kurtosis %s %s.",
command_str_consts.EngineCmdStr, command_str_consts.EngineStatusCmdStr,
command_str_consts.EngineCmdStr, command_str_consts.EngineStartCmdStr)
command_str_consts.EngineCmdStr, command_str_consts.EngineStopCmdStr)
laurentluce marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down Expand Up @@ -144,8 +144,8 @@ func SwitchContext(
_, engineClientCloseFunc, startEngineErr := engineManager.StartEngineIdempotentlyWithDefaultVersion(ctx, logrus.InfoLevel, defaults.DefaultEngineEnclavePoolSize)
if startEngineErr != nil {
logrus.Warnf("The context was successfully switched to '%s' but Kurtosis failed to start an engine in "+
"this new context. An engine should be started manually with 'kurtosis %s %s'. The error was:\n%v",
contextIdentifier, command_str_consts.EngineCmdStr, command_str_consts.EngineStartCmdStr, startEngineErr)
"this new context. A new engine should be started manually with '%s %s %s'. The error was:\n%v",
contextIdentifier, command_str_consts.KurtosisCmdStr, command_str_consts.EngineCmdStr, command_str_consts.EngineRestartCmdStr, startEngineErr)
} else {
defer func() {
if err = engineClientCloseFunc(); err != nil {
Expand Down
7 changes: 2 additions & 5 deletions cli/cli/helpers/engine_manager/engine_existence_guarantor.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,10 @@ func (guarantor *engineExistenceGuarantor) VisitStopped() error {
// unusual and very bad, so we'd rather fail loudly
func (guarantor *engineExistenceGuarantor) VisitContainerRunningButServerNotResponding() error {
remediationCmd := fmt.Sprintf(
"%v %v %v && %v %v %v",
laurentluce marked this conversation as resolved.
Show resolved Hide resolved
"%v %v %v",
command_str_consts.KurtosisCmdStr,
command_str_consts.EngineCmdStr,
command_str_consts.EngineStopCmdStr,
command_str_consts.KurtosisCmdStr,
command_str_consts.EngineCmdStr,
command_str_consts.EngineStartCmdStr,
command_str_consts.EngineRestartCmdStr,
)
return stacktrace.NewError(
"We couldn't guarantee that a Kurtosis engine is running because we found a running engine container whose server isn't "+
Expand Down