Skip to content

Recover Rekor duplicate-entry conflicts by default #1708

Description

@lodekeeper

Summary

npm provenance publishing can fail with:

TLOG_CREATE_ENTRY_ERROR error creating tlog entry - (409) an equivalent entry already exists in the transparency log

This appears to be a retry-after-success path. Rekor accepts and commits the create-entry request, but the client times out, receives a transient network failure, or retries after a retryable response. The retry submits the same equivalent entry, Rekor correctly returns 409, and the signing flow treats that as fatal.

Current behavior

TLogClient defaults fetchOnConflict to false:

this.fetchOnConflict = options.fetchOnConflict ?? false;

High-level sigstore.attest() / npm provenance callers usually do not set this option directly, so a 409 from an already-created Rekor entry becomes TLOG_CREATE_ENTRY_ERROR instead of using the existing recovery path.

Expected behavior

When Rekor returns a 409 with a location for an equivalent existing entry, the default behavior should fetch the existing entry and continue. The existing entry is the entry the client needs in the Sigstore bundle, so this makes the create-entry operation idempotent from the caller's perspective while preserving provenance.

Callers that need fatal conflict behavior can still pass fetchOnConflict: false explicitly.

Downstream reports

Similar downstream failures and analyses:

Proposed fix

Default TLogClient to fetchOnConflict: true, while preserving explicit fetchOnConflict: false for callers that want conflicts to remain fatal.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions