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

MongoQueryException when using latest mongo image #22

Open
willpewitt opened this issue Feb 6, 2023 · 1 comment
Open

MongoQueryException when using latest mongo image #22

willpewitt opened this issue Feb 6, 2023 · 1 comment

Comments

@willpewitt
Copy link
Contributor

willpewitt commented Feb 6, 2023

When pulling the latest mongo image the following exception occurs when trying to run any query

com.mongodb.MongoQueryException: Query failed with error code 352 and error message 'Unsupported OP_QUERY command: find. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal' on server localhost:27017
	at com.mongodb.operation.FindOperation$1.call(FindOperation.java:492)
	at com.mongodb.operation.FindOperation$1.call(FindOperation.java:482)
	at com.mongodb.operation.OperationHelper.withConnectionSource(OperationHelper.java:239)
	at com.mongodb.operation.OperationHelper.withConnection(OperationHelper.java:212)
	at com.mongodb.operation.FindOperation.execute(FindOperation.java:482)
	at com.mongodb.operation.FindOperation.execute(FindOperation.java:79)
	at com.mongodb.Mongo.execute(Mongo.java:772)
	at com.mongodb.Mongo$2.execute(Mongo.java:759)
	at com.mongodb.FindIterableImpl$FindOperationIterable.first(FindIterableImpl.java:207)
	at com.mongodb.FindIterableImpl.first(FindIterableImpl.java:148)
	at io.sdkman.broker.app.AppRepo.findVersion$lambda$3(AppRepo.kt:35)
	at ratpack.exec.Blocking$1.lambda$get$0(Blocking.java:69)
	at ratpack.exec.internal.DefaultExecution.intercept(DefaultExecution.java:236)
	at ratpack.exec.Blocking$1.get(Blocking.java:67)
	at ratpack.exec.Blocking$1.get(Blocking.java:60)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory.lambda$newThread$0(DefaultExecController.java:137)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:829)

I suspect the issue is that is due to the client being quite old. 3.2.2 was released in Feb 15 2016. If the version of Mongo used in production was known we could upgrade the client to a newer verison

It appears that the breakage starts when using a version older than 3.6.0

@willpewitt willpewitt changed the title MongoQueryException MongoQueryException when using latest mongo image Feb 6, 2023
@marc0der
Copy link
Member

marc0der commented Feb 6, 2023

Hi @willpewitt, the Mongo client is bound to our current (old) version of Mongo running in prod. Upgrading would need to be a phased approach. The beauty of Docker is that you can just keep on using the mongo:3.2 image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants