-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git2 repository update lead to read zlib stream error when fetch repo #8258
Comments
Thanks for the report! Would it be possible to minimize this a bit more? Or could you provide some logs of what happens? It'd be useful to know what Cargo is cloning. You might have some success digging with |
hello @alexcrichton , sorry to have not add the error log. here it is:
Caused by: Caused by: Caused by: Caused by: Caused by: Caused by: ` |
Thanks! I'm indeed able to reproduce this with git2::Repository::clone(
"https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer",
"test",
)
.unwrap(); Running in a debugger it does indeed look like libz is simply returning an error. The origin of the git error fails on this call to I haven't extracted the zlib stream but it sort of seems like this is a legitimately invalid zlib stream, or at least according to libz it is. Either that or it's being fed into libz incorrectly by libgit2, which is also possible. In any case this isn't an issue Cargo itself can deal with. At most it's an issue with libgit2, but it could also be an issue with libz or the server itself. |
@alexcrichton so, should we pass this ball to libgit2 community to resolve this issue? |
Indeed, I've opened up libgit2/libgit2#5525 |
… diff) to try disabling the offending dep from rust-lang/cargo#8258 .
… diff) to try disabling the offending dep from rust-lang/cargo#8258 .
…ust-lang/cargo#8258. # Delete this line to force CI to run the JVM tests. [ci skip-jvm-tests]
This'll pull in a fix for rust-lang#8258
Require latest libgit2 to pull in bugfixes This'll pull in a fix for #8258
Recently all CI builds using rust 1.44.1 have been failing on CI with the following error message: ``` error: failed to get `cargo_metadata` as a dependency of package `corrosion-generator v0.1.0 (/home/runner/work/corrosion/corrosion/generator)` Caused by: failed to fetch `https://github.com/rust-lang/crates.io-index` Caused by: error reading from the zlib stream; class=Zlib (5) CMake Error at cmake/Corrosion.cmake:427 (message): corrosion-generator failed: 101 Call Stack (most recent call first): test/cpp2rust/CMakeLists.txt:1 (corrosion_import_crate) ``` The relevant issue is probably rust-lang/cargo#8258 and has already been fixed for newer cargo versions.
Recently all CI builds using rust 1.44.1 have been failing on CI with the following error message: ``` error: failed to get `cargo_metadata` as a dependency of package `corrosion-generator v0.1.0 (/home/runner/work/corrosion/corrosion/generator)` Caused by: failed to fetch `https://github.com/rust-lang/crates.io-index` Caused by: error reading from the zlib stream; class=Zlib (5) CMake Error at cmake/Corrosion.cmake:427 (message): corrosion-generator failed: 101 Call Stack (most recent call first): test/cpp2rust/CMakeLists.txt:1 (corrosion_import_crate) ``` The relevant issue is probably rust-lang/cargo#8258 and has already been fixed for newer cargo versions.
Recently all CI builds using rust 1.44.1 have been failing on CI with the following error message: ``` error: failed to get `cargo_metadata` as a dependency of package `corrosion-generator v0.1.0 (/home/runner/work/corrosion/corrosion/generator)` Caused by: failed to fetch `https://github.com/rust-lang/crates.io-index` Caused by: error reading from the zlib stream; class=Zlib (5) CMake Error at cmake/Corrosion.cmake:427 (message): corrosion-generator failed: 101 Call Stack (most recent call first): test/cpp2rust/CMakeLists.txt:1 (corrosion_import_crate) ``` The relevant issue is probably rust-lang/cargo#8258. Starting with cargo 1.46 the CI failures are resolved
Recently all CI builds using rust 1.44.1 have been failing on CI with the following error message: ``` error: failed to get `cargo_metadata` as a dependency of package `corrosion-generator v0.1.0 (/home/runner/work/corrosion/corrosion/generator)` Caused by: failed to fetch `https://github.com/rust-lang/crates.io-index` Caused by: error reading from the zlib stream; class=Zlib (5) CMake Error at cmake/Corrosion.cmake:427 (message): corrosion-generator failed: 101 Call Stack (most recent call first): test/cpp2rust/CMakeLists.txt:1 (corrosion_import_crate) ``` The relevant issue is probably rust-lang/cargo#8258. Starting with cargo 1.46 the CI failures are resolved
Recently all CI builds using rust 1.44.1 have been failing on CI with the following error message: ``` error: failed to get `cargo_metadata` as a dependency of package `corrosion-generator v0.1.0 (/home/runner/work/corrosion/corrosion/generator)` Caused by: failed to fetch `https://github.com/rust-lang/crates.io-index` Caused by: error reading from the zlib stream; class=Zlib (5) CMake Error at cmake/Corrosion.cmake:427 (message): corrosion-generator failed: 101 Call Stack (most recent call first): test/cpp2rust/CMakeLists.txt:1 (corrosion_import_crate) ``` The relevant issue is probably rust-lang/cargo#8258. Starting with cargo 1.46 the CI failures are resolved
This appears to be an issue in cargo 1.44: rust-lang/cargo#8258
This appears to be an issue in cargo 1.44: rust-lang/cargo#8258
Problem
there maybe a bug in the latest cargo dependency repo of git2 which will lead to "error reading from the zlib stream" when fetch a certain repo (I don't know which of its group) in cargo build.
I have not detected why these happen, but I confirm that it is the git2 repo(0.12, 0.12+) in cargo dependency cause the error.
Steps
I have just one example to reproduce the error.
be patient, then you will get the error log.
Possible Solution(s)
I'm not familiar with libgit2, so I can't tell why this happen, only, I can tell the error come from git_packfile_stream_read in the libgit2/src/pack.c
Notes
Output of
cargo version
:I have tested cargo 1.43.1 even the latest cargo from source code (13bded9)
@wycats @halorgium @alex
The text was updated successfully, but these errors were encountered: