{"record":{"id":"da3aaef091728043","repo":"jdx/mise","slug":"publication-kept-being-rejected-after-attempts-a","errorCode":null,"errorMessage":"publication kept being rejected after {attempts} attempts: {reason}","messagePattern":"publication kept being rejected after (.+?) attempts: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/sync/run.rs","lineNumber":400,"sourceCode":"                        request.capture && console::user_attended_stderr(),\n                    )?;\n                    plans = prepare(\n                        repo,\n                        tracked,\n                        &shared.objects(),\n                        &upstream,\n                        &unsaved,\n                        &mut status,\n                    )?;\n                    break;\n                }\n                PushOutcome::Rejected(reason) if attempts < PUSH_RETRIES => {\n                    debug!(\"history sync: publication rejected, fetching again: {reason}\");\n                    remote.fetch(&origin.branch)?;\n                    upstream_commit = repo.ref_oid(UPSTREAM_REF)?;\n                }\n                PushOutcome::Rejected(reason) => {\n                    bail!(\"publication kept being rejected after {attempts} attempts: {reason}\")\n                }\n            }\n        }\n        status.upstream_commit = upstream_commit.clone();\n        record_pending(&mut status, &plans, &Roots::current(), &shared.objects());\n        outcome.pending =\n            status.pending_applications.len() + usize::from(status.pending_repository);\n        outcome.conflicts = status.conflicts.len();\n        status.last_error = None;\n        status.failing_since = None;\n        status.consecutive_failures = 0;\n        status.backoff_until = None;\n        if !request.dry_run {\n            notify_new_conflicts(&mut status);\n        }\n        Ok(())\n    })();\n    if let Err(err) = &result {","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/history/sync/run.rs#L382-L418","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"mise bootstrap dotfiles status   # check for concurrent publishers before pushing","typeGuard":null,"tryCatchPattern":"catch (e) { if (String(e).includes('publication kept being rejected')) { await sleep(backoff); return retryPublish(); } throw e; }","preventionTips":["Coordinate publish times across machines sharing one setup branch","Resolve push-rejection reasons (branch protection, hooks) on the remote before repeated attempts"],"tags":["git","push","sync","conflict","retry"],"backgroundTag":"git-command-failed","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}