Search code examples
ruby-on-railsruby-on-rails-4herokudelayed-job

rails heroku api delayed_job error Heroku::API::Errors::ErrorWithResponse: Expected(200) <=> Actual(410 Gone)


I'm getting a heroku api error since 26th of June 2017 for a missing heroku api.

The error is as follows:

   (1.9ms)  COMMIT
   (1.9ms)  COMMIT
   (8.0ms)  SELECT COUNT(*) FROM "delayed_jobs" WHERE "delayed_jobs"."failed_at" IS NULL
   (8.0ms)  SELECT COUNT(*) FROM "delayed_jobs" WHERE "delayed_jobs"."failed_at" IS NULL
    Heroku::API::Errors::ErrorWithResponse: Expected(200) <=> Actual(410 Gone)

    body: "{\"id\":\"gone\",\"error\":\"This version of the API has been Sunset.\\nPlease see https://devcenter.heroku.com/changelog-items/1147 for more information.\\n\"}"
    from /app/vendor/bundle/ruby/2.2.0/gems/excon-0.57.0/lib/excon/middlewares/expects.rb:7:in `response_call'

The error is pretty explainitory and I've had a look at the url https://devcenter.heroku.com/changelog-items/1147 which shows the api that has been removed, but after updating everything I'm still getting the error. I'm not directly using the API and I think I've narrowed it down to the deleyed_job gem, as I can run in the heroku console

    Product.some_function() 

and it works fine, but then if I run:

    Product.delay.some_function()

I get the error pasted above. I'm using the delayed job and the workless gems in my gemfile and both have been updated with no change.

Here is a snippet from my Gemfile.lock

    .
    .
    .
    delayed_job (4.1.3)
      activesupport (>= 3.0, < 5.2)
    delayed_job_active_record (4.1.2)
      activerecord (>= 3.0, < 5.2)
      delayed_job (>= 3.0, < 5)
    .
    .
    .
    heroku-api (0.4.2)
    .
    .
    .
    workless (1.2.3)
     delayed_job (>= 2.0.7)
     heroku-api
     rails
     rush
    .
    .
    .
    DEPENDENCIES
    .
    .
    .
    delayed_job_active_record
    .
    .
    .

Does anyone know which part of the API the delayed_job gem is using that is causing the errors? And am I going to have to go in and monkey patch the gem in order to get it to work, or is there something else wrong that I am missing. Any help is GREATLY appreciated! I've been banging my head against the wall for this one as there isn't anything that seems to have an effect!

Thanks!


Solution

  • So it was the 'workless' gem after all. For anyone else who find this just replace the workless gem with this by davidakachaos: https://github.com/davidakachaos/workless_revived

    There is a little bit of fiddling to get it working as it's not exactly the same. Just make sure you are on his latest release of the gem (2.1) and follow his setup instructions.

    Thank you davidakachaos for your work(less)!