Skip to content
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

Handle ERROR: While executing gem ... (Zlib::BufError)? #31

Open
dentarg opened this issue Jul 5, 2022 · 7 comments
Open

Handle ERROR: While executing gem ... (Zlib::BufError)? #31

dentarg opened this issue Jul 5, 2022 · 7 comments

Comments

@dentarg
Copy link
Contributor

dentarg commented Jul 5, 2022

I've seen this happening a couple of times:

Run gem install gem-compare --version 1.1.0
Successfully installed rainbow-3.1.1
Successfully installed gemnasium-parser-0.1.9
Successfully installed diffy-3.4.2
Successfully installed gem-compare-1.1.0
4 gems installed
Run gem compare $COMPARE_GEM $COMPARE_FROM_VERSION $COMPARE_TO_VERSION > compare_output.txt
NOTE: Gem::Specification#has_rdoc is deprecated with no replacement. It will be removed in Rubygems 4
Gem::Specification#has_rdoc called from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/gem-compare-1.1.0/lib/rubygems/comparator/utils.rb:112.
NOTE: Gem::Specification#has_rdoc is deprecated with no replacement. It will be removed in Rubygems 4
Gem::Specification#has_rdoc called from /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/gems/3.1.0/gems/gem-compare-1.1.0/lib/rubygems/comparator/utils.rb:112.
Run gem compare --diff $COMPARE_GEM $COMPARE_FROM_VERSION $COMPARE_TO_VERSION > compare_diff.txt
ERROR:  While executing gem ... (Zlib::BufError)
    buffer error

This is probably not the fault of this plugin, rather a temporary transport/network issue. Maybe rubygems.org does some rate limiting. Nevertheless, it would be cool to handle it, if possible.

We can see that the first gem compare command worked, is the second one fetching the gems again from RubyGems.org?

GitHub Actions log at https://github.com/Starkast/wikimum/runs/7173057743?check_suite_focus=true#step:2:454

(I've made an action that runs this plugin on Dependabot PRs and makes comment with the comparison, https://github.com/dentarg/gem-compare)

@strzibny
Copy link
Member

Do you have a suggestion on how to address this?

@dentarg
Copy link
Contributor Author

dentarg commented Jul 17, 2022

Not yet :)

dentarg added a commit to dentarg/gem-compare that referenced this issue Jul 30, 2022
Try to make the action more stable (main issue is fedora-ruby/gem-compare#31)
dentarg added a commit to dentarg/gem-compare that referenced this issue Jul 30, 2022
Try to make the action more stable (main issue is fedora-ruby/gem-compare#31)
@dentarg
Copy link
Contributor Author

dentarg commented Sep 26, 2022

For now I've worked around this issue with retries outside gem compare.

@dentarg
Copy link
Contributor Author

dentarg commented Sep 19, 2023

Maybe ruby/zlib#61 will make a difference for this (just a guess)

@martinemde
Copy link

martinemde commented Sep 19, 2023

Could you try with the latest rubygems? We recently added something that will give a better report when a file reaches an eof unexpectedly. It might at least reveal if this is a problem with the downloaded file.

For what it's worth, gem-compare is simply calling Gem::Package#extract_files. It's not doing anything "fancy" so this is either internal to rubygems, or zlib (as you mentioned) or caused by network issues when downloading.

@strzibny
Copy link
Member

Yes, it would be better to open an issue in RubyGems and/or Zlib, and just link the issue.

@dentarg
Copy link
Contributor Author

dentarg commented Sep 20, 2023

Could you try with the latest rubygems?

I'm not running gem compare by hand, I'm using my action https://github.com/dentarg/gem-compare to run it on Dependabot PRs. It uses whatever RubyGems setup-ruby picks, https://github.com/ruby/setup-ruby#rubygems, which seems to be the RubyGems that comes with Ruby.

Here's a recent run using Ruby 3.1.4 where the problem still showed: https://github.com/Starkast/wikimum/actions/runs/6154045239/job/16698800533#step:2:85

Here's a recent run using Ruby 3.2.2 where the problem still showed:
https://github.com/dentarg/burd/actions/runs/5905770058/job/16020494333#step:2:95

Looks like Ruby 3.2.2 ships with RubyGems 3.4.10? Is that recent enough?

I guess I could always install the latest RubyGems at the cost of somewhat slower CI runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants