You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
withdraw/restore: version DOI tombstone fails — missing doi: scheme prefix (found in prod) #984
Found during the epic #967 production withdrawal of the 10 broken datasets (0.9.1).
Symptom:nemar admin withdraw --all --execute tombstoned every dataset's CONCEPT DOI successfully (ok concept -> unavailable doi:10.82901/NEMAR.ON######) but FAILED on every VERSION DOI with:
failed version 1.0.0 -> unavailable 10.82901/nemar.on004148.v1.0.0
EZID unavailable error: bad request - invalid identifier
Root cause: the concept identifier (datasets.ezid_identifier) is stored WITH the scheme prefix (doi:10.82901/NEMAR.ON004148), but the version DOI (dataset_versions.doi) is stored WITHOUT it (10.82901/nemar.on004148.v1.0.0). withdrawDataset/restoreDataset (backend/src/services/withdraw.ts) pass v.doi straight to makeUnavailable/makePublic, so EZID gets an identifier with no doi: scheme and rejects it as invalid. The reconcile path (backend/src/services/doi-reconcile.ts) does this correctly — it calls getIdentifier(auth, \doi:${doi}`)`, prepending the scheme.
Fix: normalize the version DOI to doi:-prefixed before the EZID call in withdrawDataset AND restoreDataset (a small helper, e.g. ensureDoiScheme(doi) that no-ops if already prefixed). Add the gated ezid-sandbox round-trip that would have caught this (the Phase-4 review flagged that the live orchestration path was untested — this is exactly that gap biting in prod).
Why it slipped: the live withdraw/restore orchestration was never executed against a registrar in CI (gated RUN_EZID_TESTS test, never run). The dev dry-run only produced the plan; the first real EZID call happened in prod.
Current prod state (partial withdrawal): the 10 datasets ARE private + their CONCEPT DOIs tombstoned + withdrawn_at stamped (the primary protection is in place). Only the version DOIs remain un-tombstoned (they still resolve, to a now-404 landing page). Because withdraw is resumable (decideWithdrawAction -> 'resume' while versions aren't unavailable), re-running withdraw --all --execute after this fix ships will complete the version tombstones with no other change.
Priority: fix + patch-release (0.9.2), then re-run the withdrawal to finish the version DOIs. Part of the #967 follow-up set.
Fixed and shipped: PR #986 (de9ec36, "fix: prefix version DOIs with doi: scheme in withdraw/restore"), released in v0.9.2 on 2026-07-22 and on main since.
Root cause matched the report exactly: dataset_versions.doi is stored without the doi: scheme prefix, unlike datasets.ezid_identifier which carries it, so EZID rejected the unprefixed identifier and withdraw --all tombstoned every concept DOI while failing every version DOI. The fix adds the prefix in the withdraw/restore path (backend/src/services/ezid.ts, backend/src/services/withdraw.ts) with coverage in test/ezid.test.ts and test/ezid-sandbox.test.ts.
Closing. (PRs merged to dev never auto-close issues here — the default branch is main — which is why this sat open for eleven days after the fix shipped.)
Activity
Fix prod bugs #984 (version DOI prefix) + #985 (finalize idempotency) (…
Merge pull request #987 from nemarOrg/dev
neuromechanist commentedon Aug 3, 2026
Fixed and shipped: PR #986 (
de9ec36, "fix: prefix version DOIs with doi: scheme in withdraw/restore"), released in v0.9.2 on 2026-07-22 and onmainsince.Root cause matched the report exactly:
dataset_versions.doiis stored without thedoi:scheme prefix, unlikedatasets.ezid_identifierwhich carries it, so EZID rejected the unprefixed identifier andwithdraw --alltombstoned every concept DOI while failing every version DOI. The fix adds the prefix in the withdraw/restore path (backend/src/services/ezid.ts,backend/src/services/withdraw.ts) with coverage intest/ezid.test.tsandtest/ezid-sandbox.test.ts.Closing. (PRs merged to
devnever auto-close issues here — the default branch ismain— which is why this sat open for eleven days after the fix shipped.)