Repository navigation
Remove failed first installations so the same command can be retried - #278
Merged
Merged
Conversation
A new installation records "complete": false in state.json and sets it once apply converged and the services are healthy. Any failure or interrupt (Ctrl-C, SIGTERM) before that runs oac_cli.remove: native Core's unit, the installation's own Compose project with its volumes, and every file the installer created, keeping loaded images. The directory goes too when the installer created it. The error ends with "Nothing was kept; fix the problem and rerun the same command.", or lists what is left and the commands that remove it. A rerun over an incomplete installation left by a hard kill removes it the same way and installs with the flags given now. Complete installations keep repair-only reruns. locked() refuses a lock whose path no longer names the locked file, since a removal unlinks it with the directory.
A wrong --core-key-file is a first-install failure: the installer removes what it created, and the same command can run again with the right file.
- create() writes state.json first, atomically, with the project name and complete: false. A directory without state.json is refused and never removed; the directory-name heuristic and state-less removal are gone. - The release downloader execs the installer, so nothing kills it while it removes a failed installation. The installer treats SIGHUP like SIGTERM, removes before printing, runs compose down with its output discarded, and ignores output errors when it reports. - remove() deletes state.json, the oac command and .oac.lock last, and a lone lock file is not reported as left over. - apply, start, domain setup and rotate-core-key refuse an installation the installer has not finished; status reports it. - The original error propagates after removal with its outcome attached, so an interrupt exits 130 and unexpected errors keep their traceback. - compose down runs from / without COMPOSE_* variables; the Web-only key warning and the duplicate settings step are gone on the first-install path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A failed first installation left a configured directory that kept failing on repair and refused corrected flags. First-install failures and handled interruptions now remove the installation's services, volumes and files, so the same command can be retried. Loaded images stay available for the retry.
Record completion only after services are healthy and Web-only Core authentication succeeds. Incomplete reruns clean their own state and accept fresh flags; completed installations retain repair-only behavior. Directories without installation state are preserved. The shared removal path keeps the installation lock and recovery state, and the release downloader lets the installer handle terminal and signal cleanup.
Validation:
make check-distributionandmake check-namespass. Tests cover failure, interruption, incomplete retry, complete-install protection, foreign files, completion guards and final cleanup recovery. Independent blind review covers deletion scope, signals, locking and recovery.SIGKILL or power loss during the final state/launcher unlinks can require manual removal of the remaining files; handled SIGINT, SIGTERM and SIGHUP are ignored during that short finalization.
Review follow-up: the printed manual cleanup command now uses the same working-directory and Compose-environment isolation as automatic cleanup, with an executable fake-Docker regression. Stopping partially started services remains available; operations that could enable use of an incomplete installation are blocked.