Skip to content

fix(restart): show how to recover after startup fails - #73

Merged
hectorvent merged 4 commits into
mainfrom
fix/restart-recovery
Nov 4, 2026
Merged

hectorvent merged 4 commits into
mainfrom
fix/restart-recovery

Conversation

@hectorvent

@hectorvent hectorvent commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When restart had removed the old container and the new one failed, the settings of the instance were gone with it and nothing said how to get them back.

  • If the new container did not come up, stderr now prints a start command with the same container, port, image, persist dir, services and namespace.
  • If the new container is running but did not become ready, stderr says to check logs and run wait, because start refuses a running container.
  • Both name the tree (floci aws), a typed --endpoint is kept, and --persist prints the directory a local daemon would mount.
  • Applies to every tree through the shared RestartCommand. Exit codes and -o json stdout are unchanged.

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

Product trees affected

  • AWS (root tree)
  • GCP (commands/gcp/)
  • Azure (commands/az/)
  • N/A (shared infrastructure, docs, CI)

Checklist

  • mvn test passes locally
  • New or updated tests added (or explained below why not needed)
  • README.md updated (if a command or flag changed)
  • Native binary verified (mvn package -Pnative), required if Jackson serialization or dependencies changed
  • Commit messages / PR title follow Conventional Commits: a feat/fix/perf subject becomes the release note, so CHANGELOG.md needs no hand edit
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

Tests

RestartRecoveryTest covers a failed docker run in text and JSON, a failed stop, and a readiness timeout. 760 tests, 0 failures. Ran the fat JAR against real docker with nginx:alpine as a container that runs but never answers. Native build and smoke pass on linux/amd64 and darwin/arm64 with this change merged alongside the other open work; the smoke script does not exercise restart. OCI is covered too: the template has no box for it.

When restart has removed the old container and the new one does not come up, it
now prints a start command with the same port, image, persist dir, services and
namespace. When the new container is running but did not become ready, it says to
check logs and run wait instead, because start refuses a running container.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects restart recovery across the four product trees.

The remote-host recovery issue still needs a complete fix before merging.

Findings

  1. P1 Recovery waits on wrong host ▶

Summary

Adds recovery advice when restart fails after removing the old container.

  • Failed restarts now show the right way to recover.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Resolve and check settings] --> B[Stop and remove old container]
    B --> C[Save recovery command]
    C --> D[Start replacement]
    D --> E{Startup succeeded?}
    E -->|Yes| F[Return success]
    E -->|No| G{Replacement running?}
    G -->|Yes| H[Suggest logs and wait]
    G -->|No| I[Print start command]
Loading

Reviews (3) · Last reviewed commit: "chore(skill): bump the skill version to ..." · Reviewed by Greptile

if (running) {
return "The new container is running but did not become ready.\n"
+ "Check it with '" + profile.commandPrefix() + " logs" + selector + "', then run '"
+ profile.commandPrefix() + " wait" + selector + "' to wait again.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Recovery waits on wrong host

The printed wait command drops the endpoint used by restart. If a remote Docker instance was restarted with --endpoint http://build-host:4588 on host port 14588, the embedded wait checks build-host:14588, but the suggested command checks localhost:14588. It can keep timing out after the remote server becomes ready. Include the endpoint that start actually waited on.

Knowledge Base Used: Environment lifecycle operations

…ctory

They name floci aws, because a bare floci follows the configured default product. The suggested wait keeps a typed --endpoint with the port start bound, and --persist prints the directory a local daemon would mount, so a retry from another directory finds the same state. Addresses the review of #73.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
This branch changes the skill, and 1.0.1 shipped with #71.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
@hectorvent
hectorvent merged commit a319e2d into main Nov 4, 2026
5 checks passed
hectorvent added a commit that referenced this pull request Nov 4, 2026
This branch changes the skill, and 1.0.2 shipped with #73.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant