Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More understandable error message when max_document_size has been reached #343

Open
pana87 opened this issue Apr 24, 2024 · 3 comments
Open

Comments

@pana87
Copy link

pana87 commented Apr 24, 2024

Expected Behavior

Understandable error message

Current Behavior

I was getting this error suddenly on every insert operation:

Error: users at responseHandler (../node_modules/nano/lib/nano.js:193:20) at ../node_modules/nano/lib/nano.js:442:13 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Possible Solution

I updated the max_document_size in the couchdb configs

Context

I spent 3 days trying to find out what this error meant. Maybe it would be useful for developers if the error message was a bit more understandable.

@YakovL
Copy link
Contributor

YakovL commented Aug 15, 2024

Can you check if it comes from this line? It's 442 in the error message, but something different in the current code.

If you can still reproduce the issue, can you also patch that bit by adding console.log(e) and share the output here?

I guess, this can be improved by patching streamResponseHandler; can you share a more specific message you'd expect? Like "max_document_size has been reached when/for ..."

@pana87
Copy link
Author

pana87 commented Aug 15, 2024

I reproduced this by decreasing the max_document_size and tried an insert operation.

"max_document_size has been reached" this is a understandable error i guess. maybe we could provide the solution also like: go to config -> go to section couchdb -> add or increase max_document_size option or something like this, would be very helpful. what do you think? @YakovL

Here is the console.log(e)

e AxiosError: Request failed with status code 413
    at settle (/Users/pnts/repositories/getyour/getyour-platform/node_modules/axios/dist/node/axios.cjs:1967:12)
    at IncomingMessage.handleStreamEnd (/Users/pnts/repositories/getyour/getyour-platform/node_modules/axios/dist/node/axios.cjs:3062:11)
    at IncomingMessage.emit (node:events:531:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: 'ERR_BAD_REQUEST',

Here is the initial error

Error: logs
    at responseHandler (/Users/pnts/repositories/getyour/getyour-platform/node_modules/nano/lib/nano.js:193:20)
    at /Users/pnts/repositories/getyour/getyour-platform/node_modules/nano/lib/nano.js:442:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  scope: 'couch',
  statusCode: 413

@YakovL
Copy link
Contributor

YakovL commented Aug 17, 2024

Hi @pana87, good thinking about making the error message helpful, may be it can read "max_document_size has been reached, you may want to open config [what config?], ...". However, the problem here is that the error doesn't seem to be specific enough to be attributed to the max_document_size issue – can be something different in another case. May be you can try to check the response with the Dev Tools and check if it conatins anything more specific to extract? If it doesn't contain enough info, this would be an issue of the server, not that of the nano client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants