java.lang.IllegalArgumentException: response too long: 1701078386

JIRA | Martin W. Kirst | 2 years ago
  1. 0

    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? {code:Java} @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 {code} {code:title=Stacktrace} 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) {code}

    JIRA | 2 years ago | Martin W. Kirst
    java.lang.IllegalArgumentException: response too long: 1701078386
  2. 0

    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? {code:Java} @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 {code} {code:title=Stacktrace} 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) {code}

    JIRA | 2 years ago | Martin W. Kirst
    java.lang.IllegalArgumentException: response too long: 1701078386
  3. 0

    MongoDb: fields stored in the db can't start with '$'

    GitHub | 4 years ago | tiagoboldt
    java.lang.IllegalArgumentException: fields stored in the db can't start with '$' (Bad Key: '$outer')
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem Saving Pojo

    GitHub | 4 years ago | harrychan
    java.lang.IllegalArgumentException: 'ok' should never be null...
  6. 0

    Support for @Property for list of embedded objects [moved]

    GitHub | 4 years ago | jyemin
    java.lang.IllegalArgumentException: can't serialize class com.package.Foo

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      response too long: 1701078386

      at com.mongodb.Response.<init>()
    2. MongoDB Java Driver
      DBCollection.save
      1. com.mongodb.Response.<init>(Response.java:49)
      2. com.mongodb.DBPort$1.execute(DBPort.java:141)
      3. com.mongodb.DBPort$1.execute(DBPort.java:135)
      4. com.mongodb.DBPort.doOperation(DBPort.java:164)
      5. com.mongodb.DBPort.call(DBPort.java:135)
      6. com.mongodb.DBPort.findOne(DBPort.java:189)
      7. com.mongodb.DBPort.runCommand(DBPort.java:197)
      8. com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:133)
      9. com.mongodb.DBTCPConnector.access$000(DBTCPConnector.java:39)
      10. com.mongodb.DBTCPConnector$1.execute(DBTCPConnector.java:186)
      11. com.mongodb.DBTCPConnector$1.execute(DBTCPConnector.java:181)
      12. com.mongodb.DBTCPConnector.doOperation(DBTCPConnector.java:210)
      13. com.mongodb.DBTCPConnector.say(DBTCPConnector.java:181)
      14. com.mongodb.DBCollectionImpl.update(DBCollectionImpl.java:275)
      15. com.mongodb.DBCollection.update(DBCollection.java:191)
      16. com.mongodb.DBCollection.save(DBCollection.java:975)
      17. com.mongodb.DBCollection.save(DBCollection.java:934)
      17 frames
    3. Spring Data MongoDB - Core
      MongoTemplate.execute
      1. org.springframework.data.mongodb.core.MongoTemplate$10.doInCollection(MongoTemplate.java:950)
      2. org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:410)
      2 frames