Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mongodb] Upgrade MongoDB support from 4.x (max) to 6.0 #16310

Closed
ulbi opened this issue Jan 21, 2024 · 2 comments · Fixed by #16333
Closed

[mongodb] Upgrade MongoDB support from 4.x (max) to 6.0 #16310

ulbi opened this issue Jan 21, 2024 · 2 comments · Fixed by #16333
Labels
enhancement An enhancement or new feature for an existing add-on

Comments

@ulbi
Copy link
Contributor

ulbi commented Jan 21, 2024

Currently the mongodb is only supported with version 4.4 and below.
This limits quite a lot of operations.
When using 6.0 you get the errors - e.g.:

2024-01-21 07:48:10.701 [ERROR] [b.internal.MongoDBPersistenceService] - Failed to connect to collection openhabdb: { "serverUsed" : "devmongodb:27017" , "ok" : 0.0 , "errmsg" : "Unsupported OP_QUERY command: createIndexes. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal" , "code" : 352 , "codeName" : "UnsupportedOpQueryCommand" , "$clusterTime" : { "clusterTime" : { "$ts" : 1705819684 , "$inc" : 1} , "signature" : { "hash" : <Binary Data> , "keyId" : 7321830615794319362}} , "operationTime" : { "$ts" : 1705819684 , "$inc" : 1}}
com.mongodb.CommandFailureException: { "serverUsed" : "devmongodb:27017" , "ok" : 0.0 , "errmsg" : "Unsupported OP_QUERY command: createIndexes. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal" , "code" : 352 , "codeName" : "UnsupportedOpQueryCommand" , "$clusterTime" : { "clusterTime" : { "$ts" : 1705819684 , "$inc" : 1} , "signature" : { "hash" : <Binary Data> , "keyId" : 7321830615794319362}} , "operationTime" : { "$ts" : 1705819684 , "$inc" : 1}}

Your Environment

  • Version used: (e.g., openHAB and add-on versions) using the latests stable docker image from openhab
  • Environment name and version (e.g. Chrome 76, Java 8, Node.js 12.9, ...):
  • Operating System and version (desktop or mobile, Windows 10, Raspbian Buster, ...):
@ulbi ulbi added the enhancement An enhancement or new feature for an existing add-on label Jan 21, 2024
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 27, 2024
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…helper, fixing type handling for HSBType, RawType and QuantityType
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…it tests

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…helper, fixing type handling for HSBType, RawType and QuantityType

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…some tests if docker is missing.

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…some tests if docker is missing.

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…it tests

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…helper, fixing type handling for HSBType, RawType and QuantityType

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Jan 28, 2024
…some tests if docker is missing.

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Feb 10, 2024
…some tests if docker is missing.

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
ulbi added a commit to ulbi/openhab-addons that referenced this issue Feb 10, 2024
…e to be more robust and implemented the ModifiablePersistenceService

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/mongo-db-cannot-be-cast-to-class-java-lang-number/153019/2

J-N-K pushed a commit that referenced this issue Feb 17, 2024
…e handling (#16333)

* #16308 #16310 Upgraded MongoDB driver, added initial unit tests
* #16308 #16310 Refactored the MongoDBPersistence adding helper, fixing type handling for HSBType, RawType and QuantityType
* #16308 Added backwardcompatibility for the old way of writting the data where possible
* #16308 Added test for larger ImageItems and the limit of 16 MB

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
@lsiepel
Copy link
Contributor

lsiepel commented Feb 17, 2024

Pr is merged

@lsiepel lsiepel closed this as completed Feb 17, 2024
austvik pushed a commit to austvik/openhab-addons that referenced this issue Mar 27, 2024
…e handling (openhab#16333)

* openhab#16308 openhab#16310 Upgraded MongoDB driver, added initial unit tests
* openhab#16308 openhab#16310 Refactored the MongoDBPersistence adding helper, fixing type handling for HSBType, RawType and QuantityType
* openhab#16308 Added backwardcompatibility for the old way of writting the data where possible
* openhab#16308 Added test for larger ImageItems and the limit of 16 MB

Signed-off-by: René Ulbricht <rene_ulbricht@outlook.com>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants