[SERVER-11955] getLastError response for failed index build contains extra copy of "err" field Created: 04/Dec/13  Updated: 11/Jul/16  Resolved: 21/Jan/14

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5.5

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-11966 getLastError includes "err" twice Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Participants:

 Description   

Regression since 2.5.4.

Repro with (mongo version 2.4, mongod version 57a4f169 (2.5.5-pre)):

db.foo.ensureIndex({a:"blah"});
printjson(db.getLastErrorObj());

Output:

{
	"err" : "Unknown index plugin 'blah' in index { a: \"blah\" }",
	"code" : 67,
	"n" : 0,
	"connectionId" : 2,
	"syncMillis" : 0,
	"writtenTo" : null,
	"err" : "Unknown index plugin 'blah' in index { a: \"blah\" }",
	"ok" : 1
}



 Comments   
Comment by Randolph Tan [ 21/Jan/14 ]

sridhar I believe the one you saw was a separate issue - SERVER-12404.

Comment by Sridhar Nanjundeswaran [ 17/Jan/14 ]

The issues seems to have reappeared. With the 1/17 build
> db.bar.insert(

{foo:1}

);db.getLastErrorObj();
{
"connectionId" : 267,
"n" : 0,
"syncMillis" : 0,
"writtenTo" : null,
"err" : null,
"err" : null,
"ok" : 1
}
"gitVersion" : "6787339f2721619a4f33816e16e4cc9eae3121eb",

Comment by Randolph Tan [ 13/Dec/13 ]

getLastError will now wait for write concern regardless of whether an error occurred in the last operation (it doesn't on v2.4). And there is a chance that it will fail to do so, and will cause the command to return

{ ok: 0 }

.

Comment by Githook User [ 13/Dec/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-11955 getLastError response for failed index build contains extra copy of "err" field
Branch: master
https://github.com/mongodb/mongo/commit/24f90ef17edf397f2ca61772f0da7497b24d55fa

Comment by Scott Hernandez (Inactive) [ 05/Dec/13 ]

Note that in SERVER-11966 there is more info about what is actually returned (one err field seems to be null).

Generated at Thu Feb 08 03:27:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.