Skip to content

Publishing a new crate to JFrog Artifactory fails #15028

Closed as not planned
Closed as not planned
@neoeinstein

Description

@neoeinstein

Problem

We're using JFrog Artifactory 7.55.9. The default behavior for Artifactory, when a crate doesn't exist, is to return a 400 Bad Request on attempts to pull information for that crate. Prior to Rust 1.83.0, this was fine, as the 400 would just cause the "wait for publish to become visible" to fail out early on the very first publish of a crate, though the crate is successfully published.

error: download of my/-c/my-crate failed
Caused by:
  failed to get successful HTTP response from `https://artifactory.mycompany.com/artifactory/api/cargo/cargo-local/index/my/-c/my-crate` (10.0.0.1), got 400
  body:
  {
    "errors" : [ {
      "status" : 400,
      "message" : "Bad Request"
    } ]
  }

However, with 1.83.0, presumably as a result of #14448, there's now a step that tries to verify that the crate is not already published. If the crate has been published at least once to Artifactory, this check passes. If it hasn't, then Artifactory returns a 400 Bad Request error that results in an unhandled error, preventing the publish from even being attempted.

I understand that this behavior was added intentionally, but it now results in breakage of a previously working process with a major vendor.

Steps

  1. Establish a new JFrog Artifactory cargo repository
  2. Attempt to publish a new crate to that repository that has not been published to that repository before
  3. Receive a 400 Bad Request error.

Possible Solution(s)

Add a mechanism to allow skipping the "verify unpublished" check, or allow it to be tolerant of an error that doesn't explicitly indicate that the crate already exists.

Notes

No response

Version

CI doesn't run `cargo version --verbose`, but this is the output for `rustc`:

rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions