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

Spring hangs when it can't connect to the server. #265

Closed
jcoyne opened this Issue Feb 25, 2014 · 25 comments

Comments

Projects
None yet
@jcoyne

jcoyne commented Feb 25, 2014

It should have a timeout.

^C/Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client/run.rb:47:in `gets': Interrupt
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client/run.rb:47:in `verify_server_version'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client/run.rb:19:in `call'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client/command.rb:7:in `call'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client/rails.rb:23:in `call'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client/command.rb:7:in `call'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/client.rb:26:in `run'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/bin/spring:32:in `<top (required)>'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/binstub.rb:11:in `load'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.1.1/lib/spring/binstub.rb:11:in `<top (required)>'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/justin/.rbenv/versions/2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/justin/workspace/blacklight/spec/internal/bin/spring:16:in `<top (required)>'
    from bin/rails:3:in `load'
    from bin/rails:3:in `<main>'
@jcoyne

This comment has been minimized.

Show comment
Hide comment
@jcoyne

jcoyne Feb 25, 2014

This is happening when the project directory is moved.

jcoyne commented Feb 25, 2014

This is happening when the project directory is moved.

@jonleighton

This comment has been minimized.

Show comment
Hide comment
@jonleighton

jonleighton Feb 25, 2014

Member

Can you provide steps to reproduce please?

Member

jonleighton commented Feb 25, 2014

Can you provide steps to reproduce please?

@jcoyne

This comment has been minimized.

Show comment
Hide comment
@jcoyne

jcoyne Feb 26, 2014

I'm unable to reproduce this now. I was using the engine_cart gem, which generates a rails app in the tmpdir and then moves it. It does this to assist in testing rails engines, so it's always generating an app with the same application_id. Somehow the socket was getting blocked. Perhaps by an old version of the application? I think this is a pretty rare edgecase, so I'm closing it until I encounter it again.

jcoyne commented Feb 26, 2014

I'm unable to reproduce this now. I was using the engine_cart gem, which generates a rails app in the tmpdir and then moves it. It does this to assist in testing rails engines, so it's always generating an app with the same application_id. Somehow the socket was getting blocked. Perhaps by an old version of the application? I think this is a pretty rare edgecase, so I'm closing it until I encounter it again.

@jcoyne jcoyne closed this Feb 26, 2014

@demisx

This comment has been minimized.

Show comment
Hide comment
@demisx

demisx Apr 10, 2014

Same issue here. Running bin/spring just hangs. Ctrl + C spits out this:

[dmoore (feature-67890060-pull-syjdata-coldhouse)]$ bin/spring
^C/Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/run.rb:47:in `gets': Interrupt
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/run.rb:47:in `verify_server_version'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/run.rb:19:in `call'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/command.rb:7:in `call'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client.rb:26:in `run'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/bin/spring:48:in `<top (required)>'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/binstub.rb:5:in `load'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/binstub.rb:5:in `<top (required)>'
    from /Users/dmoore/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/dmoore/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from bin/spring:16:in `<main>'

Stopping and running it again seems fixes the issue:

$ spring stop
$ bin/spring

demisx commented Apr 10, 2014

Same issue here. Running bin/spring just hangs. Ctrl + C spits out this:

[dmoore (feature-67890060-pull-syjdata-coldhouse)]$ bin/spring
^C/Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/run.rb:47:in `gets': Interrupt
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/run.rb:47:in `verify_server_version'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/run.rb:19:in `call'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client/command.rb:7:in `call'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/client.rb:26:in `run'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/bin/spring:48:in `<top (required)>'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/binstub.rb:5:in `load'
    from /Users/dmoore/.rvm/gems/ruby-2.1.0@nplate-syjregs-api/gems/spring-1.1.2/lib/spring/binstub.rb:5:in `<top (required)>'
    from /Users/dmoore/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Users/dmoore/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from bin/spring:16:in `<main>'

Stopping and running it again seems fixes the issue:

$ spring stop
$ bin/spring
@kongr45gpen

This comment has been minimized.

Show comment
Hide comment
@kongr45gpen

kongr45gpen Apr 15, 2014

@demisx's solution worked for me, spring stopped working when I deleted the project's directory.

kongr45gpen commented Apr 15, 2014

@demisx's solution worked for me, spring stopped working when I deleted the project's directory.

@krukid

This comment has been minimized.

Show comment
Hide comment
@krukid

krukid May 10, 2014

@demisx same stuff happened when I renamed my rvm gemset, restarting spring helped

krukid commented May 10, 2014

@demisx same stuff happened when I renamed my rvm gemset, restarting spring helped

@demisx

This comment has been minimized.

Show comment
Hide comment
@demisx

demisx May 12, 2014

@krukid Glad it helped. I find myself needing to restart spring at least once a week or weird things start happening.

demisx commented May 12, 2014

@krukid Glad it helped. I find myself needing to restart spring at least once a week or weird things start happening.

@tomharrisonjr

This comment has been minimized.

Show comment
Hide comment
@tomharrisonjr

tomharrisonjr Jun 23, 2014

I am on spring 1.1.3 and just ran into this problem while running rails generate mailer Foo -- symptoms were a red herring, as it appeared to relate to a gem we are building, making it a long day of chasing my tail. Then spring started hanging.

If helpful, we're working on projects in Rails 4.0 and 4.1 at the same time (not to mention several rubies). Also using RubyMine for development.

tomharrisonjr commented Jun 23, 2014

I am on spring 1.1.3 and just ran into this problem while running rails generate mailer Foo -- symptoms were a red herring, as it appeared to relate to a gem we are building, making it a long day of chasing my tail. Then spring started hanging.

If helpful, we're working on projects in Rails 4.0 and 4.1 at the same time (not to mention several rubies). Also using RubyMine for development.

@relistan

This comment has been minimized.

Show comment
Hide comment
@relistan

relistan Aug 9, 2014

Installing carrierwave somehow caused this for me. Also had to stop spring.

relistan commented Aug 9, 2014

Installing carrierwave somehow caused this for me. Also had to stop spring.

@jdelStrother

This comment has been minimized.

Show comment
Hide comment
@jdelStrother

jdelStrother Aug 24, 2014

I think I know how to reproduce this - dump a load of stuff on STDOUT while the server is starting up. eg puts caller.inspect in config/application.rb. Clients trying to connect to spring will then hang on verify_server_version

jdelStrother commented Aug 24, 2014

I think I know how to reproduce this - dump a load of stuff on STDOUT while the server is starting up. eg puts caller.inspect in config/application.rb. Clients trying to connect to spring will then hang on verify_server_version

@shahidsidd

This comment has been minimized.

Show comment
Hide comment
@shahidsidd

shahidsidd Sep 25, 2014

it works thank you.

shahidsidd commented Sep 25, 2014

it works thank you.

@drymar

This comment has been minimized.

Show comment
Hide comment
@drymar

drymar Nov 3, 2014

It's help me too. Thanks 👍

$ spring stop
$ bin/spring

drymar commented Nov 3, 2014

It's help me too. Thanks 👍

$ spring stop
$ bin/spring

@romul

This comment has been minimized.

Show comment
Hide comment
@romul

romul Feb 10, 2015

Looks like this issue is still active for spring 1.3.1

romul commented Feb 10, 2015

Looks like this issue is still active for spring 1.3.1

@TheRealGuardDogGPS

This comment has been minimized.

Show comment
Hide comment
@TheRealGuardDogGPS

TheRealGuardDogGPS Jun 17, 2015

I am having this issue with Rails 4. I run rails destroy controller some_controller, which removes the controller and the associating view files, and things seemed fine. However, next day I picked up where I left off and I try to use the generate or destroy command again and it just hangs. I press ctr + c and it gives me this:

.rvm/gems/ruby-2.1.2@core/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `gets': Interrupt

Unfortunately spring stop does not work. It still hangs afterward.

TheRealGuardDogGPS commented Jun 17, 2015

I am having this issue with Rails 4. I run rails destroy controller some_controller, which removes the controller and the associating view files, and things seemed fine. However, next day I picked up where I left off and I try to use the generate or destroy command again and it just hangs. I press ctr + c and it gives me this:

.rvm/gems/ruby-2.1.2@core/gems/spring-1.1.3/lib/spring/client/run.rb:54:in `gets': Interrupt

Unfortunately spring stop does not work. It still hangs afterward.

@TheRealGuardDogGPS

This comment has been minimized.

Show comment
Hide comment
@TheRealGuardDogGPS

TheRealGuardDogGPS Jun 17, 2015

I had to reboot the computer!

TheRealGuardDogGPS commented Jun 17, 2015

I had to reboot the computer!

@ryanjones

This comment has been minimized.

Show comment
Hide comment
@ryanjones

ryanjones Jul 16, 2015

Just ran into this w/ spring (1.3.6) & rails (4.2.3).

@jonleighton - Here's the steps to reproduce the bug (make sure to have pry installed in your rails app):

  1. Put a binding.pry in config/environments/development.rb's config block
  2. Run bin/rails c (it will hang)
  3. Open a new terminal and kill that rails console process
  4. Remove binding.pry from config/environments/development.rb
  5. Run bin/rails c (it will hang forever) - Ctrl-C will drop the same backtrace as above

Let me know if you need any other details. I've been able to replicate it a few times now. spring stop worked for me and allowed me to to run bin/rails c successfully.

ryanjones commented Jul 16, 2015

Just ran into this w/ spring (1.3.6) & rails (4.2.3).

@jonleighton - Here's the steps to reproduce the bug (make sure to have pry installed in your rails app):

  1. Put a binding.pry in config/environments/development.rb's config block
  2. Run bin/rails c (it will hang)
  3. Open a new terminal and kill that rails console process
  4. Remove binding.pry from config/environments/development.rb
  5. Run bin/rails c (it will hang forever) - Ctrl-C will drop the same backtrace as above

Let me know if you need any other details. I've been able to replicate it a few times now. spring stop worked for me and allowed me to to run bin/rails c successfully.

@ismailfaruqi

This comment has been minimized.

Show comment
Hide comment
@ismailfaruqi

ismailfaruqi Oct 2, 2015

I am experiencing the same thing with @ryanjones ...

ismailfaruqi commented Oct 2, 2015

I am experiencing the same thing with @ryanjones ...

@skwp

This comment has been minimized.

Show comment
Hide comment
@skwp

skwp Oct 14, 2015

Experiencing spring hangs consistently when using spring rspec, typically on classes in a sub-mounted Grape application (we have an app/api subdirectory containing the grape app). Adding this directory using Spring.watch does not seem to help. The tests run once and hang the second time.

skwp commented Oct 14, 2015

Experiencing spring hangs consistently when using spring rspec, typically on classes in a sub-mounted Grape application (we have an app/api subdirectory containing the grape app). Adding this directory using Spring.watch does not seem to help. The tests run once and hang the second time.

@mmatusSVK

This comment has been minimized.

Show comment
Hide comment
@mmatusSVK

mmatusSVK Nov 11, 2015

It helps me too, but instead of $spring stop, I used $bin/spring stop :)

mmatusSVK commented Nov 11, 2015

It helps me too, but instead of $spring stop, I used $bin/spring stop :)

@kashif-umair

This comment has been minimized.

Show comment
Hide comment
@kashif-umair

kashif-umair Jan 19, 2016

@demisx, thanks. Your proposed solution worked like a charm for me :)

kashif-umair commented Jan 19, 2016

@demisx, thanks. Your proposed solution worked like a charm for me :)

@alienspaces

This comment has been minimized.

Show comment
Hide comment
@alienspaces

alienspaces May 22, 2016

Happened for me today @demisx solution worked. Would like to understand what is happening though as my tests were hanging..

$ ./bin/spring -v
Spring version 1.7.1
$ rails -v
Rails 5.0.0.rc1

alienspaces commented May 22, 2016

Happened for me today @demisx solution worked. Would like to understand what is happening though as my tests were hanging..

$ ./bin/spring -v
Spring version 1.7.1
$ rails -v
Rails 5.0.0.rc1
@bascoe10

This comment has been minimized.

Show comment
Hide comment
@bascoe10

bascoe10 Jul 11, 2016

installing has_secure_token caused this for me. Luckily I was able to find this thread.

bascoe10 commented Jul 11, 2016

installing has_secure_token caused this for me. Luckily I was able to find this thread.

@hbin

This comment has been minimized.

Show comment
Hide comment
@hbin

hbin Jul 24, 2016

Got hangs while creating app by my rails-boilerplate, run 'spring stop' before generate solve this.

hbin commented Jul 24, 2016

Got hangs while creating app by my rails-boilerplate, run 'spring stop' before generate solve this.

@fabiode

This comment has been minimized.

Show comment
Hide comment
@fabiode

fabiode Sep 5, 2016

happens with me every time I exchange branches in git using a binding.pry as well =(

fabiode commented Sep 5, 2016

happens with me every time I exchange branches in git using a binding.pry as well =(

@michaeldever

This comment has been minimized.

Show comment
Hide comment
@michaeldever

michaeldever Jul 22, 2017

I have had an issue like this: if I create a project, delete it, then create a project with the same name, the likes of rails g hangs.

spring stop; rails g; appears to resolve the issue.

michaeldever commented Jul 22, 2017

I have had an issue like this: if I create a project, delete it, then create a project with the same name, the likes of rails g hangs.

spring stop; rails g; appears to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment