0

I am unable to upload large documents in couchDB. I am using Node.js to upload with help of ActiveMQ. Small documents are uploading. I tried to upload a document which is 30 MB, but it failed with the following exception:

(node:28) UnhandledPromiseRejectionWarning: Error: document_too_large
    at Request._callback (/app/node_modules/**/multitenant/node_modules/nano/lib/nano.js:151:15)
    at Request.self.callback (/app/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/app/node_modules/request/request.js:1154:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:28) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:28) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • 2
    How is ActiveMQ involved here? The error seems related to Node.js directly with nothing to do with ActiveMQ. Please clarify. Thanks! – Justin Bertram Jun 02 '22 at 13:24

1 Answers1

0

The answer is right there on the first line of the error stack

(node:28) UnhandledPromiseRejectionWarning: Error: document_too_large

The default maximum document size for couchDB is 8000000 bytes which is far below 30mb.

FWIW 30mb is a lot of data, are you certain the data shouldn't be an attachment? See this related SO Q/A.

RamblinRose
  • 4,883
  • 2
  • 21
  • 33
  • can we increase this default size? – Prashant Hanji Jun 03 '22 at 09:55
  • Of course as the documentation linked reads, that's a configuration value. Note it used to be 4GB before 3.0. This was changed in 3.0, because of FoundationDB. You can increase it, but beware it will be a real problem if ever needing to migrate to couchDB 4.0. In my opinion there is something wrong if your docs are > 1mb. See https://news.ycombinator.com/item?id=22426412 – RamblinRose Jun 03 '22 at 13:03