Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1632

IllegalArgumentException: response too long: 1701078386

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.12.2
    • Component/s: Connection Management
    • Environment:

      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
      
      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)
      

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            martin_w_kirst Martin W. Kirst
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: