Some of the posts<http://stackoverflow.com/questions/6510203/eoferror-when-issueing-http-requests-with-ruby> mention https, content-length, and redirects, so If you could track the urls that cause the problem, that might be helpful. (you may have to track the url BEFORE the one that gets the EOF)
If you could then fire the same request from the heroku console, or write a little bit of code that you can invoke on heroku or locally to fire against known 'bad' or 'good' urls, as a test case, it might help you get to a solution faster. Have you looked into faraday or httparty? I'm not saying you should completely bail on the idea of doing an app restart, I'm just wondering if you could also explore a more direct fix at the same time. Good luck! On Wed, Nov 16, 2011 at 11:45 AM, Corey Trager <[email protected]> wrote: > John - I have been trying to find the real heart of the issue, which > again, is that the app gets into a state. That an individual request > for a URL fails, no problem. That requests continue to fail, that > means there's some sort of state change somewhere. But there is no > state in MY logic. The failure of one request shouldn't affect the > next one. So where is that state? Deep in the Ruby libs that do the > URL fetching? Some setting I'm not setting? (I've tried switching > between two different Ruby ways of fetching urls, but both ways seem > to have the same problem.) Somewhere in Heroku infrastructure - some > sort of caching/proxy thing? I have no means of debugging those > things, and no means of fixing them and deploying that fix on Heroku. > I'm focusing on a solution where I have power and control: My code. > > A google related to the heart of the issue: > http://www.google.com/search?q=http%3A%3Anet+EOFError > Do you have some suggestions for me? > > Restarting the app at heroku is totally not elegant, a total hack, but > for my circumstances, your comments about scaling don't apply. > > I will follow up on your suggestion to create a Heroku support ticket. > > On Nov 16, 8:58 am, John McCaffrey <[email protected]> wrote: > > Again, I would suggest that you try to find the real heart of the issue > and > > find ways to debug/instrument the code to figure out what is happening > that > > gets it stuck. > > > > Maybe opening a ticket with the heroku team may help (maybe its something > > they've seen, or they have a good suggestion for how to dig in to it). > They > > read the mailing list, but an actual support ticket may be the way to go > > for you. > > > > A solution where you restart your app just doesn't seem like it will > scale > > to me, unless you are firing it off like a cron/delayed job, that has a > > natural restart flow. (would it make sense for the scraping part of the > app > > to be a background job?) > > > > just throwing in my 2c > > > > > > > > > > > > > > > > > > > > On Wed, Nov 16, 2011 at 8:09 AM, Corey Trager <[email protected]> wrote: > > > Not working yet. > > > > > Testing on my dev box, heroku.restart resulted in a 404 but > > > heroku.ps_restart DID restart my app running at Heroku, so that was > > > promising. That is, my local app A could restart my Heroku app B. > > > But, when deployed to Heroku and tried to have B restart itself, > > > ps_restart resulted in "NoMethodError" for Heroku::Client and restart > > > resulted in RestClient::ResourceNotFound. > > > The NoMethodError, does that mean I'm using an older stack with an > > > older Heroku gem? > > > The RestClient, I guess heroku needs to know a host? So, I'm looking > > > for docs for the gem. > > > Do you think I'm on the right track? > > > > > On Nov 15, 5:04 pm, Neil Middleton <[email protected]> wrote: > > > > You can always use the Heroku gem to talk to the heroku > infrastructure > > > as the CLI does. > > > > > > For instance: > > > > > > @heroku = Heroku::Client.new(ENV["HEROKU_EMAIL"], > ENV["HEROKU_PASSWORD"]) > > > > > > You can then issue commands such as: > > > > > > @heroku.restart('app_name') > > > > > > Neil > > > > > -- > > > You received this message because you are subscribed to the Google > Groups > > > "Heroku" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]. > > > For more options, visit this group at > > >http://groups.google.com/group/heroku?hl=en. > > > > -- > > Thanks, > > -John > > -- > You received this message because you are subscribed to the Google Groups > "Heroku" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/heroku?hl=en. > > -- Thanks, -John -- You received this message because you are subscribed to the Google Groups "Heroku" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/heroku?hl=en.
