jdx/mise · error
publication kept being rejected after {attempts} attempts: {
Error message
publication kept being rejected after {attempts} attempts: {reason} What it means
Publishing a dotfiles change is done as a push; on rejection (non-fast-forward, the upstream moved), mise fetches the new upstream, re-merges, and retries up to `PUSH_RETRIES` attempts. If every retry is still rejected, it gives up with this error reporting the final rejection reason. Your local history ref is not published and the status is not advanced past the failed publish.
Source
Thrown at src/system/history/sync/run.rs:400
request.capture && console::user_attended_stderr(),
)?;
plans = prepare(
repo,
tracked,
&shared.objects(),
&upstream,
&unsaved,
&mut status,
)?;
break;
}
PushOutcome::Rejected(reason) if attempts < PUSH_RETRIES => {
debug!("history sync: publication rejected, fetching again: {reason}");
remote.fetch(&origin.branch)?;
upstream_commit = repo.ref_oid(UPSTREAM_REF)?;
}
PushOutcome::Rejected(reason) => {
bail!("publication kept being rejected after {attempts} attempts: {reason}")
}
}
}
status.upstream_commit = upstream_commit.clone();
record_pending(&mut status, &plans, &Roots::current(), &shared.objects());
outcome.pending =
status.pending_applications.len() + usize::from(status.pending_repository);
outcome.conflicts = status.conflicts.len();
status.last_error = None;
status.failing_since = None;
status.consecutive_failures = 0;
status.backoff_until = None;
if !request.dry_run {
notify_new_conflicts(&mut status);
}
Ok(())
})();
if let Err(err) = &result {View on GitHub (pinned to afd2eddd3a)
Solutions
- Wait for the other machine's pushes to settle, then re-run sync/publish
- Read `{reason}` in the message; fix the underlying rejection (e.g. unprotect the branch or resolve the noted conflict)
- Pull and reconcile manually: `mise bootstrap dotfiles pull`, resolve conflicts, publish again
Defensive patterns
Strategy: retry
Validate before calling
mise bootstrap dotfiles status # check for concurrent publishers before pushing
Try / catch
catch (e) { if (String(e).includes('publication kept being rejected')) { await sleep(backoff); return retryPublish(); } throw e; } Prevention
- Coordinate publish times across machines sharing one setup branch
- Resolve push-rejection reasons (branch protection, hooks) on the remote before repeated attempts
When it happens
Trigger: `mise bootstrap dotfiles publish`/sync where the push loop receives `PushOutcome::Rejected(reason)` for `attempts >= PUSH_RETRIES` — the remote keeps advancing (or keeps rejecting) so the merge never lands cleanly.
Common situations: Another machine is continuously pushing to the same setup branch during your publish; a remote hook rejects pushes for a policy reason (protected branch, push rules); persistent rebase conflict that the automatic merge cannot resolve.
Understand the failure class
Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.
Related errors
- local files were saved after enrollment planning; retry pull
- {} changed in the complete repository merge; reconcile again
- {} changed before application; nothing was written
- {} changed while the changes were being applied; nothing mor
- {} changed during setup adoption; retry pull
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/da3aaef091728043.
Report an issue: GitHub.