-
Notifications
You must be signed in to change notification settings - Fork 7
"Gem Not Found" errors using Bundler against Nexus Rubygems.org cache with fresh index #55
Comments
what do you do when you say: 'a fresh re-build of the rubygems.org cache' also curious where the maybe a sample of a broken activesupport.json.rz would be great to see as well. |
The root cause seems to be that bundler API results are being treated as artifacts, so if we have a high TTL on artifacts (which we want), the bundler API responses are cached for that long too, even if new versions of gems were released upstream. It seems to me like bundler API should be handled differently from everything else. |
the artifact max age is meant for the gems and gemspec.rz files. the metadata max age is meant for the volatile files like specs.4.8.gz and those api/v1/dependencies/*json.rz files there was an issue before version 1.4.1 with those dependencies files. I personally use:
maybe the default of metadata max age to 1440 needs something more practical. could please check you metadata max age ! |
Both are set to low values right now (60 iirc). Changing the artifact max age from -1 to an hour worked around this issue for us. It really appears that bundler API is being treated as artifacts and not metadata. I agree it should be treated as metadata, but that doesn't seem to be the case. |
OK - maybe it is the nexus version - let's me see if I can reproduce it with nexus 2.9.1-02 |
indeed in case the metadata max age was bigger then artifact max age then the artifact max age: was also used for the bundler API files. this will be fixed with the release I am about to prepare. BUT setting artifact max age: -1 and metadata max age: 60 should also produce the desired effect with your version of the plugin. I tested the old logic against a freshly pushed gem to rubygems.org having artifact max age: -1 please check if |
Those were the original settings we were using when we encountered this error |
hmm. maybe the using the just released nexus-plugin where I improved the logic to decide what is out dated does do the trick. http://search.maven.org/remotecontent?filepath=org/sonatype/nexus/plugins/nexus-ruby-plugin/1.4.4/nexus-ruby-plugin-1.4.4-bundle.zip in case the error persists on your side, please feel free to reopen the issue and I will have another look. |
Thanks for the quick response and patch! Unfortunately, we're still encountering this issue for gem updates after updating our installation to Nexus 2.10.0-02 and the ruby plugin 1.4.4 bundle. Removing the metadata files (gem.json.rz) and forcing a repair/update of the rubygems.org cache repository lets us work around the problem. We can re-create the issue by publishing a gem to rubygems.org, allowing Nexus cache to refresh on its own (30m currently), publishing an update to the same gem, allowing the cache to refresh, and attempting a bundle install (returning with "Could not find rubygem-1.2.3 in any of the sources"). Of course, I forgot to save a copy of the affected json.rz file before blowing it away, so I'll be more vigilant to provide that next time we encounter it. |
thanx for the detailed info I will try to reproduce it. |
I finally have a tarball containing copies of the json.rz metadata for i18n and cane gems during our last encounter with this behavior. What is the preferred method to transfer this over? |
if you have dropbox account or just send it via email (if the size works): meier.kristian@gmail.com |
@chriseckhardt thanx for the files: they are identical to
which they suppose to be. are you using a group-rubygems repo or just the proxy directly ? |
We have both a rubygems.org cache and an internal gem repository of in-house gems |
still not able to reproduce it. my test setup:
my test was basically: this works for me. in the 1.4.x branch I added one extra line 6b65a35#diff-120b4d0544221e6e66b6764d3f74ef6fR125 which might help to shed some light on the issue. further it would be nice to see both the output of |
I'm in the process of searching for a currently affected project to capture the bundle install output and will submit it as soon as I can. A couple more points of information: "Rebuilding Index" and "Update Index" from the Repositories context menu (right-click) don't seem to actually work as advertised. Logs show that the tasks start then end immediately. We've had to kick off a "Rebuild Rubygems Metadata Files" from Scheduled Tasks to actually rebuild the index (our cached proxy of rubygems.org took a little under 10 minutes). Secondly, I'm not sure if this is related but I'll report it here in spirit with the DEBUG message imbedded in the exception:
|
I just sent a gzipped snapshot of logs from a Appreciate your help, -C |
sorry this took a while. I back ported the current codebase on nexus-oss to this repo. there are lots of big fixes all over the place including the area where you saw problems. please find the released plugin bundle.zip on http://repo1.maven.org/maven2/org/sonatype/nexus/plugins/nexus-ruby-plugin/1.5.0/ |
Going to try this out after the holiday and will report back in our results. |
We've updated Nexus OSS to 2.11.0, and the error logs look a lot less chatty, now. So far, we haven't encountered this issue, so closing for now and will re-open if we run into this behavior again. Thanks! |
After a fresh re-build of the rubygems.org cache, which we proxy with Nexus via the
nexus-ruby-plugin, users receive the following error for arbitrary gems
(activesupport is a common offender, for example):
As a fix, we are manually removing the offending gems (triggering a re-index)
from the following location:
We have also set the Artifact Max Age to 60 minutes and are observing to see if
this behavior continues.
System specs (server and clients):
CentOS release 6.5.el6.centos.11.2.x86_64
2.6.32-431.5.1.el6.x86_64
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
Nexus version 2.9.1-02
nexus-ruby-support-1.4.1
bundler version 1.7.3
The text was updated successfully, but these errors were encountered: