morphia icon indicating copy to clipboard operation
morphia copied to clipboard

Occasional MongoCommandException

Open ball3t opened this issue 1 year ago • 2 comments

Hello all,

I am not sure if this is a problem in morphia or java HashMap. Just see if anyone encountered similar issue. When trying to use aggregate like this:

datastore.aggregate().group(Group.group(Group.id("$xxxx")))

the following exception is thrown unless the server is restarted.

com.mongodb.MongoCommandException: Command failed with error 40324 (Location40324): 'Unrecognized pipeline stage name: '_id''

I have tried to reproduce this issue by restarting the server many times in my development server for debugging. After hitting this issue, I found the problem is that the codecs in AggregationCodecProvider is containing duplicated key. Causing it returning null when calling get with Group.class

image

Could any one advise on this?

Regards ** Please complete the following information: ** Server Version: 6.0.18 Driver Version: 1.19.8 Morphia Version: 2.4.4

ball3t avatar Oct 29 '24 13:10 ball3t

I'm not sure how this is even possible looking at that code but I can tighten things up a bit and see if that helps.

evanchooly avatar Feb 19 '25 03:02 evanchooly

I can't recreate this one. Do you have a reproducer that does?

evanchooly avatar Feb 27 '25 02:02 evanchooly