mongorestore - message mstLen is invalid - msgLen xxx is invalid. Min 16 Max: 48000000

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Critical - P2
    • None
    • Affects Version/s: 100.15.0
    • Component/s: mongorestore
    • None
    • Tools and Replicator

      Problem Statement/Rationale

      mongorestoe 100.15.0 generates randomly an error while restoring a dump created  

      mongodump "mongodb://****************:****************@10.100.100.201,10.100.100.203,10.100.100.201:27017/prod?authSource=admin&readPreference=secondaryPreferred" -d prod --excludeCollection=logs --excludeCollection=serverlog --excludeCollection=actions --excludeCollection=shell_out --archive="/data/prod/prod_2026-03-23T13:05:51Z.archive" --gzip

       

      mongorestore --drop 'mongodb://********:********@10.100.201.100:27017,10.100.100.202:27017/?authSource=admin' --numInsertionWorkersPerCollection=8 --writeConcern="{w:1}" --gzip --archive=/data/tmp/prod.archive --nsFrom 'prod.*' --nsTo 'prod-clone.*'
      

      Steps to Reproduce

      We have tried multiple times on multiple dumps from different DBs, on various MongoDB clusters (with the exact same mongod version on Ubuntu), the result is a bit random, as it can succeed, then failed.

      Expected Results

      Restore ending successfully

      Actual Results

      Exiting in error:

      ....

      {"t":\{"$date":"2026-03-23T17:35:55.090+00:00"}

      ,"s":"I", "c":"NETWORK", "id":4615638, "ctx":"conn229","msg":"recv(): message mstLen is invalid.","attr":{"msgLen":48000045,"min":16,"max":48000000}}
      ...

      {"t":\{"$date":"2026-03-23T17:35:55.090+00:00"}

      ,"s":"I", "c":"EXECUTOR", "id":22988, "ctx":"conn229","msg":"Error receiving request from client. Ending connection from remote","attr":{"error":

      {"code":17,"codeName":"ProtocolError","errmsg":"recv(): message msgLen 48000045 is invalid. Min 16 Max: 48000000"}

      ,"remote":"10.100.199.23:43950","connectionId":229}}
      ...

      {"t":\{"$date":"2026-03-23T17:35:55.130+00:00"}

      ,"s":"I", "c":"NETWORK", "id":4615638, "ctx":"conn295","msg":"recv(): message mstLen is invalid.","attr":{"msgLen":48000045,"min":16,"max":48000000}}

      {"t":\{"$date":"2026-03-23T17:35:55.131+00:00"}

      ,"s":"I", "c":"EXECUTOR", "id":22988, "ctx":"conn295","msg":"Error receiving request from client. Ending connection from remote","attr":{"error":

      {"code":17,"codeName":"ProtocolError","errmsg":"recv(): message msgLen 48000045 is invalid. Min 16 Max: 48000000"}

      ,"remote":"10.100.199.23:53450","connectionId":295}}
       

      Additional Notes

      The error seems a bit random, as it can succeed 3 times, then failing twice, resatrting mongod does not help.

      server versions:

             driver: { [-]
               name: MongoDB Internal Client
               version: 7.0.28
             }
             os: { [-]
               architecture: x86_64
               name: Ubuntu
               type: Linux
               version: 20.04
             }
      

       

            Assignee:
            Unassigned
            Reporter:
            Xavier Ronteix
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: