-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Bug Description
bd dolt start spawns a dolt sql-server child process that does not inherit environment variables from the parent shell. This prevents Azure Blob Storage remotes (az://) from authenticating, since Dolt relies on AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_KEY env vars for Azure remotes.
Steps to Reproduce
- Configure a Dolt remote:
bd dolt remote add origin az://myaccount.blob.core.windows.net/dolt/my-db - Export Azure credentials:
export AZURE_STORAGE_ACCOUNT=myaccountandexport AZURE_STORAGE_KEY=... - Start the server:
bd dolt start - Verify env vars are missing:
strings /proc/<PID>/environ | grep AZURE_STORAGEreturns empty bd dolt pullandbd dolt pushboth fail with "no common ancestor" (actually an auth failure)
Expected Behavior
The dolt-sql-server child process should inherit environment variables from the parent process, or bd should provide a mechanism to pass env vars to the server.
Workaround
Start the dolt server manually with env vars, then write tracking files so bd discovers it:
AZURE_STORAGE_ACCOUNT=myaccount AZURE_STORAGE_KEY="$KEY" \
nohup dolt sql-server -H 127.0.0.1 -P 44444 > .beads/dolt-server.log 2>&1 &
echo -n "$!" > .beads/dolt-server.pid
echo -n "44444" > .beads/dolt-server.port
touch .beads/dolt-server.lock
bd dolt pull # Pull complete.
bd dolt push # Push complete.Environment
- bd version: 0.62.0 (Homebrew)
- dolt version: latest via Homebrew
- OS: Ubuntu (WSL2)
- Remote type: Azure Blob Storage (
az://)
Impact
Blocks any team using Azure Blob Storage as a Dolt remote from using bd dolt push/pull. Likely also affects AWS remotes relying on AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY.
Suggested Fix
In Go, exec.Command inherits env by default when Cmd.Env is nil. If bd is explicitly setting Cmd.Env, it should include os.Environ() as the base.