Navigation

    Inedo Community Forums

    Forums

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. joris.guex
    3. Posts
    J
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by joris.guex

    • RE: Cargo package metadata not parsing correctly causing builds to fail

      Hi @Dan_Woolf,

      Sure, here is an example Cargo.toml:

      [package]
      name = "example"
      version = "0.1.0"
      edition = "2024"
      [dependencies]
      libssh2-sys = "0.3.1"
      

      And the ${CARGO_HOME}/config.toml:

      [registries]
      cargo-proxy = { index = "sparse+https://<PROGET_URL>/repository/cargo-proxy/" }
      [source.crates-io]
      replace-with = "cargo-proxy"
      
      posted in Support
      J
      joris.guex
    • Cargo package metadata not parsing correctly causing builds to fail

      Hello,

      A couple of weeks ago I opened an issue regarding an error with the Cargo feed for the Cargo package libssh2-sys (version 0.3.1). This was fixed in Proget 2026.3 but we are now seeing a different (but possibly related) issue with the same package and version.

      Our cargo build commands are failing again:

      $ cargo build
          Updating `cargo-proxy` index
      error: failed to select a version for the requirement `libssh2-sys = "^0.3.1"` (locked to 0.3.1)
        version 0.3.1's index entry is invalid
      location searched: `cargo-proxy` index (which is replacing registry `crates-io`)
      required by package `ssh2 v0.9.5`
          ... which satisfies dependency `ssh2 = "^0.9.5"` (locked to 0.9.5)
      

      After running the command with more verbose logs, we see the following:

      1.940501134s DEBUG main:exec:compile_ws:create_bcx:resolve_with_registry:resolve_with_previous:resolve: cargo::sources::registry::http_remote: checking freshness of li/bs/libssh2-sys
      1.940513252s DEBUG main:exec:compile_ws:create_bcx:resolve_with_registry:resolve_with_previous:resolve: cargo::sources::registry::index: slow path for "li/bs/libssh2-sys"
      1.941615528s  INFO main:exec:compile_ws:create_bcx:resolve_with_registry:resolve_with_previous:resolve: cargo::sources::registry::index: recoverying from failed parse of registry package libssh2-sys@0.3.1: invalid type: null, expected a string at line 1 column 637
      

      I think the metadata for the vcpkg build dependency is not being parsed correctly:

      [target.'cfg(target_env = "msvc")'.build-dependencies]
      vcpkg = "0.2"
      

      For example, crates.io parses it as follows:

      $ curl -s https://index.crates.io/li/bs/libssh2-sys | jq 'select(.vers == "0.3.1").deps[] | select(.name == "vcpkg")'
      {
        "name": "vcpkg",
        "req": "^0.2",
        "features": [],
        "optional": false,
        "default_features": true,
        "target": "cfg(target_env = \"msvc\")",
        "kind": "build"
      }
      

      While Proget seems to parse it as follows:

      $ curl -s https://${PROGET_URL}/repository/cargo-proxy/li/bs/libssh2-sys | jq 'select(.vers == "0.3.1").deps[] | select(.name | contains("msvc"))'
      {
        "name": "cfg(target_env = \"msvc\")",
        "req": null,
        "optional": false,
        "kind": "normal",
        "default_features": true,
        "features": [],
        "registry": "https://github.com/rust-lang/crates.io-index",
        "target": null
      }
      
      posted in Support
      J
      joris.guex
    • RE: Cargo feed returning 500 Internal Server Error

      Hi @atripp,

      We have now updated to ProGet 2026.3 and can confirm this is now working as expected. Thank you for your prompt help.

      posted in Support
      J
      joris.guex
    • Cargo feed returning 500 Internal Server Error

      We are using Proget 26.0.2 and have configured a Cargo feed connected to https://index.crates.io.
      From most crates it is behaving as expected, but we are having specific issues with the libssh2-sys crate.

      We are seeing behaviour where cargo build will error because Proget will return 500 Internal Server Error during the download:

      $ cargo build
      ...
      error: failed to get `libssh2-sys` as a dependency of package `ssh2 v0.9.5`
      
      Caused by:
        download of li/bs/libssh2-sys failed
      
      Caused by:
        failed to get successful HTTP response from `https://<PROGET_URL>/repository/cargo-proxy/li/bs/libssh2-sys` (<PROGET_IP>), got 500
      

      We have managed to reproduce this issue with a few simple curl commands.

      First we download the crate information which returns 200 OK as expected:

      $ curl -I https://${PROGET_URL}/repository/cargo-proxy/li/bs/libssh2-sys
      HTTP/1.1 200 OK
      Server: nginx/1.31.1
      Date: Thu, 04 Jun 2026 07:50:47 GMT
      Content-Type: text/plain
      Content-Length: 115448
      Connection: keep-alive
      Keep-Alive: timeout=5
      Cache-Control: private
      Last-Modified: Thu, 04 Jun 2026 07:50:47 GMT
      X-ProGet-Version: 26.0.2.16
      X-ProGet-Edition: enterprise
      

      Then we download the latest version of the crate which returns 200 OK as expected:

      $ curl -I https://${PROGET_URL}/cargo/cargo-proxy/crates/libssh2-sys/0.3.1/download
      HTTP/1.1 200 OK
      Server: nginx/1.31.1
      Date: Thu, 04 Jun 2026 07:51:26 GMT
      Content-Type: application/octet-stream
      Content-Length: 582851
      Connection: keep-alive
      Keep-Alive: timeout=5
      Cache-Control: private
      Last-Modified: Sat, 01 Feb 2025 17:13:17 GMT
      X-ProGet-Version: 26.0.2.16
      X-ProGet-Edition: enterprise
      Content-Disposition: attachment; filename="libssh2-sys-0.3.1.crate"
      

      But then when we try and download the crate information again, it returns 500 Internal Server Error which is not expected.

      $ curl -I https://${PROGET_URL}/repository/cargo-proxy/li/bs/libssh2-sys
      HTTP/1.1 500 Internal Server Error
      Server: nginx/1.31.1
      Date: Thu, 04 Jun 2026 07:52:42 GMT
      Content-Type: application/json
      Content-Length: 1948
      Connection: keep-alive
      Keep-Alive: timeout=5
      Cache-Control: private
      Last-Modified: Thu, 04 Jun 2026 07:52:42 GMT
      

      The full error returned is as follows:

      $ curl -s https://${PROGET_URL}/repository/cargo-proxy/li/bs/libssh2-sys | jq -r '.errors[0].detail'
      The given key was not present in the dictionary.
      System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
         at Inedo.ProGet.Feeds.Cargo.CargoMetadata.<.ctor>g__getDependency|3_4(KeyValuePair`2 dependency) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E655333\Src\src\ProGet\Feeds\Cargo\CargoMetadata.cs:line 152
         at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
         at Inedo.ProGet.WebApplication.FeedEndpoints.Cargo.CargoIndexHandler.ProcessRequestAsync(AhHttpContext context, WebApiContext apiContext, CargoFeed feed, String relativeUrl) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E655333\Src\src\ProGet\WebApplication\FeedEndpoints\Cargo\CargoIndexHandler.cs:line 106
         at Inedo.ProGet.WebApplication.FeedEndpoints.Cargo.CargoIndexHandler.ProcessRequestAsync(AhHttpContext context, WebApiContext apiContext, CargoFeed feed, String relativeUrl) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E655333\Src\src\ProGet\WebApplication\FeedEndpoints\Cargo\CargoIndexHandler.cs:line 89
         at Inedo.ProGet.WebApplication.FeedEndpoints.Cargo.CargoFeedHandler.ProcessRequestAsync(AhHttpContext context, WebApiContext apiContext, CargoFeed feed, String relativeUrl) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E655333\Src\src\ProGet\WebApplication\FeedEndpoints\Cargo\CargoFeedHandler.cs:line 107
         at Inedo.ProGet.WebApplication.FeedEndpoints.CanonicalFeedHandler`1.Inedo.Web.IHttpAsyncHandler.ProcessRequestAsync(AhHttpContext context) in C:\Users\builds\AppData\Local\Temp\InedoAgent\BuildMaster\192.168.44.60\Temp\_E655333\Src\src\ProGet\WebApplication\FeedEndpoints\CanonicalFeedHandler.cs:line 85
      

      Going into the Cargo feed and clicking "Delete Cached Crate" temporarily fixes the issue but it happens again after the next download.

      posted in Support
      J
      joris.guex
    • 1 / 1