Repository navigation
fix(installer): warn that a reinstall reuses the leftover PentAGI database - #473
Open
AlaeddineMessadi wants to merge 1 commit into
Open
AlaeddineMessadi wants to merge 1 commit into
AlaeddineMessadi wants to merge 1 commit into
Conversation
…abase After the pentagi container is removed the installer offers Install, but the pentagi-postgres-data volume survives and the new stack silently reuses the old accounts and admin password. Install and Apply Changes now say so. The Maintenance screen now lists Factory Reset and Purge PentAGI in that state too: CanFactoryReset and CanPurgeAll accept leftover PentAGI volumes, because the `docker compose down -v` both run removes the declared volumes without any container. Remove PentAGI is still listed only for an installed stack, since its plain `down` would leave the volumes behind.
AlaeddineMessadi
force-pushed
the
feat/installer-warn-retained-database
branch
from
October 23, 2026 20:26
dc20634 to
750ba77
Compare
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.
Description of the Change
Problem
The installer considers PentAGI installed only when the
pentagicontainer exists. Afterdocker rm/docker rmi, thepentagi-postgres-datavolume survives, and the installer's ownPentagiVolumesExistcheck detects it (checker.go#L434-L442). Only credential hardening reads that flag, though. So the main menu offers Install as if the host were clean, Apply Changes says "PentAGI is not currently installed", and the new stack silently starts on the old database, with the old admin password. That is the situation in #432.In the same state, Purge PentAGI and Factory Reset are hidden, because
CanPurgeAll/CanFactoryResetonly look at installed containers. Until the stack is installed again, the only way to clear that database isdocker volume rmby hand.Solution
This implements what I proposed in the comment on #432:
PentagiVolumesExistis set and the container is missing, the Install screen and the Apply Changes screen show a warning: "The existing PentAGI database will be reused, with its accounts, passwords and flows. Purge PentAGI or Factory Reset removes it".CanFactoryResetandCanPurgeAllalso accept leftover PentAGI volumes, so Maintenance lists both in that state. Both rundocker compose down -v, which removes the declared volumes without needing a container. I checked this against Docker Engine 29.7.2 and Compose v5.5.0 with a throwaway project: removing the container and image first, then runningdown --rmi all -v, printed "Volume … Removed". Remove PentAGI is still listed only for an installed stack, since its plaindownleaves the volumes behind.Refs #432
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
cd backend && go generate ./cmd/installer/files/go test ./cmd/installer/... -race -count=1go vetand golangci-lint v2.12.2 on the touched packagesTest Results
All installer packages pass with
-race;go vetand golangci-lint report nothing. New tests, each with rows for volumes left behind, volumes with a running container, and a clean host:TestChecker_CanFactoryReset_OffersToRemoveVolumesThatOutlivedTheirContainerTestChecker_CanPurgeAll_OffersToRemoveVolumesThatOutlivedTheirContainerTestChecker_CanRemoveAll_IgnoresVolumesThatOutlivedTheirContainerTestApplyChanges_GetHelpContent_WarnsThatInstallReusesALeftoverDatabaseTestProcessorOperationForm_GetHelpContent_WarnsThatInstallReusesALeftoverDatabase, which also checks that the Purge and Factory Reset screens do not show the warningWith the production files reverted to main and the tests kept:
Removing the
operation == Installcondition fails the Purge and Factory Reset rows.Security Considerations
None new. Purge and Factory Reset keep their existing confirmation; they are only listed in one more state.
Performance Impact
None.
Documentation Updates
Deployment Notes
None.
Checklist
Code Quality
go fmtandgo vet(for Go code)pnpm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
Additional Notes
Two limits come from code that is already on main and are left as they are:
docker-compose.ymlwas deleted as well,performStackOperationskips the PentAGI stack (processor/compose.go). Purge then reports success but leaves the volumes.PentagiVolumesExistmatches the volume names by suffix, and it also countspentagi-sslandscraper-ssl. If only those are left, the warning about the database overstates the case.