Skip to content
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

RestClientExceptionWrapper: HTTP Error #88

Open
perlun opened this issue Nov 19, 2014 · 7 comments
Open

RestClientExceptionWrapper: HTTP Error #88

perlun opened this issue Nov 19, 2014 · 7 comments

Comments

@perlun
Copy link

perlun commented Nov 19, 2014

Hi,

Sometimes, our code runs into the exception noted above. Any ideas about what could be causing this? The code is basically something along these lines:

  def listen_on_queue(queue_name)
    ironmq = IronMQ::Client.new(
      host: IRONMQ_HOST,
      token: IRONMQ_TOKEN,
      project_id: IRONMQ_PROJECT_ID
    )

    @logger.debug "Listening on message queue '#{queue_name}'."
    queue = ironmq.queue(queue_name)

    # Slightly stupid to create a new thread, but the worker reloading malfunctions without it.
    Thread.new do
      begin
        queue.poll(wait: 30) do |m|
          handle_message(m.body)
        end
      rescue => e
        @logger.error 'Exception occurred:'
        @logger.error e
      end
    end
  end

The stack trace is as below:

2014-11-19T22:42:48.6397309Z ERROR [2014-11-19 23:42:48.639] Foo: Caught Rest::Wrappers::RestClientExceptionWrapper: HTTP  Error
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/rest-2.7.2/lib/rest/wrappers/rest_client_wrapper.rb:55:in `get'
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/rest-2.7.2/lib/rest/client.rb:118:in `get'
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/rest-2.7.2/lib/rest/client.rb:142:in `perform_op'
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/rest-2.7.2/lib/rest/client.rb:117:in `get'
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/iron_core-1.0.5/lib/iron_core/client.rb:187:in `get'
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/iron_mq-5.0.1/lib/iron_mq/client.rb:68:in `get'
2014-11-19T22:42:48.6397309Z    D:/eCraft/uxFactory/PRD/server/gems/jruby/1.9/gems/iron_mq-5.0.1/lib/iron_mq/queues.rb:243:in `call_api_and_parse_response'

Any suggestions or ideas? This makes the thread crash, and no more messages gets processed. I guess I could make it slightly more resilient to this, but are there any other good options also?

@pyeremenko
Copy link
Contributor

Hi, @perlun.

Which version of gem do you use?

@perlun
Copy link
Author

perlun commented Nov 20, 2014

iron_mq (5.0.1)

Would it be better with bleeding edge (i.e. master from GitHub)?

@treeder
Copy link
Contributor

treeder commented Nov 20, 2014

Strange there is no HTTP error code...

@perlun
Copy link
Author

perlun commented Jan 27, 2015

This problem is unfortunately still active, with long-running IronMQ polling:

2015-01-27T18:11:52.1217063Z ERROR [2015-01-27 19:11:52.121] DeploymentWorker: Exception occurred:
2015-01-27T18:11:52.1217063Z ERROR [2015-01-27 19:11:52.121] DeploymentWorker: Caught Rest::Wrappers::RestClientExceptionWrapper: HTTP  Error
2015-01-27T19:50:34.2220423Z ERROR [2015-01-27 20:50:34.222] DeploymentWorker: Exception occurred:
2015-01-27T19:50:34.2220423Z ERROR [2015-01-27 20:50:34.222] DeploymentWorker: Caught Rest::Wrappers::RestClientExceptionWrapper: HTTP  Error

Any ideas/suggestions?

@featalion
Copy link
Contributor

@perlun do you using IronMQ v3 or v2 API?

@perlun
Copy link
Author

perlun commented Jan 27, 2015

No idea, so I assume v2? I use the default settings AFAIK.

@featalion
Copy link
Contributor

I see in the log you posted above, that errors happen rare (1h40m in the example). Could you please check in your log how often it happens? Are errors like "service unreachable" happen nearby in time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants