Skip to content

fix(server): surface real provisioning error + always set service-user dolt identity - #17

Merged
SammyBytes merged 1 commit into
mainfrom
fix/provisioning-error-and-install-identity
Aug 31, 2026
Merged

fix(server): surface real provisioning error + always set service-user dolt identity#17
SammyBytes merged 1 commit into
mainfrom
fix/provisioning-error-and-install-identity

Conversation

@SammyBytes

Copy link
Copy Markdown
Owner

Two related fixes for 'Failed to provision repo' on fresh installs

1. router hides the real error

POST /api/v1/versioning/repos returned a hardcoded 'Failed to provision repo' 500 on every provisioning failure. Operators had to dig through journalctl to find the real cause (dolt missing, identity unset, permissions, etc.).
Fix: return err.message verbatim. Same 500, but the client now gets 'Failed to provision Dolt repo for X: dolt init exited with code 1: ...'.

2. install.sh never configured the service user's dolt identity

A fresh install would dolt init the anti-tamper license log AND let the systemd service run dolt init on every repo provision, but the service user's identity was never configured. Compound bugs:

  • The dolt config --global calls only ran inside if [ ! -f ENV_FILE ] (so reinstalls never re-asserted).
  • They ran as root (install.sh's UID), so the identity landed in /root/.doltconfig instead of /var/lib/deltix/.doltconfig.

Fix: new ensure_dolt_identity_for_service_user() runs after chown on every install, as sudo -u SERVICE_USER -H dolt config --global --add .... Idempotent. Inner root-identity config kept for the one-time license-log init.

Verified manually (live, this user)

deltix repo create mi-demo previously failed with generic 500. After setting the identity as the service user (the manual fix the user applied), deltix repo create succeeded. Both fixes now in code so no operator ever hits this again.

277 unit tests pass; lint clean.

…r dolt identity

Two related fixes for the silent 'Failed to provision repo' 500 on every
fresh install:

1. versioning.router.ts: the catch-all on POST /repos used to return a
   hardcoded 'Failed to provision repo' string, hiding whatever dolt
   actually complained about (binary missing, identity unset, permissions,
   etc.). Operators had to dig through journalctl to find the real cause.
   Now the router returns the underlying err.message verbatim; same
   500 status, but the client gets
   'Failed to provision Dolt repo for X: dolt init exited with code 1: ...'
   on its first try.

2. scripts/install.sh: a brand-new install (or any install where
   ENV_FILE doesn't yet exist) used to try to dolt init the anti-tamper
   license log AND let the systemd service run dolt init for repo
   provisioning -- but the service user's identity was never configured,
   so every dolt init exited 1 with 'empty ident name not allowed'.
   Two compounding bugs:
     a. The 'dolt config --global --add user.name/email' calls lived
        inside the if [ ! -f ENV_FILE ] block, so they never ran on
        reinstall/upgrade.
     b. They ran as root (install.sh's UID), so the identity landed in
        /root/.doltconfig instead of /var/lib/deltix/.doltconfig.
   Fix: new ensure_dolt_identity_for_service_user() runs after the
   chown, as 'sudo -u SERVICE_USER -H dolt config --global --add ...',
   on every install (idempotent). The in-block root identity config
   (for the one-time license-log dolt init) is kept; the license-log
   dir is now chowned to the service user first.

277 unit tests pass; lint clean.
@SammyBytes
SammyBytes merged commit 4ac19fd into main Aug 31, 2026
2 checks passed
@SammyBytes
SammyBytes deleted the fix/provisioning-error-and-install-identity branch August 31, 2026 13:55
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