Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8249703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:38:02+00:00 2026-06-07T23:38:02+00:00

A worker that was working a few days ago has ceased to work for

  • 0

A worker that was working a few days ago has ceased to work for some reason.

The resque log reports an exception of Mongo::OperationFailure with the errorinvalid operator: $oid

class SimilarTargets
  @queue = :similar_queue

  def self.perform(target_id)
    source_target = Target.find(target_id)

    ....

  end
end

The worker is failing on Target.find(target_id), even when a straight string is passed in via the rails console.

Target.find(id) works fine in the console and elsewhere in the code and I can’t figure out why this has failing even though the worker class has never changed in the last week.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:38:04+00:00Added an answer on June 7, 2026 at 11:38 pm

    Did you upgrade Mongoid recently? The error makes it sound like the .find() method is receiving something like {"$oid": "[STRING]"}, which is the strict json representation of an Object ID for Mongo.

    You can get around it with something like this, assuming you just want a quick fix:

    target_id = target_id["$oid"] unless target_id.is_a?(String)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that I have been working on for a few days
I'm working on a web application that submits tasks to a master/worker system that
I have some code I am working on that worked just fine until I
What i'm trying to create is a background worker that executes a few processes
I have a layered worker class that I'm trying to get progress reports from.
So far I have worked in the console and a few days ago decided
Afternoon, I have been working with CKEditor and CKFinder for the last few days
Since the Windows 8 consumer preview was released a few days ago, I am
I am working on a WPF .NET 3.5 application that does a few long
I've been working on this project for a few days and I really haven't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.