0

These are the logs when I see the error page for my Rails app. Any advice on how to fix this?

2013-04-12T15:10:04.081764+00:00 app[web.1]: Started GET "/" for 76.170.69.45 at 2013-04-12 15:10:04 +0000
2013-04-12T15:10:04.088093+00:00 app[web.1]: SocketError (getaddrinfo: Name or service not known):
2013-04-12T15:10:04.084702+00:00 app[web.1]: Processing by ReviewsController#index as HTML
2013-04-12T15:10:04.088093+00:00 app[web.1]: 
2013-04-12T15:10:04.086820+00:00 app[web.1]: Completed 500 Internal Server Error in 2ms
2013-04-12T15:10:04.088093+00:00 app[web.1]: 
2013-04-12T15:10:04.088093+00:00 app[web.1]:   app/controllers/reviews_controller.rb:5:in `index'
2013-04-12T15:10:04.450002+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=infinite-meadow-4922.herokuapp.com fwd="76.170.69.45" dyno=web.1 connect=1ms service=6ms status=304 bytes=0

Here is my Review controller. It refers to the fulltext line. I'm using the Sunspot gem that seems to work in the development environment.

class ReviewsController < ApplicationController
    def index

        # SUNSPOT/SOLR SEARCH RESULTS
        @search = Review.search do
            fulltext params[:search]
        end
        @reviews_search_results = @search.results
        # END SUNSPOT/SOLR SECTION

        @reviews = Review.all
        @pro_string = ''
        @reviews.each do |review|
            @pro_string = @pro_string + ' ' + review.pro
        end

        # CALL METHOD TO FIND MOST POPULAR PHRASES, TAKES ARGUMENT OF PHRASE LENGTH
        @frequency = final_phrase_list(@pro_string,3,5)
    end
end
sharataka
  • 5,014
  • 20
  • 65
  • 125
  • 1
    `SocketError (getaddrinfo: Name or service not known)` simply says, that you want to connect to a host which is unavailable. But I don't know what the last line `heroku[router]` means. More code from your `reviews_controller.rb` would be helpful. – 23tux Apr 12 '13 at 15:28

3 Answers3

0

Can you paste your ReviewsController#index code? As the log says here, the error is occurring on line 5 of this method.

The heroku[router] line is irrelevant here, that's just log line from the Heroku router for a separate request from somewhere else that's attempting to fetch a favicon for your app.

Update

It looks like your Review#search method is causing this error. Have you investigated that there could be something wrong with that?

clem
  • 3,524
  • 3
  • 25
  • 41
0

I think you might find this answer helpful, since, as I can see, you use full text search.

SocketError (getaddrinfo: Name or service not known) - Sunspot/Solr Rails development

Community
  • 1
  • 1
konole
  • 766
  • 4
  • 8
0

That's a 500 page that can be changed in the settings of the app on heroku. Right now you it's prob a amazon served page.

If you want to resolve whatever is causing the 500 error, i'd post the index acton (or the entire controller) where the problem is (line 5).

https://devcenter.heroku.com/articles/error-pages

jahrichie
  • 1,215
  • 3
  • 17
  • 26