[DRIVERS-281] Rephrase unsupported/corrupt BSON messages Created: 15/Jan/16  Updated: 22/Feb/23  Resolved: 22/Feb/23

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1076 Rephrase unsupported/corrupt BSON mes... Closed
depends on CSHARP-1546 Rephrase unsupported/corrupt BSON mes... Closed
depends on PHPC-554 Rephrase unsupported/corrupt BSON mes... Closed
depends on PHPLIB-169 Rephrase unsupported/corrupt BSON mes... Closed
depends on PYTHON-1044 Improve error handling and messages f... Closed
depends on RUBY-1084 Rephrase unsupported/corrupt BSON mes... Closed
depends on CXX-833 Rephrase unsupported/corrupt BSON mes... Closed
depends on RUST-217 Rephrase unsupported/corrupt BSON mes... Closed
depends on CXX-832 Friendlier error message when decodin... Closed
depends on JAVA-2100 Rephrase unsupported/corrupt BSON mes... Closed
Related
Driver Compliance:
Key Status/Resolution FixVersion
PERL-606 Done BSON-v1.10.0
PYTHON-1044 Done 2.9.2, 3.2.1
PHP-1501 Done 1.6.13
CDRIVER-1076 Done 1.4.0
PHPC-554 Done 1.2.0-alpha1, 1.2.0
RUBY-1084 Done 4.0.4, 12_01_17
CSHARP-1546 Done 2.2.4
PHPLIB-169 Done
JAVA-2100 Done 3.2.2
CXX-832 Done legacy-1.1.2
CXX-833 Won't Do
PERL-1040 Fixed BSON-XS-v0.6.0
RUST-217 Fixed bson-0.15.0

 Description   

Soon – pretty very soon – MongoDB will be introducing new BSON types.
Although old drivers may not be connecting to MongoDB versions using that BSON types, bson dump files and whatnot will eventually contain these types and these files shoved through old driver versions.

Currently most drivers fail with very confusing error messages, especially if you are actually connected to a MongoDB supporting these types.

This ticket is about unifying this error message to be more friendly and possibly alerting the user that newer drivers may support this type and the BSON may not actually be corrupt as currently reported.

Detected unknown BSON type "\xTYPE" for fieldname "NAME". Are you using the latest driver version?

Where

  • TYPE is the current field type
  • NAME is the current field name, if possible

The type name should be represented in hex confirming to our BSON Spec convention '\x00'.

The field name may not be possible to include in drivers, but drivers SHOULD make BEST EFFORT to include it. It helps our users a great deal as they could potentially project that field out as a poor mans workaround.
It is not required to provide the fieldname using dotnotation for nested fields. The inner most fieldname is sufficient.

Please ensure this is done for all currently actively - AND INACTIVELY - maintained drivers.



 Comments   
Comment by Githook User [ 16/Mar/16 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: PHP-1501: Rephrase exception message for unsupported/corrupt BSON type

Per DRIVERS-281, this also adds field name (for the current nesting level) to the message.
Branch: master
https://github.com/mongodb/mongo-php-driver-legacy/commit/71aa7dbdf9de475b35df47c6e7bf35c68421b059

Comment by Githook User [ 16/Mar/16 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: PHP-1501: Rephrase exception message for unsupported/corrupt BSON type

Per DRIVERS-281, this also adds field name (for the current nesting level) to the message.
Branch: v1.6
https://github.com/mongodb/mongo-php-driver-legacy/commit/71aa7dbdf9de475b35df47c6e7bf35c68421b059

Comment by Githook User [ 16/Mar/16 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: PHP-1501: Rephrase exception message for unsupported/corrupt BSON type

Per DRIVERS-281, this also adds field name (for the current nesting level) to the message.
Branch: master
https://github.com/mongodb/mongo-php-driver-legacy/commit/2a7117ff655f6336a9b114695798ce4f512f20e5

Generated at Thu Feb 08 08:21:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.