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 7509243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:50:51+00:00 2026-05-29T22:50:51+00:00

I have a Rails 3.1 app, running on Ruby 1.9.2, Mongo 2.0.2, using Mongoid

  • 0

I have a Rails 3.1 app, running on Ruby 1.9.2, Mongo 2.0.2, using Mongoid as a ODM, however, this should be bypassing most of Mongoid and just using the MongoDB Ruby Driver. I am running a MapReduce query a few times on one page load. This will query will run acceptably for a while in development, say like half a day, then fail with a

(assertion: 'value has to be set'; 
 assertionCode: '10210'; 
 errmsg: 'db assertion failure'; 
 ok: '0.0')

On a refresh of the page, everything continues to work wonderfully for some time. The log from execution (with some trimmed out)…

(R) MONGODB development['$cmd'].find({"mapreduce"=>"values", "map"=><BSON::Code:70098680478720 @data="function() {
  var value = { a: 0, b: 0 };
  var count = { a: 0, b: 0 };
  var min = { a: 100, b: 100 };
  var max = { a: -100, b: -100 };

  if (this.c == "a" || this.c == "b") {
    value[this.c] = parseInt(this.value);
    count[this.c]++;
    min[this.c] = parseInt(this.value);
    max[this.c] = parseInt(this.value);

    emit(this.item_id,
      {
        count: count,
        values: value,
        min: min,
        max: max,
        avg: { a: null, b: null }
      }
    );
  }
}" @scope="{}">, "reduce"=><BSON::Code:70098680478680 @data="function(key, data) {
  var newDatum = data.pop();

  data.forEach(function(item) {
    newDatum.values.a += item.values.a;
    newDatum.count.a += item.count.a;
    if (item.min.a < newDatum.min.a)
      newDatum.min.a = item.min.a;
    if (item.max.a > newDatum.max.a)
      newDatum.max.a = item.max.a;
    // same for b
  });

  newDatum.avg.a = newDatum.values.actual / newDatum.count.a;
  newDatum.avg.b = newDatum.values.ideal / newDatum.count.b;

  return newDatum;
}" @scope="{}">, :out=>{:inline=>1}, :query=>{:about_id=>BSON::ObjectId('4f1d84de69c238941d000012'), :by_id=>{"$ne"=>BSON::ObjectId('4f1d84de69c238941d000012')}, :comp_id=>{"$in"=>[BSON::ObjectId('4f1d84de69c238941d000016'), BSON::ObjectId('4f1d84de69c238941d000019')]}}}).limit(-1)

Now the query part for one that fails in the same request… (but again, will significantly more often than not succeed)

}" @scope="{}">, :out=>{:inline=>1}, :query=>{:about_id=>BSON::ObjectId('4f1d84de69c238941d000012'), :by_id=>BSON::ObjectId('4f1d84de69c238941d000012'), :comp_id=>BSON::ObjectId('4f1d84de69c238941d000019')}}).limit(-1)
Completed 500 Internal Server Error in 516ms

Mongo::OperationFailure (Database command 'mapreduce' failed: (assertion: 'value has to be set'; assertionCode: '10210'; errmsg: 'db assertion failure'; ok: '0.0').):

If it’s of any value, this is happening on Mac OS X Lion with Mongo installed via homebrew.

$ mongod --version
db version v2.0.2, pdfile version 4.5
Wed Feb  8 16:33:11 git version: 514b122d308928517f5841888ceaa4246a7f18e3

And what I can see in the log file during this event. The one line about mr failed seems to match to the event.

Wed Feb  8 15:08:36 [clientcursormon] mem (MB) res:15 virt:2630 mapped:80
Wed Feb  8 15:11:37 [clientcursormon] mem (MB) res:17 virt:2630 mapped:80
Wed Feb  8 15:16:37 [clientcursormon] mem (MB) res:17 virt:2630 mapped:80
Wed Feb  8 15:21:37 [clientcursormon] mem (MB) res:17 virt:2630 mapped:80
Wed Feb  8 15:26:37 [clientcursormon] mem (MB) res:17 virt:2630 mapped:80
Wed Feb  8 15:31:37 [clientcursormon] mem (MB) res:17 virt:2630 mapped:80
Wed Feb  8 15:32:55 [conn3] mr failed, removing collection :: caused
by :: 10210 value has to be set
Wed Feb  8 15:36:37 [clientcursormon] mem (MB) res:18 virt:2630 mapped:80
Wed Feb  8 15:39:26 [initandlisten] connection accepted from 127.0.0.1:57001 #4

So my question is, what can I do to help track this down? I am not noticing any additional issues with our use of Mongo. I’m not sure how to dig into this and figure out what’s going on.

  • 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-05-29T22:50:53+00:00Added an answer on May 29, 2026 at 10:50 pm

    So it appears the issue was JavaScript stored in the db itself. db.system.js.find() listed a an entry without a value. Per a post on the mongodb mailing list, removing that js seemed to correct the error. Hopefully if someone else runs into this, they’ll learn to check system.js.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ruby on rails app running a server and sometimes it needs
I have a Ruby on Rails app running on my server, and I can't
I'm running Teambox (a Ruby on Rails app) and have the server running with:
I have a ruby on rails app running on passenger / nginx. The app
I'm running a ruby on rails app, and I'm using jQuery to show some
I have a ruby on rails app, and there is a cron running in
I have a rails app running on port 3000. The page in question has
I have an app running Rails 2.3.5 that has a JSON API for much
I have a Ruby on Rails app that needs process many background jobs simultaneously:
I have a Rails app installed on a Slicehost server running Apache 2 and

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.