Errno::ECONNREFUSED in WorksController#index

555 views
Skip to first unread message

jkoral

unread,
May 6, 2013, 6:20:08 PM5/6/13
to bib...@googlegroups.com
Finally, I think I worked through all the errors, but I am stuck on one. I am receiving the above error when going to localhost from firefox locally on the server. Also, I worked on one virtual server and thought maybe I messed something up, but I totally re-built a new server and worked through all the issues and finally ended up at this point again. Any help you can provide would be greatly appreciated.

Here are the details of the versions of products I have:

ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
gem 1.8.25
CentOS release 6.4 (Final)

Here are the details on the error:

Errno::ECONNREFUSED in WorksController#index

Connection refused - connect(2)

RAILS_ROOT: /root/bibapp

Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
/usr/lib/ruby/1.8/net/http.rb:560:in `open'
/usr/lib/ruby/1.8/net/http.rb:560:in `connect'
/usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
/usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
/usr/lib/ruby/1.8/net/http.rb:560:in `connect'
/usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
/usr/lib/ruby/1.8/net/http.rb:542:in `start'
/usr/lib/ruby/1.8/net/http.rb:1035:in `request'
/usr/lib/ruby/1.8/net/http.rb:845:in `post'
/usr/lib64/ruby/gems/1.8/gems/solr-ruby-0.0.8/lib/solr/connection.rb:158:in `post'
/usr/lib64/ruby/gems/1.8/gems/solr-ruby-0.0.8/lib/solr/connection.rb:151:in `send'
/root/bibapp/app/models/index.rb:263:in `fetch'
/root/bibapp/app/controllers/application_controller.rb:111:in `search'
/root/bibapp/app/controllers/works_controller.rb:107:in `index'

Request

Parameters:

{"sort"=>"created_at"}

Show session dump

Response

Headers:

{"Content-Type"=>"",
 "Cache-Control"=>"no-cache"}

Jason Stirnaman

unread,
May 7, 2013, 10:34:37 AM5/7/13
to bib...@googlegroups.com
Joseph,
Ruby is unable to connect to Solr. Is Solr running? You can check by visiting http://localhost[:port]/solr/admin or from the command line with ps -ef | grep solr

If Solr isn't running then from your BibApp directory you need to run bundle exec rake bibapp:start  


Report back any errors to the list if you have questions.

Jason


--
You received this message because you are subscribed to the Google Groups "bibapp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bibapp+un...@googlegroups.com.
To post to this group, send email to bib...@googlegroups.com.
Visit this group at http://groups.google.com/group/bibapp?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Joseph Koral

unread,
May 7, 2013, 3:07:47 PM5/7/13
to bib...@googlegroups.com
Yes, solr is running. I am able to get to the admin page on port 8982, which is development. But I am not able to get to it on port 8983, which is production. That is another thing I am confused by, how can I make one server development and another server production? When I take out all the production settings, I get errors that there is no production database.

But one thing at a time I guess. Thanks for responding and for any help you can provide.

Joe


--
You received this message because you are subscribed to a topic in the Google Groups "bibapp" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bibapp/HA0jGe53ybU/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to bibapp+un...@googlegroups.com.

Jason Stirnaman

unread,
May 7, 2013, 4:02:27 PM5/7/13
to bib...@googlegroups.com
Yes, solr is running. I am able to get to the admin page on port 8982
Do you get a successful response for a query at solr/admin?
If so...
It may be that Ruby isn't resolving the hostname or address that's set in config/initializers/solr.rb
Which version of BibApp are you on?

Jason

Jason Stirnaman

unread,
May 7, 2013, 4:10:58 PM5/7/13
to bib...@googlegroups.com
Also, is your web server (WebBrick, Thin, etc.) running as the same environment (development, production) as you started BibApp with?
how can I make one server development and another server production?
Specify it on the commandline when you startup bibapp:
bundle exec rake bibapp:start RAILS_ENV=development

Then, startup up your web server with the same environment, e.g. 
bundle exec rails s -e development

Jason

Joseph Koral

unread,
May 9, 2013, 3:29:34 PM5/9/13
to bib...@googlegroups.com
Can you give me an example query to run? Also, there is no data in there yet. I have been just trying to get the software working. Then another team will be uploading the data.

Joseph Koral

unread,
May 9, 2013, 3:34:18 PM5/9/13
to bib...@googlegroups.com
I am using Apache as my web server. Is there a specific way I need to start that?

Joseph Koral

unread,
May 9, 2013, 3:41:26 PM5/9/13
to bib...@googlegroups.com
Also, here are the instructions I followed to get where I am. Is anything missing out of these?

Jason Stirnaman

unread,
May 9, 2013, 5:04:33 PM5/9/13
to bib...@googlegroups.com
First, which version of BibApp are you on? You should follow the current instructions at 
and

To test, I would recommend trying to connect with rails server first, then move on to Apache if that works, e.g.
bundle exec rake bibapp:start RAILS_ENV=development
bundle exec rails s -e development [-p port]

If that doesn't work then there may be a hostname problem where ruby can't resolve the Solr address.

If it does work, but Apache/mod_passenger still doesn't work then passenger's likely not running with the same environment, i.e. trying to connect to Solr's development port when Solr's actually running on the production port.

By default, mod_passenger starts up in production. You can change that in your Apache config (virtualhost) by specifying
RailsEnv <string> 

Jason

Joseph Koral

unread,
May 10, 2013, 1:19:52 PM5/10/13
to bib...@googlegroups.com
Jason:
I just pulled down the latest code using "svn checkout http://bibapp.googlecode.com/svn/trunk/ ~/bibapp/" So to be honest, I am not sure what version it is. I am trying to go through the instructions right now and will give you an update. I have a feeling I may need to start from scratch.

By the way, I really appreciate the time you are putting in to help me out.

Joe

fur...@gmail.com

unread,
May 10, 2013, 3:27:20 PM5/10/13
to bib...@googlegroups.com
Hi,

I'm almost certain that code is well out of date.  You should get the latest from https://github.com/bibapp/bibapp

And the docs on github as well at https://github.com/bibapp/bibapp/wiki

Jason Stirnaman

unread,
May 10, 2013, 4:10:42 PM5/10/13
to bib...@googlegroups.com
What John said, definitely. That code is out of date. The problem you're having should go away if you use a more recent release from Github.

Bill or Howard, I would vote to redirect from the Google Code project to Github, or remove it altogether.

Jason

Joseph Koral

unread,
May 15, 2013, 2:58:14 PM5/15/13
to bib...@googlegroups.com
There seems to be a lot missing from the instructions. Do any of you have a more details set of instructions that I can follow? I am very linux savvy, but am very unfamiliar with bibapp and the packages it uses.

Right now, I am stuck at bundle install and here is the error I am getting:

Installing libxml-ruby (0.8.3) 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
extconf.rb:6:in `method_missing': uninitialized constant Config (NameError)
from extconf.rb:6:in `set_encoding'
from extconf.rb:6:in `method_missing'
from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `set_encoding'
from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from extconf.rb:14:in `<main>'


Gem files will remain installed in /usr/local/rvm/gems/ruby-2.0.0-p0/gems/libxml-ruby-0.8.3 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.0.0-p0/gems/libxml-ruby-0.8.3/ext/libxml/gem_make.out

An error occurred while installing libxml-ruby (0.8.3), and Bundler cannot continue.
Make sure that `gem install libxml-ruby -v '0.8.3'` succeeds before bundling.

Jason Stirnaman

unread,
May 16, 2013, 11:06:24 AM5/16/13
to bib...@googlegroups.com
Any luck? What happens if you run gem install libxml-ruby -v '0.8.3' ?
It likely can't find one of the dependencies on your system.

Jason

Joseph Koral

unread,
May 20, 2013, 11:41:55 AM5/20/13
to bib...@googlegroups.com
OK, I think we worked through all the issues. For some reason it is not sending mail now though. The mail worked fine with the previous version I had.

Can you let me know what the best practices are regarding development vs production? Our plan is to have a development server, which is virtual and then the production server would be a physical server. Is that what you would suggest? How does data get pushed from one to the other?

Thanks again for all your help.

Joe


Joseph Koral

unread,
May 20, 2013, 11:58:25 AM5/20/13
to bib...@googlegroups.com
Sorry, one other thing. I am ssh'd into the server and run the following commands to start the service, but as soon as I exit, the process stops. I am even using an & at the end of the command. 

bundle exec rake bibapp:start RAILS_ENV=development &
bundle exec rails s -e development -p 3000 &

Jason Stirnaman

unread,
May 21, 2013, 8:56:05 AM5/21/13
to bib...@googlegroups.com

Joe,
It's perfectly fine to run your production app on a virtual machine. That's pretty much the norm these days. We've been using Rackspace for ours. More importantly, you''ll want at least 2gb of RAM for Solr and a decent CPU for Ruby.
We do all our data management on the production instance. I would recommend starting with that and then scaling out and up as you need. Development environment is for developing on your local machine, etc. See the Rails guides on this topic.
You can start rails server with -d to daemonize it.

Joseph Koral

unread,
May 23, 2013, 12:46:10 PM5/23/13
to bib...@googlegroups.com
Any idea what I can check for regarding the mail not being sent?

Jason Stirnaman

unread,
May 23, 2013, 2:20:54 PM5/23/13
to bib...@googlegroups.com

I think development environment is configured to not send emails by default. You can config/environments/development.rb
Does it still send when started as production?
I meant to add earlier that you probably shouldn't use rails server for your live, production app. I think you mentioned using Apache and mod_rails which is a good way to go. Thin, Passenger Standalone, and Nginx with Passenger are other good options for production.
Jason

Mackenzie Brooks

unread,
Jun 7, 2013, 5:31:54 PM6/7/13
to bib...@googlegroups.com
So I'm going to thread jack here since this is the installation I'm working on as well. As you can see from the screen shot, the logo and the custom text are not reflecting the changes I've made to the en.yml files. I've already tried clearing the browser cache and restarting bibapp, and even though caching is disabled in config/environments/development.rb. Any ideas? Thanks! 
Screen Shot 2013-06-07 at 4.14.43 PM.png

Jason Stirnaman

unread,
Jun 10, 2013, 5:04:27 PM6/10/13
to bib...@googlegroups.com
Mackenzie, et al.
I just tried launching HEAD from bibapp/master and got the same result. I'm pretty sure it has to do with the Tolk internationalization setup. Howard wrote a wiki page on this a while back, but I've been unable to get it to work in Rails 3.

Here's what I did instead...appears to be working, but not fully tested:
  1. Edit your Gemfile, uncommenting the gem 'tolk' line and removing the source =>... reference.
  2. Run bundle install. This will replace BibApp's version of the Tolk gem with the latest version of Tolk.
  3. Delete config/locales/de.yml. This is the German translation file. It seems to be incompatible with the latest version of Tolk, causing the setup process to crash.
  4. Follow the instructions for :setup, :sync, and :import in https://github.com/tolk/tolk#readme
  5. Restart BibApp

Jason

Mackenzie Brooks

unread,
Jun 10, 2013, 8:12:06 PM6/10/13
to bib...@googlegroups.com
Hurrah! Thanks so much Jason! 
Reply all
Reply to author
Forward
0 new messages