Closed ljfranklin closed 7 years ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/140597563
The labels on this github issue will be updated when the story is started.
Hi @ljfranklin,
Are you running CATS on GCP? We believe this is a network-related issue with CF on GCP that should be addressed by determining and fixing the root cause, instead of covering it up with retry logic in the buildpack.
That said, this commit will go out in the next version of the buildpack and should cover up intermittent network failures encountered by bundler.
@sclevine thanks, we'll wait for the next buildpack and let you know if that fixes it. As an added data point, we are seeing this on AWS, not GCP.
We just saw another instance of this failure in our CI. You may not have access to the pipeline, so I will recapitulate it here:
[2017-03-30 01:12:36.38 (UTC)]> cf start CATS-5-APP-278c7697-bd24-4bb8-5
Starting app CATS-5-APP-278c7697-bd24-4bb8-5 in org CATS-5-ORG-6c996566-f58f-41d4-7 / space CATS-5-SPACE-e68ec644-9317-4f13-5 as CATS-USER-5-2017_03_30-01h11m34.753s...
Downloading ruby_buildpack...
Downloaded ruby_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (586.9K)
Staging...
-------> Buildpack version 1.6.35
Downloaded [file:///tmp/buildpacks/ece867b8643f45c531752f1be0e42ca6/dependencies/https___buildpacks.cloudfoundry.org_dependencies_bundler_bundler-1.14.5-248bdf35.tgz]
-----> Compiling Ruby/Rack
Downloaded [file:///tmp/buildpacks/ece867b8643f45c531752f1be0e42ca6/dependencies/https___buildpacks.cloudfoundry.org_dependencies_ruby_ruby-2.3.3-linux-x64-636d81f2.tgz]
-----> Using Ruby version: ruby-2.3.3
-----> Installing dependencies using bundler 1.14.5
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --jobs=4 --retry=4 --deployment
Installing rack 1.5.2
Installing tilt 1.4.1
Using bundler 1.14.5
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.
Bundler Output: Installing rack 1.5.2
Installing tilt 1.4.1
Using bundler 1.14.5
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
Successfully destroyed container
FAILED
BuildpackCompileFailed
This was running against an AWS environment on cf-release b51b26469620d88c56b13d5e672f7a1b18c2cd64, which by following through to ruby-buildpack-release looked like it was using v1.6.35
It might be worth filing this against bundler itself. Would you like to do that Tim (or I can)
On Thu, Mar 30, 2017 at 11:33 AM Tim Hausler notifications@github.com wrote:
We just saw another instance of this failure https://capi.ci.cf-app.com/teams/main/pipelines/capi/jobs/deploy-and-test-postgres-webdave-bridge/builds/151 in our CI. You may not have access to the pipeline, so I will recapitulate it here:
[2017-03-30 01:12:36.38 (UTC)]> cf start CATS-5-APP-278c7697-bd24-4bb8-5 Starting app CATS-5-APP-278c7697-bd24-4bb8-5 in org CATS-5-ORG-6c996566-f58f-41d4-7 / space CATS-5-SPACE-e68ec644-9317-4f13-5 as CATS-USER-5-2017_03_30-01h11m34.753s... Downloading ruby_buildpack... Downloaded ruby_buildpack Creating container Successfully created container Downloading app package... Downloaded app package (586.9K) Staging... -------> Buildpack version 1.6.35 Downloaded [file:///tmp/buildpacks/ece867b8643f45c531752f1be0e42ca6/dependencies/https_buildpacks.cloudfoundry.org_dependencies_bundlerbundler-1.14.5-248bdf35.tgz] -----> Compiling Ruby/Rack Downloaded [file:///tmp/buildpacks/ece867b8643f45c531752f1be0e42ca6/dependencies/httpsbuildpacks.cloudfoundry.org_dependencies_ruby_ruby-2.3.3-linux-x64-636d81f2.tgz] -----> Using Ruby version: ruby-2.3.3 -----> Installing dependencies using bundler 1.14.5 Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --jobs=4 --retry=4 --deployment Installing rack 1.5.2 Installing tilt 1.4.1 Using bundler 1.14.5 NameError: uninitialized constant Bundler::RubyGemsGemInstaller An error occurred while installing tilt (1.4.1), and Bundler cannot continue. Make sure that
gem install tilt -v '1.4.1'
succeeds before bundling. Bundler Output: Installing rack 1.5.2 Installing tilt 1.4.1 Using bundler 1.14.5 NameError: uninitialized constant Bundler::RubyGemsGemInstaller An error occurred while installing tilt (1.4.1), and Bundler cannot continue. Make sure thatgem install tilt -v '1.4.1'
succeeds before bundling. ! ! Failed to install gems via Bundler. ! Failed to compile droplet Exit status 223 Staging failed: Exited with status 223 Destroying container Successfully destroyed containerFAILED BuildpackCompileFailed
This was running against an AWS environment on cf-release b51b26469620d88c56b13d5e672f7a1b18c2cd64, which by following through to ruby-buildpack-release looked like it was using v1.6.35
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cloudfoundry/ruby-buildpack/issues/72#issuecomment-290448853, or mute the thread https://github.com/notifications/unsubscribe-auth/AGzElRz8gkTCiNNv9_vmNobLyy6_21Pzks5rq8tOgaJpZM4MLsWQ .
Are we sure this didn't just fail after 4 tries? If that's what happened, the only thing to report would be a confusing error message.
It seems very likely to me that the failure itself is a symptom of poor network connectivity on your AWS deployment, and not an issue with the buildpack or bundler.
FYI, we (CAPI) are still seeing this failure on our new(ish) GCP environments. We saw it twice today:
[2017-06-19 20:30:49.24 (UTC)]> cf start CATS-3-APP-3e409fca-6a4f-4feb-4
Starting app CATS-3-APP-3e409fca-6a4f-4feb-4 in org CATS-3-ORG-e64475b5-5d7b-4227-5 / space CATS-3-SPACE-a17b2c0d-fd1b-410f-7 as CATS-USER-3-2017_06_19-20h06m17.47s...
Staging app and tracing logs...
Successfully created container
Downloading app package...
Staging...
Downloaded app package (1.2M)
-------> Buildpack version 1.6.40
Downloaded [https://buildpacks.cloudfoundry.org/dependencies/bundler/bundler-1.15.0-72f4a679.tgz]
-----> Supplying Ruby/Rack
Downloaded [https://buildpacks.cloudfoundry.org/dependencies/ruby/ruby-2.4.1-linux-x64-9e451858.tgz]
-----> Using Ruby version: ruby-2.4.1
-------> Buildpack version 1.6.40
-----> Finalizing Ruby/Rack
-----> Installing dependencies using bundler 1.15.0
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --jobs=4 --retry=4 --deployment
Installing mustermann 1.0.0
Installing rack 2.0.3
Installing json 2.1.0 with native extensions
Using bundler 1.15.0
Installing tilt 2.0.7
An error occurred while installing rack (2.0.3), and Bundler cannot continue.
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
Make sure that `gem install rack -v '2.0.3'` succeeds before bundling.
In Gemfile:
Installing tilt 2.0.7
Installing json 2.1.0 with native extensions
Make sure that `gem install rack -v '2.0.3'` succeeds before bundling.
In Gemfile:
rack
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
rack-protection was resolved to 2.0.0, which depends on
sinatra was resolved to 2.0.0, which depends on
rack-protection was resolved to 2.0.0, which depends on
sinatra was resolved to 2.0.0, which depends on
rack
Bundler Output: Installing mustermann 1.0.0
Installing rack 2.0.3
Using bundler 1.15.0
An error occurred while installing rack (2.0.3), and Bundler cannot continue.
!
! Failed to install gems via Bundler.
!
and
[2017-06-19 20:02:10.91 (UTC)]> cf start CATS-3-APP-fa2f2bf2-3416-4766-4
Starting app CATS-3-APP-fa2f2bf2-3416-4766-4 in org CATS-3-ORG-bd75c66c-2b1f-45c2-7 / space CATS-3-SPACE-786b61ed-880a-4153-6 as CATS-USER-3-2017_06_19-19h52m17.241s...
Staging app and tracing logs...
Downloading ruby_buildpack...
Creating container
Downloaded ruby_buildpack
Downloading app package...
Successfully created container
Staging...
Downloaded app package (510.2K)
-------> Buildpack version 1.6.40
Downloaded [https://buildpacks.cloudfoundry.org/dependencies/bundler/bundler-1.15.0-72f4a679.tgz]
-----> Supplying Ruby/Rack
Downloaded [https://buildpacks.cloudfoundry.org/dependencies/ruby/ruby-2.4.1-linux-x64-9e451858.tgz]
-----> Using Ruby version: ruby-2.4.1
-------> Buildpack version 1.6.40
-----> Finalizing Ruby/Rack
-----> Installing dependencies using bundler 1.15.0
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --jobs=4 --retry=4 --deployment
Installing rack 1.5.2
Using bundler 1.15.0
Installing daemons 1.2.3
Installing eventmachine 1.0.7 with native extensions
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
In Gemfile:
Make sure that `gem install daemons -v '1.2.3'` succeeds before bundling.
thin was resolved to 1.6.3, which depends on
An error occurred while installing daemons (1.2.3), and Bundler cannot continue.
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
An error occurred while installing eventmachine (1.0.7), and Bundler cannot
thin was resolved to 1.6.3, which depends on
continue.
In Gemfile:
eventmachine
daemons
Make sure that `gem install eventmachine -v '1.0.7'` succeeds before bundling.
Bundler Output: Installing rack 1.5.2
Installing daemons 1.2.3
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
An error occurred while installing daemons (1.2.3), and Bundler cannot continue.
Using bundler 1.15.0
Installing eventmachine 1.0.7 with native extensions
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
thin was resolved to 1.6.3, which depends on
daemons
Make sure that `gem install daemons -v '1.2.3'` succeeds before bundling.
In Gemfile:
An error occurred while installing eventmachine (1.0.7), and Bundler cannot
Make sure that `gem install eventmachine -v '1.0.7'` succeeds before bundling.
continue.
thin was resolved to 1.6.3, which depends on
eventmachine
In Gemfile:
! Failed to install gems via Bundler.
!
!
Exit status 223
Failed to compile droplet
Staging failed: Exited with status 223
We push this simple ruby app with dependencies vendored every minute to a Cloud Foundry and see this failure intermittently:
[2017-07-11 09:59:33.94 (UTC)]> cf push -p ./assets/ruby_simple -b ruby_buildpack 676d8b23-271e-4766-7 -d cfapps.io --no-start
Creating app 676d8b23-271e-4766-7 in org cf-sli / space dev as cf-sli...
OK
Creating route 676d8b23-271e-4766-7.cfapps.io...
OK
Binding 676d8b23-271e-4766-7.cfapps.io to 676d8b23-271e-4766-7...
OK
Uploading 676d8b23-271e-4766-7...
Uploading app files from: /tmp/build/bd909ac8/app-asset/assets/ruby_simple
Uploading 54.3K, 10 files
Done uploading
OK
[2017-07-11 09:59:40.13 (UTC)]> cf start 676d8b23-271e-4766-7
Starting app 676d8b23-271e-4766-7 in org cf-sli / space dev as cf-sli...
Staging app and tracing logs...
Downloading ruby_buildpack...
Downloaded ruby_buildpack
Creating container
Successfully created container
Downloading app package...
Downloaded app package (586.2K)
-------> Buildpack version 1.6.42
Downloaded [file:///tmp/buildpacks/3ee19d5a12b4dc498b13df5a289a71ec/dependencies/https___buildpacks.cloudfoundry.org_dependencies_bundler_bundler-1.15.1-2803ca8e.tgz]
-----> Supplying Ruby/Rack
Downloaded [file:///tmp/buildpacks/3ee19d5a12b4dc498b13df5a289a71ec/dependencies/https___buildpacks.cloudfoundry.org_dependencies_ruby_ruby-2.4.1-linux-x64-9e451858.tgz]
-----> Using Ruby version: ruby-2.4.1
-------> Buildpack version 1.6.42
-----> Finalizing Ruby/Rack
not be shared between multiple checkouts of a single repo. Please
remove the `.bundle/` folder from your repo and add it to your `.gitignore` file.
###### WARNING:
You have the `.bundle/config` file checked into your repository
as well as configured git local gems, and other settings that should
-----> Installing dependencies using bundler 1.15.1
It contains local state like the location of the installed bundle
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --jobs=4 --retry=4 --deployment
Installing tilt 1.4.1
Using bundler 1.15.1
Installing rack 1.5.2
Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
In Gemfile:
sinatra was resolved to 1.4.3, which depends on
tilt
Installing tilt 1.4.1
Using bundler 1.15.1
NameError: uninitialized constant Bundler::RubyGemsGemInstaller
An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
In Gemfile:
Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.
sinatra was resolved to 1.4.3, which depends on
Bundler Output: Installing rack 1.5.2
tilt
Failed to compile droplet
! Failed to install gems via Bundler.
!
!
Exit status 223
Destroying container
Successfully destroyed container
Error staging application: App staging failed in the buildpack compile phase
FAILED
@SocalNick Nice find! This rules out network flakiness when downloading the gem. This means that the error is likely a race condition inside Bundler that we should report upstream.
@dgodd ^^
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/148684647
The labels on this github issue will be updated when the story is started.
@SocalNick @sclevine The problem is that I have never been able to repeat the problem outside of CATs. I have run large experiments. We could try running bundler for a day on GCP to see if we can repeat the problem. I think we are at the same point as before, there is a bug in bundler but we can't reproduce it outside CATs. I will try running a huge number of bundle installs
on a GCP instance with the ruby_simple
fixture
In case it's helpful, PCF RelEng has been seeing these issues with ruby buildpack 1.6.44:
Connected, dumping recent logs for app CATS-7-APP-c8973d4d-e724-4703-7 in org CATS-7-ORG-450bf5b4-fc13-4c10-7 / space CATS-7-SPACE-0e1484a0-d6cb-450f-4 as CATS-USER-7-2017_07_20-05h52m46.358s...
2017-07-20T05:54:48.46+0000 [API/0] OUT Created app with guid bfc04858-4d3a-4bf8-8e0a-6a37c5e08e2d
2017-07-20T05:54:48.67+0000 [API/0] OUT Updated app with guid bfc04858-4d3a-4bf8-8e0a-6a37c5e08e2d ({"route"=>"f63e3b3c-26a9-4d4f-9c9d-d68086e7f0db", :verb=>"add", :relation=>"routes", :related_guid=>"f63e3b3c-26a9-4d4f-9c9d-d68086e7f0db"})
2017-07-20T05:54:54.32+0000 [API/0] OUT Updated app with guid bfc04858-4d3a-4bf8-8e0a-6a37c5e08e2d ({"diego"=>true})
2017-07-20T05:54:55.30+0000 [API/0] OUT Updated app with guid bfc04858-4d3a-4bf8-8e0a-6a37c5e08e2d ({"state"=>"STARTED"})
2017-07-20T05:54:55.35+0000 [STG/0] OUT Downloading ruby_buildpack...
2017-07-20T05:54:55.39+0000 [STG/0] OUT Downloaded ruby_buildpack
2017-07-20T05:54:55.39+0000 [STG/0] OUT Creating container
2017-07-20T05:54:55.94+0000 [STG/0] OUT Successfully created container
2017-07-20T05:54:55.94+0000 [STG/0] OUT Downloading app package...
2017-07-20T05:54:56.12+0000 [STG/0] OUT Downloaded app package (592.5K)
2017-07-20T05:54:56.12+0000 [STG/0] OUT Staging...
2017-07-20T05:54:56.85+0000 [STG/0] OUT -------> Buildpack version 1.6.44
2017-07-20T05:54:57.24+0000 [STG/0] OUT Downloaded [file:///tmp/buildpacks/f0f54c7cba6044b3731e5953bf69d12b/dependencies/https___buildpacks.cloudfoundry.org_dependencies_bundler_bundler-1.15.1-2803ca8e.tgz]
2017-07-20T05:54:57.34+0000 [STG/0] OUT -----> Supplying Ruby/Rack
2017-07-20T05:54:58.11+0000 [STG/0] OUT Downloaded [file:///tmp/buildpacks/f0f54c7cba6044b3731e5953bf69d12b/dependencies/https___buildpacks.cloudfoundry.org_dependencies_ruby_ruby-2.4.1-linux-x64-9e451858.tgz]
2017-07-20T05:54:58.93+0000 [STG/0] OUT -----> Using Ruby version: ruby-2.4.1
2017-07-20T05:54:59.69+0000 [STG/0] OUT -------> Buildpack version 1.6.44
2017-07-20T05:55:00.00+0000 [STG/0] OUT -----> Finalizing Ruby/Rack
2017-07-20T05:55:00.18+0000 [STG/0] OUT -----> Installing dependencies using bundler 1.15.1
2017-07-20T05:55:00.35+0000 [STG/0] OUT Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --jobs=4 --retry=4 --deployment
2017-07-20T05:55:01.01+0000 [STG/0] OUT Installing rack 1.5.2
2017-07-20T05:55:01.01+0000 [STG/0] OUT Installing tilt 1.4.1
2017-07-20T05:55:01.01+0000 [STG/0] OUT Using bundler 1.15.1
2017-07-20T05:55:02.06+0000 [STG/0] OUT NameError: uninitialized constant Bundler::RubyGemsGemInstaller
2017-07-20T05:55:02.06+0000 [STG/0] OUT An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
2017-07-20T05:55:02.06+0000 [STG/0] OUT Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.
2017-07-20T05:55:02.06+0000 [STG/0] OUT In Gemfile:
2017-07-20T05:55:02.06+0000 [STG/0] OUT sinatra was resolved to 1.4.3, which depends on
2017-07-20T05:55:02.06+0000 [STG/0] OUT tilt
2017-07-20T05:55:02.07+0000 [STG/0] OUT Bundler Output: Installing rack 1.5.2
2017-07-20T05:55:02.07+0000 [STG/0] OUT Installing tilt 1.4.1
2017-07-20T05:55:02.07+0000 [STG/0] OUT Using bundler 1.15.1
2017-07-20T05:55:02.07+0000 [STG/0] OUT NameError: uninitialized constant Bundler::RubyGemsGemInstaller
2017-07-20T05:55:02.07+0000 [STG/0] OUT An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
2017-07-20T05:55:02.07+0000 [STG/0] OUT Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.
2017-07-20T05:55:02.07+0000 [STG/0] OUT
2017-07-20T05:55:02.07+0000 [STG/0] OUT In Gemfile:
2017-07-20T05:55:02.07+0000 [STG/0] OUT sinatra was resolved to 1.4.3, which depends on
2017-07-20T05:55:02.07+0000 [STG/0] OUT tilt
2017-07-20T05:55:02.07+0000 [STG/0] OUT !
2017-07-20T05:55:02.07+0000 [STG/0] OUT ! Failed to install gems via Bundler.
2017-07-20T05:55:02.07+0000 [STG/0] OUT !
2017-07-20T05:55:02.08+0000 [STG/0] ERR Failed to compile droplet
2017-07-20T05:55:02.08+0000 [STG/0] OUT Exit status 223
2017-07-20T05:55:02.10+0000 [STG/0] ERR Staging failed: Exited with status 223
2017-07-20T05:55:02.10+0000 [STG/0] OUT Destroying container
2017-07-20T05:55:02.49+0000 [STG/0] OUT Successfully destroyed container
We have more logs, but will wait to post unless they would be useful. Let us know!
Raina and @joshzarrabi
I have reported this upstream to bundler
@dgodd, have y'all been trying to reproduce the problem with bundler, or in the context of the the ruby buildpack?
I've been trying to reproduce in a docker container set up to be the same as the ruby buildpack staging, just before running bundler. I want an example that I can give to bundler for them to run. Interestingly it is also not an error we personally ever see when running cats.
On Tue, Jul 25, 2017, 2:44 AM Jesse Thomas Alford notifications@github.com wrote:
@dgodd https://github.com/dgodd, have y'all been trying to reproduce the problem with bundler, or in the context of the the ruby buildpack?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudfoundry/ruby-buildpack/issues/72#issuecomment-317645140, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHtTWFBwdV5G_mZ663M-YgGAC9Kt3lbks5sRY6tgaJpZM4MLsWQ .
This flake was determined to be an upstream issue with ruby-core, due to a race condition with autoload. Future Ruby 2.3 and 2.4 versions should address this. See this ruby-core bug for details.
For a workaround, see this PR.
In the future, please feel free to report issues with Ruby, Bundler, etc. upstream directly, especially when the buildpacks team is unable to reproduce them.
What version of the buildpack you are using?
Ruby buildpack -
Buildpack version 1.6.34
.If you were attempting to accomplish a task, what was it you were attempting to do?
The ruby buildpack intermittently fails to compile eventmachine with bundler. We've seen this a few times when running CATS, but very rarely. This might be a 1 in a 100 type error during app pushes.
Error output