Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Timeout for network operations #505

wincent opened this Issue · 14 comments

13 participants

Greg Hurrell Andrew Premdas Alex Chaffee Justin Guten Ye Brett Richardson Chris Apolzon Andy Peters Simon Hildebrandt SixArm Rohit Arondekar Ryan Pavlik Xavier Shay
Greg Hurrell

I often find that Bundler hangs indefinitely waiting for a network operation to complete (at least, I think that it's a network operation because things like bundle check which don't hit the network never hang, whereas things like bundle install and bundle update hang all the time).

A typical example: clone the Rails repo (fresh clone, no Gemfile.lock yet) and do bundle install:

Updating git://
Fetching source index for
Using rake (0.8.7) 
Using abstract (1.0.0) 
Using nokogiri (1.4.2) 
Using pg (0.9.0) 

At that point it just hangs for four minutes. I generally have to CTRL-C these operations and keep retrying until they succeed. I retry again, it hangs at "Using pg", and this time continues on to "Using thor" and succeeds.

I guess what I want here is either one of two things:

  • either, it would be great if Bundler could just time out after a minute so that I could see that the reason things failed is because of a network problem and not a bug in Bundler
  • or, Bundler could accept a --verbose switch which would print out in more detail what it is actually doing

It's not clear to me why it should hang at "pg" like that for several minutes. What was it trying to do? The pg gem is already installed on the system, as is thor, so it doesn't seem like it should be trying to fetch them. And because Bundler catches the Interrupt when I press CTRL-C, I can't see a backtrace to know where/what it was doing during the hang.

I'm running Little Snitch here, so I could see that at the beginning of the bundle install it makes an outbound connection (right after printing "Fetching source index for"). Then after hanging for several minutes it makes another. Both of these connections go to amazon hosts, seeing as that's where gemcutter hosts. So yes, it definitely does seem network related.

Anyway, the exact example here doesn't really matter, as it's something I've seen in various projects across several versions of Bundler.

What do you think about adding a network timeout and/or a --verbose switch?


Andrew Premdas

+1 getting same issue, a verbose switch would be great, or is their a log file?

Alex Chaffee

Assuming it really is stalling out during the fetch, another option would be to locally cache the source index, then expire it after, say, an hour or a day so it wouldn't get too stale. I do a lot of rvm stuff and it's quite annoying having to wait when I know that it just fetched the darn index...


+1 This is a really annoying problem

Guten Ye

+1 bundle install or update when dependency changed is too slow,
it takes 6 minute!!! in a small rails project. It's annoying.

I don't know why it slow, can someone analyze it?, and improve it.

Brett Richardson

+1, my bundler is timing out completely, and I can't get anything deployed!

Chris Apolzon

Bundle update is hanging, but issuing a bundle update somegem works fine. I second the request for a verbose flag and/or log file.


+1 having the same problem. Ruby 1.9.2, Rails 3, typical Gemfile.

Doing "bundle install" prints "Fetching source index for"

Then hangs. Installing each gem using "gem install" works fine.

Rohit Arondekar

Guys, is this still an issue with Bundler 1.1.1?

Ryan Pavlik

Still an issue with 1.2.4 - explanation linked by @SixArm looks intriguing.

Ryan Pavlik

Ah, sorry about that, apparently I was somehow mixing bundler versions. 1.2.4 seems to move quickly - at least it has progress indicators.

Xavier Shay

Closing this because:

  • New bundler API alleviates much of the problem.
  • We are actively working on improving that further.

Patches welcome for timeout or verbose options.

Xavier Shay xaviershay closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.