fix(gateway): persist git-gate state across gateway restarts #513
Closed
didericis-claude
wants to merge 1 commits from
fix/gitgate-persist-512 into fix/firecracker-gateway-ca-persist-510
pull from: fix/gitgate-persist-512
merge into: didericis:fix/firecracker-gateway-ca-persist-510
didericis:main
didericis:fix/gateway-output-pump-shutdown
didericis:fix/gateway-request-boundaries
didericis:fix/authoritative-cleanup-revalidation
didericis:refactor/supervisor-mcp-dispatch
didericis:refactor/egress-policy-pipeline
didericis:refactor/orchestrator-fastapi
didericis:chore/misc-quality-cleanup
didericis:prd-forge-subroles
didericis:prd-0081-reconcile-1-ca
didericis:prd-gateway-reprovision-on-bringup
didericis:host-control-server-2-secret
didericis:host-control-server-3-list-live
didericis:host-control-server-1-transport
didericis:prd-new-host-control-server
didericis:fix/firecracker-gateway-ca-persist-510
didericis:didericis/disable-agit-refs
didericis:didericis/prd-audit-event-schema
didericis:fix/pr-495-audit-contract
didericis:prd-egress-control-plane
didericis:prd-macos-container-ci-runner
didericis:refactor/control-plane-auth-provisioning-476
didericis:fix/db-off-data-plane-469
didericis:feat/encrypted-egress-secrets
didericis:spike/rootless-docker-macos
didericis:fix/ci-coverage-artifact-paths
didericis:claude-forward-host-credentials-rebased
didericis:fix-gateway-gitleaks-arch
didericis:fix/websocket-response-dlp-multitenant
didericis:orchestrator-agent-compose
didericis:orchestrator-gateway-ca
didericis:orchestrator-consolidated-launch
didericis:orchestrator-gateway-provision
didericis:orchestrator-gateway-network
didericis:orchestrator-client
didericis:orchestrator-gateway-net
didericis:orchestrator-gitgate-provision
didericis:orchestrator-registration
didericis:orchestrator-lifecycle
didericis:orchestrator-supervise-writers
didericis:orchestrator-supervise-multitenant
didericis:orchestrator-gitgate-multitenant
didericis:orchestrator-rename-gateway
didericis:orchestrator-slice8
didericis:orchestrator-slice7
didericis:orchestrator-slice6
didericis:prd-orchestrator
didericis:orchestrator-slice5
didericis:orchestrator-slice4
didericis:orchestrator-slice3
didericis:orchestrator-slice2
didericis:firecracker-backend
didericis:forge-native-integration
didericis:prd-smolmachines-linux
didericis:manifest-break-import-cycle
didericis:dlp-supervise-quality-fixes
didericis:table-drive-dlp-tests
didericis:fix-integration-test-failures
didericis:fix/macos-container-relative-dockerfile
didericis:prd-0054-install-script
didericis:commit-bottle-state
didericis:pr-211
didericis:move-codex-auth-to-contrib
didericis:feat/pipelock-skip-scan-extensions
didericis:prd-0049-named-labelled-agents
didericis:harden-git-gate-shell-rendering
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Status/Needs Triage
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Awaiting initial classification
No Label
Milestone
No items
No Milestone
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: didericis/bot-bottle#513
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "fix/gitgate-persist-512"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Restarting/rebuilding the gateway drops every already-running bottle's git-gate state, so its agent gets
HTTP 404from the git-gate smart-HTTP server oninfo/refs— fetch and push both fail. Observed live: after a rebuild the gateway held only the ONE bottle's/git/<id>/bot-bottle.gitthat was relaunched with it; bottles predating the restart had no repo/creds.Same class of bug as #510/#511 (the CA): per-bottle repos (
/git/<id>) + deploy creds (/git-gate/creds/<id>) are provisioned once at bottle launch and live in the gateway's ephemeral storage. Nothing re-provisions running bottles — the orchestrator restores only egress tokens, not git-gate declarations.Fix (persist state, both backends)
firecracker — attach a second persistent data drive (
/dev/vdc) to the gateway VM and bind-mount itsgit/+creds/subdirs onto/gitand/git-gate/credsin the gateway guest init, before the data plane (and any provisioning writes). Generalized the VM config from a singledata_driveto a stable-ordereddata_drivestuple (CA=vdb, git=vdc; the orchestrator's registry stays vdb). New_ensure_git_volume()(sparse 8G ext4) mirrors_ensure_ca_volume.docker — bind-mount host dirs (
host_gateway_git_dir/host_gateway_creds_dir, under the never-pruned app-data root — same #450 rationale as the CA) onto/gitand/git-gate/creds, withBOT_BOTTLE_DOCKER_GIT_MOUNT/_CREDS_MOUNTenv overrides so CI isolates them to per-run volumes (workflows updated to set + clean them up).Teardown already
rm -rfs/git/<id>+ creds (deprovision_git_gate), so the persistent store self-cleans over the normal lifecycle.Tests
_ensure_git_volumecreate/reuse; gateway boots withdata_drives=(ca, git); gateway guest init mounts/dev/vdc+ bind-mounts/gitand/git-gate/credsbefore the data plane.:/gitand:/git-gate/credsvolumes.data_drivesrename. Full unit suite green (only the pre-existingtest_wheel_installenv failure — missingbuildmodule — is unrelated).Stacking
Stacked on #511 (shares the gateway persistent-volume mechanism); base is
fix/firecracker-gateway-ca-persist-510. Retarget tomainonce #511 merges.Closes #512
🤖 Generated with Claude Code
Superseded by the reprovision-on-gateway-bring-up strategy (PRD 0081, forthcoming PR). Rather than persist gateway-side state on a volume, the gateway reconciles all running bottles when it comes up — replacing each running agent's CA with the current gateway CA and re-provisioning each bottle's git-gate — giving one unified reprovision flow across CA / git-gate / egress tokens and free CA rotation on each restart. Closing in favor of that single PR.
Pull request closed