title: Getting MongoDB error on Write - quota exceeded
body: <p>I have a JAVA app which writes to a replicaset. Am using 3.0.7 version of MongoDB server.  The mongo-driver for Java is 3.0.4.
  It was working just fine but now am getting the following error on ALL writes:</p>
  
  <pre><code>com.mongodb.MongoWriteException: quota exceeded
  at    com.mongodb.MongoCollectionImpl.executeSingleWriteRequest(MongoCollectionImpl.java:487)
  at com.mongodb.MongoCollectionImpl.update(MongoCollectionImpl.java:474)
  at com.mongodb.MongoCollectionImpl.updateOne(MongoCollectionImpl.java:325)
  </code></pre>
  
  <p>Have looked at the MongoDB config documentation and I have not set any quota limits in mongod.conf. Am not using smallFiles either.</p>
  
  <p>But I think am running into fileSize limits. The file sizes for my DB are as follows:</p>
  
  <pre><code>total 6240548
  -rw------- 1 mongod mongod   67108864 Dec  8 16:55 2015.0
  -rw------- 1 mongod mongod  134217728 Dec  8 12:15 2015.1
  -rw------- 1 mongod mongod  268435456 Dec  8 12:15 2015.2
  -rw------- 1 mongod mongod  536870912 Dec  8 12:15 2015.3
  -rw------- 1 mongod mongod 1073741824 Dec  8 12:15 2015.4
  -rw------- 1 mongod mongod 2146435072 Dec  8 16:06 2015.5
  -rw------- 1 mongod mongod 2146435072 Dec  8 16:06 2015.6
  -rw------- 1 mongod mongod   16777216 Dec  8 16:55 2015.ns
  drwxr-xr-x 2 mongod mongod       4096 Dec  7 09:14 _tmp
  </code></pre>
  
  <p>The /etc/mongod.conf is as follows:</p>
  
  <pre><code>    storage:
         dbPath: /data/mongoDB
         indexBuildRetry: true
         repairPath: /data/mongoDB/repair
         journal:
            enabled: true
         directoryPerDB: true
         syncPeriodSecs: 60
         engine: mmapv1
         mmapv1:
            preallocDataFiles: false
            nsSize: 16
            quota:
               enforced: false
               maxFilesPerDB: 8
            smallFiles: false
            journal:
               debugFlags: 0
               commitIntervalMs: 100
  </code></pre>
  
  <p>What can be going wrong?</p>
  
  <p>PS: /etc/mongod.conf is being used.</p>
  
  <pre><code>mongod   10864     1  0 Nov16 ?        03:10:34 /usr/bin/mongod -f /etc/mongod.conf
  </code></pre>
  
  <p>Update- 1 .Tried the same update by changing collection name to a new collection. THat worked! but doesnt explain the issue yet.  2. Changed java driver to 3.0.3, that didnt help.</p>
  
  <p><strong>Update- 2:(12/9)</strong> Adding Collection Stats, since it is something to do with the collection itself and the java driver. Let me know if something seems awry pls.</p>
  
  <pre><code>    {
          "ns" : "2015.events",
          "count" : 827054,
          "size" : 3814018,
          "avgObjSize" : 4722,
          "numExtents" : 22,
          "extents" : [
              {
                  "len" : 8192,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 20480
                  }
              },
              {
                  "len" : 32768,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 2134016
                  }
              },
              {
                  "len" : 131072,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 2166784
                  }
              },
              {
                  "len" : 524288,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 2297856
                  }
              },
              {
                  "len" : 2097152,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 2822144
                  }
              },
              {
                  "len" : 8388608,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 4919296
                  }
              },
              {
                  "len" : 11325440,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 14356480
                  }
              },
              {
                  "len" : 15290368,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 28827648
                  }
              },
              {
                  "len" : 20643840,
                  "loc: " : {
                      "file" : 0,
                      "offset" : 44118016
                  }
              },
              {
                  "len" : 27869184,
                  "loc: " : {
                      "file" : 1,
                      "offset" : 8192
                  }
              },
              {
                  "len" : 37625856,
                  "loc: " : {
                      "file" : 1,
                      "offset" : 36265984
                  }
              },
              {
                  "len" : 50798592,
                  "loc: " : {
                      "file" : 1,
                      "offset" : 78086144
                  }
              },
              {
                  "len" : 68579328,
                  "loc: " : {
                      "file" : 2,
                      "offset" : 8396800
                  }
              },
              {
                  "len" : 92585984,
                  "loc: " : {
                      "file" : 2,
                      "offset" : 93753344
                  }
              },
              {
                  "len" : 124993536,
                  "loc: " : {
                      "file" : 3,
                      "offset" : 8192
                  }
              },
              {
                  "len" : 168742912,
                  "loc: " : {
                      "file" : 3,
                      "offset" : 125001728
                  }
              },
              {
                  "len" : 227803136,
                  "loc: " : {
                      "file" : 4,
                      "offset" : 8192
                  }
              },
              {
                  "len" : 307535872,
                  "loc: " : {
                      "file" : 4,
                      "offset" : 239136768
                  }
              },
              {
                  "len" : 415174656,
                  "loc: " : {
                      "file" : 4,
                      "offset" : 595939328
                  }
              },
              {
                  "len" : 560488448,
                  "loc: " : {
                      "file" : 5,
                      "offset" : 8192
                  }
              },
              {
                  "len" : 756662272,
                  "loc: " : {
                      "file" : 5,
                      "offset" : 607756288
                  }
              },
              {
                  "len" : 1021497344,
                  "loc: " : {
                      "file" : 6,
                      "offset" : 8192
                  }
              }
          ],
          "storageSize" : 3826952,
          "lastExtentSize" : 997556,
          "paddingFactor" : 1,
          "paddingFactorNote" : "paddingFactor is unused and unmaintained in 3.0. It remains hard coded to 1.0 for compatibility only.",
          "userFlags" : 1,
          "capped" : false,
          "nindexes" : 8,
          "indexDetails" : {
  
          },
          "totalIndexSize" : 348270,
          "indexSizes" : {
              "_id_" : 47123,
              "remoteRequest.uri_1" : 76969,
              "transactionId_1" : 59611,
              "startTime_1" : 39027,
              "endTime_1" : 35235,
              "remoteRequest.queryParams.q_1" : 20328,
              "remoteRequest.queryParams.fq_1" : 38285,
              "elapsedTimeInNanos_1" : 31689
          },
          "ok" : 1
      }
  </code></pre>