Skip to content

run bundler with --retry to avoid network dodginess - #21

Closed
pivotalfish wants to merge 1 commit into
cloudfoundry:masterfrom
pivotal-cf:master
Closed

pivotalfish wants to merge 1 commit into
cloudfoundry:masterfrom
pivotal-cf:master

Conversation

@pivotalfish

Copy link
Copy Markdown

We used to run bundle package prior to uploading our app to PWS - this seems to have stopped working and we've been battling some flakiness with our builds as a result.

A handy workaround is to make bundler retry if fetching fails - our app uses quite a few gems, and this seems to fix sporadic flakiness we experience when pushing.

@cfdreddbot

Copy link
Copy Markdown

Hey pivotalfish!

Thanks for submitting this pull request!

All pull request authors must have a Contributor License Agreement (CLA) on-file with us. Please sign the appropriate CLA (individual or corporate).

When sending signed CLA please provide your github username in case of individual CLA or the list of github usernames that can make pull requests on behalf of your organization.

@cf-gitbot

Copy link
Copy Markdown

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/78643382.

@squeedee

Copy link
Copy Markdown
Contributor

Hi PivotalFish!

Thanks for the PR.

Firstly, I am reticent to take this pull request. It's a patch for a deeper issue, which is, we'd like this to not be necessary.

Can you attach logs of the failure mode for us? Anything that could help us identify what kind of flakiness is occurring.

I'll get @chwu-cf at PWS to look into this.

@pivotalfish

Copy link
Copy Markdown
Author

We deploy a large Rails apps which depends on 237 gems in total (this includes the development and test groups) to PWS.

The error we see is that staging the app fails - we upload the app and successfully start a bundler run, which then terminates abruptly. We don't get much useful error output - the output from CF_TRACE shows the cf cli client polling the API endpoint and getting 400s (an odd HTTP code for I'm busy), and then giving up at some point.

The deeper issue is that requests to endpoints over the internet may arbitrary fail and rubygems.org may not successfully respond to every HTTP ever - if you can think of a good workaround for

An alternate approach is to run bundle package in your application prior to cf push - this is will pull down all the gems your app uses into vendor/cache. I'm not sure it guarantees bundler won't try to connect to rubygems.org however. Having --retry <num> for a suitable value of num fixes this for most cases.

@jchesterpivotal

Copy link
Copy Markdown
Contributor

Per discussion this morning, we're recommending vendoring as the best workaround when this issue occurs, as well as kicking the question of connectivity up to our mates in PWS.

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

Successfully merging this pull request may close these issues.

5 participants