-
Type: Bug
-
Resolution: Duplicate
-
Priority: Critical - P2
-
None
-
Affects Version/s: 2.12.2
-
Component/s: Connection Management
Hi,
we're using MongoDB in our financial application with an estimated data size of 130GB. On a daily basis we're observing strange Exceptions (see stacktrace below).
The code is pretty simple though. Theres a (Http-)Controller, which accepts a single JSON document and saves it to MongoDB. Each document owns about 30 fields. The actual write operation is done via SpringData's CrudRepository.
The strange thing is the number - which seams to be a string!
Consider this Javascript snippet:
new Buffer((1701078386).toString(16),'hex').toString() // => 'eder'
It uncovers the string 'eder'.
The numbers change from time to time, there is another one: 1869642088 ==> 'opyh'.
I blindly guess that the MongoDB driver parses the wrong buffer and goes crazy afterwards.
Can anyone confirm this?
@RequestMapping(value = "/vorgang/{id}", method = PUT) @ResponseStatus(OK) public String reportVorgang(@PathVariable("id") String id, @RequestBody Vorgang vorgang) { vorgang.setId(id); return save(vorgang).id; } public ObjectWithId save(T entity) { try { return new ObjectWithId(getRepository().save(entity).getId()); } catch (MongoException me) { LOG.error(me.getMessage(), me); throw new PersistenceException(me.getMessage()); } } protected abstract CrudRepository<T, String> getRepository(); // returns a pre-configured Spring CrudRepository
Exception beim Aufruf: /report/vorgang/54c376f2e1b871dba35db75c : response too long: 1701078386 java.lang.IllegalArgumentException: response too long: 1701078386 at com.mongodb.Response.<init>(Response.java:49) at com.mongodb.DBPort$1.execute(DBPort.java:141) at com.mongodb.DBPort$1.execute(DBPort.java:135) at com.mongodb.DBPort.doOperation(DBPort.java:164) at com.mongodb.DBPort.call(DBPort.java:135) at com.mongodb.DBPort.findOne(DBPort.java:189) at com.mongodb.DBPort.runCommand(DBPort.java:197) at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:133) at com.mongodb.DBTCPConnector.access$000(DBTCPConnector.java:39) at com.mongodb.DBTCPConnector$1.execute(DBTCPConnector.java:186) at com.mongodb.DBTCPConnector$1.execute(DBTCPConnector.java:181) at com.mongodb.DBTCPConnector.doOperation(DBTCPConnector.java:210) at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:181) at com.mongodb.DBCollectionImpl.update(DBCollectionImpl.java:275) at com.mongodb.DBCollection.update(DBCollection.java:191) at com.mongodb.DBCollection.save(DBCollection.java:975) at com.mongodb.DBCollection.save(DBCollection.java:934) at org.springframework.data.mongodb.core.MongoTemplate$10.doInCollection(MongoTemplate.java:950) at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:410)
- duplicates
-
JAVA-1613 Race condition on DBPort usage during write commands
- Closed