[CDRIVER-1963] Better error message for featureCompatibilityVersion Created: 21/Dec/16  Updated: 27/Oct/23  Resolved: 21/Dec/16

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Jeroen Ooms [X] Assignee: Hannes Magnusson
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I tried inserting some dec128 into mongo. This immediately kills the connection with a not so helpful error message:

Failed to send "insert" command with database "test": socket error or timeout

Looking in the mongod log files the real problem is this:

2016-12-21T16:39:42.585+0100 I -        [conn344] AssertionException handling request, closing client connection: 22 Client Error: bad object in message: Cannot use decimal BSON type when the featureCompatibilityVersion is 3.2. See http://dochub.mongodb.org/core/3.4-feature-compatibility.
2016-12-21T16:39:42.585+0100 I -        [conn344] end connection 127.0.0.1:61918 (1 connection now open)

Is it expected that the connection is killed when inserting dec128 in mongo 3.2? Perhaps the C driver could return a more helpful error message, something that hints at featureCompatibilityVersion? How should I request featureCompatibilityVersion 3.4 in the client?



 Comments   
Comment by Hannes Magnusson [ 21/Dec/16 ]

featureCompatibilityVersion is a setting on the mongoD which allows you to rollback an upgrade if required.
After upgrading you should set the appropriate featureCompatibilityVersion to enable 3.4 features.
See: https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion/

The server closes the connections without error message so there isn't much we can do about it.

Generated at Wed Feb 07 21:13:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.