Symptoms
bd dolt pushorbd dolt pullhangs or times out- Network-related error messages
- “failed to push” or “failed to pull” errors
- Dolt server not responding
bd dolt push,bd syncor dolt auto-push fails with “Found dangling references to HashSet” — see Push fails with “Found dangling references”bd dolt pushfails withdangling chunk referenceorpre-push integrity check …— see Push refused by the pre-push integrity check- A pull,
bd syncor merge after migration 0062 refuses withlocal changes would be stomped by merge: eventsorthe table(s) events have schema conflicts— see Merge blocked on the events table (migration 0062) - On 1.2.2 or older, after another clone pushed migration 0062,
bd dolt pullfails onevents(on embedded storage:merge conflicts in events require operator resolution) — see Pull fails on a clone still on the old release - A merge commit created by a pull names the tracking ref
(
Merge branch 'origin/main' into main) instead of quoting the remote URL, or a merge commit from an older release quotes a URL that carries a token — see Credentials in a remote URL and merge commits
Diagnosis
Solution
Step 1: Stop the Dolt serverCommon Causes
Push fails with “Found dangling references”
Symptom:bd dolt push exits 1 with one of:
bd sync reports the same refusal after Error: sync failed: push: , and
dolt auto-push after Warning: dolt auto-push failed: .
What it means: before Dolt moves the remote branch, it asks the remote
whether it has every chunk the pushed data points to. The remote said it does
not have the chunk named in the message, so Dolt refused the push. The remote
branch was not moved. This is not a sign of local corruption: the check
asks the remote, not your local store. (When bd pushes through the dolt CLI,
its pre-push check reports local problems separately; see
Push refused by the pre-push integrity check.)
Telling the cases apart: under the error, bd prints this clone’s HEAD
commit hash and HEAD root hash, which it reads right after the failure:
dolt_hashof('HEAD') and dolt_hashof_db('HEAD'). bd prints them in
embedded mode, the default, as well as in server mode. In server mode you can
also read them yourself:
bd sql does not run in embedded mode, so there, use the values bd printed.
- If the hash in the error equals either value, it is a chunk this push had just uploaded and the remote had not registered yet: a transient race on the remote (often another push to the same remote). Re-run the push, even when the same hash comes back.
- If it matches neither, the remote is missing a chunk it should already have. Re-run the push once. If the same hash comes back, the remote is damaged: seed a fresh remote (step 2).
-
Compare the hash with the two values, then re-run the push that failed,
for example:
-
Only if it fails again with the same hash, and that hash matches neither
value, seed a fresh remote from this clone. Create an empty database at
your provider, point the remote that failed at it, and push. For
origin, the default remote (this also rewritessync.remote):On each other clone, re-pointoriginthe same way and runbd dolt pull, or runbd bootstrapin a clean checkout. If the push that failed named another remote (--remote <name>), re-point that remote instead and leaveoriginalone:In server mode bd sends Hosted Dolt credentials (DOLT_REMOTE_USER,DOLT_REMOTE_PASSWORD) only toorigin, so that last push would reach a fresh Hosted Dolt database without them. In that case, make the fresh database the default remote for the seeding push, then putoriginback and point<name>at the fresh database. Theorigincommands rewritesync.remoteon the way, and the last of them restores it:Here<url>is the fresh database and<origin-url>is the URLoriginhad before. Re-point<name>the same way on each other clone that uses it. -
If it keeps failing, report it to Dolt at
dolthub/dolt issues with the hash,
the remote type, the output of
bd version(and ofdolt versionin server mode: embedded mode runs the Dolt engine built into bd), and the UTC times of the failures (DoltHub can match them to its manifest logs).
Push refused by the pre-push integrity check
Whenbd pushes through the dolt CLI, it first runs dolt fsck --quiet on
the local database, bounded by BEADS_FSCK_TIMEOUT (default 30 seconds). It
refuses the push in one of four ways. Only the first can carry fsck’s verdict
that the local store is damaged; the other three mean the check ended without
a verdict:
-
dangling chunk reference: aborting push to prevent propagating corrupt chunks: …— fsck reported a finding: aCorrupt ChunksorCommit Errorsreport, or a corrupted chunk journal (WARNING: Chunk journal is corrupted). The local store is damaged; do not work around the check. Recover it first: see Database Corruption. bd v1.3.4 and earlier also refuse an fsck that failed without a finding this way. With those releases the refusal reports a finding only when the output it quotes aftercorrupt chunks:holds aCorrupt ChunksorCommit Errorsheader orWARNING: Chunk journal is corrupted. If nothing followscorrupt chunks, or only a warning or another error does, check the store by hand as described forpre-push integrity check failedbelow. -
pre-push integrity check timed out: …— fsck did not finish in time. The store is not necessarily corrupt. Shrink it withdolt gc(orCALL DOLT_GC()on a running sql-server) or raiseBEADS_FSCK_TIMEOUT(for exampleBEADS_FSCK_TIMEOUT=2m bd dolt push). If the message says the surrounding operation’s deadline expired, raise that caller’s timeout instead (for auto-push,dolt.auto-push-timeout). -
pre-push integrity check interrupted: …— the check was canceled before it finished, for example with Ctrl-C. The store is not implicated: run the push again. -
pre-push integrity check failed: …(bd v1.4.0 and later) — fsck exited with an error but reported no finding: for example dolt could not start, printed only a warning, or was killed. The message quotes the error and fsck’s output (or(no output)) and names the database directory. The store is not necessarily corrupt, but bd has no verdict on it, so it still refuses the push. Fix what the quoted output names, then run fsck yourself in that directory:bd v1.3.4 and earlier do not name the directory. It is the database’s subdirectory of the Dolt data directory:.beads/dolt/<database>by default, or~/.beads/shared-server/dolt/<database>with the shared server.bd dolt showprints the database name (Database:), andbd dolt statusprints the data directory of a server bd runs (Data:).- If fsck ends with
No problems found., re-runbd dolt push. - If it prints a
Corrupt ChunksorCommit Errorsreport, orWARNING: Chunk journal is corrupted, the store is damaged: treat it as the first case. - If it keeps failing without a report, for example with
commit DAG walking failed,failed during full chunk scanor a panic, the store may still be damaged: fsck stops on some damage before it can report it. Do not bypass the check with a directdolt push. Back up the database directory and follow Database Corruption, or report the output to Dolt at dolthub/dolt issues.
- If fsck ends with
Merge blocked on the events table (migration 0062)
Symptom: after this clone migrated past schema 61, abd dolt pull, a
bd sync or a merge of a peer’s work fails with one of:
dolt_schema_conflicts names events with
cannot merge a table deletion with data modification. The bead tables
themselves may merge with no conflicts at all.
What it means: migration 0062 moved the events audit table onto Dolt’s
ignore plane: it deleted the versioned table in a commit and recreated it as a
working table that is never committed. Dolt refuses to merge a commit that
still has the versioned table into a clone that holds the ignored one, and it
refuses before it checks whether there is anything to merge. So the first
error also appears when the remote is only behind this clone, still at a
commit from before this clone migrated, with no new work in it. bd sync
then fails on every run, because it pulls before it pushes.
When the remote does have new work from a peer that has not migrated (or
whose history predates the migration, such as unpushed work on a laptop), that
work still changes the versioned table. Merging the two meets a deletion on
one side and row changes on the other. Dolt cannot resolve that in either
direction: DOLT_CONFLICTS_RESOLVE('--ours','events') and --theirs both
fail with table not found, and ALTER TABLE does not apply. An events
schema conflict is not proof of this cause on its own, but after migration
0062 it is the likely one. bd v1.4.0 and later print this diagnosis under
the merge blockers.
Because events is ignored, dolt status shows a clean working set even
while the merge refuses. That does not mean the table is empty: it holds this
clone’s local audit rows.
Before this clone pushes, stop the writes on the old release. Any push
from this clone publishes migrated history. A clone still on a release before
1.3.0 (1.2.2 or older, the releases without migration 0062) that commits after
that can no longer pull: see
Pull fails on a clone still on the old release.
So first, on every such clone, publish its work with its current release, then
stop writing on it until this recovery is done:
bd dolt commit even on a clone where nothing was written: on those
releases a pull that merges can leave part of the merge uncommitted, and that
leftover blocks the clone’s later pull just as a new commit would. It prints
Committed. when it finds something and Nothing to commit. otherwise. If
the push is rejected because another clone pushed in the meantime, run the
three commands again.
Then check whether the remote is only behind. For the stomped error, run
a plain push next:
bd dolt pull or bd sync has nothing to merge and succeeds.
Then upgrade the clones on the old release as in step 7. If the push is
rejected as a non-fast-forward, the remote has commits this clone does not,
such as a peer’s work from before the migration or work a clone has just
published: follow the steps below.
Steps:
-
Keep your local work. Back up the issues and, for the event rows, the whole
store, while no
bdcommand is running:and copy the.beadsdirectory (or take adolt backupin server mode). -
If a merge is open, abort it explicitly. On embedded storage, run
dolt merge --abortin the database directory. In server mode, runCALL DOLT_MERGE('--abort')on a connection to the server that serves this store (on the server host for a proxied-server workspace). Do not leave the merge open and retry on top of it. -
Do not run
DOLT_CHECKOUT('--','events')to clear thestompedrefusal. The committed HEAD no longer hasevents, so reverting it to HEAD deletes the working table and its rows, and every later bd write fails withfailed to record event ...: table not found: events. If that has already happened, the next bd command that writes recreates an emptyeventstable; the lost rows come back only from a backup. -
Do not force past the problem.
bd migrate --forceand retrying the pull on the same bd release do not change the history that conflicts, and the advice in Clone behind the remote still holds: pull before migrating, never force past a data-behind stop. - Do not delete the peer’s work: keep its branch and the remote ref that holds it. Step 6 merges it.
-
Migrate that work, then pull it. The remote’s new commits still change the
versioned
eventstable because no clone has migrated them yet. With every clone on the old release published and stopped, one clone migrates all of them. Prefer the peer: migrating its own clone keeps itseventsrows there. On the peer, publish once more with its current release, so it holds what the others published (bd dolt pull,bd dolt commit,bd dolt push), then install this clone’s release and run:If that push is rejected as a non-fast-forward, another clone pushed after the peer published. The peer has migrated, so it is now in this clone’s position: make sure every clone on the old release has stopped writing, migrate on a fresh clone as below, and then run the pull and push below on the peer as well. Without the peer, migrate on a fresh clone of the remote, made with this clone’s bd release in a new empty directory outside this project (bd dolt remote liston this clone prints the URL):If that push is rejected as a non-fast-forward, someone pushed in the meantime: make sure every clone on the old release has stopped writing, then delete the fresh clone and make a new one. Once a migrated push succeeds, pull and publish on this clone:Both sides of the merge have now deleted the versioned table, so the pull merges the peer’s work like any other: its beads arrive, and this clone keeps its owneventsrows. Delete the fresh clone, if you made one, once the pull has succeeded. -
Upgrade every clone still on the old release (the peer too, if a fresh
clone migrated). On each, pull with its current release, then install the
new release straight away:
This is step 3 of Multiple clones sharing one remote: the pull fast-forwards, because the clone stopped writing after it published, and afterwards the old release refuses the database with
schema version mismatch. The pull also removes the clone’s versionedeventstable, and the new release starts an empty one. Becauseeventsrows do not sync after migration 0062, that clone’s earlier audit rows remain only in history. Only a clone that migrated its own history (this clone, and the peer if it migrated) keeps them in its working table.
events table, needs a compatibility operation in the Dolt
driver, tracked in #6727.
Do not hand-write bridge SQL for that; none has been validated against this
procedure.
Pull fails on a clone still on the old release
Symptom: on a clone still on 1.2.2 or older, after another clone pushed migrated history,bd dolt pull fails on events and bd dolt push is
rejected as a non-fast-forward. On embedded storage the pull prints:
events table
that the migrated history does not have. It wrote after that history reached
the remote, or a merge it pulled earlier was never fully committed (the
bd dolt commit above). Merging meets the same deletion on one side and row
changes on the other as above, from the opposite direction, so a retry fails
the same way.
Recovery: carry its work over by re-cloning. With its current release,
back up the issues and move the database aside:
events
rows stay in the moved-aside directory; keep it until you have checked the
result.
Credentials in a remote URL and merge commits
A remote URL can carry credentials, for examplegit+https://x-access-token:<token>@github.com/org/repo or
http://user:<token>@host/org/db. In older bd versions, a server-mode
bd dolt pull that had to merge diverged histories ran Dolt’s own pull, and
its merge commit message copied that stored URL, token included:
bd dolt push then published the commit, so anyone who can read the remote’s
Dolt data could read the token in dolt log.
Server-mode pulls now fetch and then merge the tracking ref, as embedded mode
does, so the merge commit reads:
DOLT_REMOTE_USER /
DOLT_REMOTE_PASSWORD in the environment (see bd dolt pull --help),
or use a git credential helper for git+https remotes.
Prevention
- Ensure stable network before sync
- Let sync complete before closing terminal
- Use
bd dolt stopbefore system shutdown