Skip to content

Preserve gateway state ownership across RPM erase and reinstall #735

Open

Description

@GuanzhouSong

Summary

Erasing and reinstalling the documentdb-gateway RPM can recreate its system
account with a different numeric UID while per-major gateway state remains
owned by the old UID.

The retained state includes
/var/lib/documentdb-local/<major>/gateway/tls. After reinstall, the gateway
can no longer read its existing certificate and private key and fails with a
permission error.

This was found during clean-host installer E2E work but is intentionally
separated from the minimal installer PR because it is an RPM package lifecycle
issue.

Actual behavior

  1. Install and configure a stand-alone instance.
  2. Record the UID of documentdb-gateway and the ownership of the per-major
    TLS directory.
  3. Erase documentdb-gateway.
  4. Reinstall documentdb-gateway.
  5. The recreated account may receive another UID while the retained TLS files
    keep the original numeric owner.
  6. Gateway startup fails when it tries to reuse that TLS state.

Expected behavior

An RPM erase and reinstall must preserve a resolvable owner for retained
per-major gateway state. Reinstalling the package must not make existing TLS
material unreadable.

Acceptance criteria

  • The gateway system account has a stable UID across RPM erase and
    reinstall, or retained state is safely reassigned before service start.
  • Package-owned global runtime and configuration state is still removed
    according to the RPM lifecycle contract.
  • Per-major TLS state remains readable by documentdb-gateway.
  • The retained account remains a locked system account with a non-login
    shell and /nonexistent home.
  • RPM lifecycle coverage includes a discriminating erase/reinstall test.
  • Debian purge behavior remains independently defined and tested.

Activity

  1. documentdb-triage-tool commented on Sep 3, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: packaging, bug
    Project fields suggested: Component packaging · Priority P2 · Effort M · Status Triage
    Confidence: 0.88 (llm)

    Reasoning

    LLM: RPM lifecycle bug where gateway system account UID instability after erase/reinstall causes TLS state to become unreadable, breaking gateway startup; scoped to packaging scripts with no schema changes.

    If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

  2. added this to the 1.0 milestone on Oct 5, 2026
  3. added
    1.0-blocker
    on Oct 6, 2026
  4. guanzhousongmicrosoft commented on Oct 6, 2026

    @guanzhousongmicrosoft
    Member

    1.0 blocker, same root cause as #771 item 5. The fix is in review.

  5. documentdb-triage-tool commented on Oct 28, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 22 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  6. documentdb-triage-tool commented on Nov 11, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  7. guanzhousongmicrosoft commented on Nov 23, 2026

    @guanzhousongmicrosoft
    Member

    The root cause is fixed on main (b566aa3): the documentdb-gateway system account is kept on erase, so a reinstall finds retained TLS state owned by the same UID, and e2e-rhel-scenarios.sh checks that. Still open: an erase → reinstall → gateway-reads-TLS test on a systemd-capable lane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

1.0-blockerbugdocumentdb-1.0packaging

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions