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

Error not handle properly MongoError: quota exceeded #5005

Closed
jadhavmanoj opened this issue Aug 27, 2018 · 4 comments
Closed

Error not handle properly MongoError: quota exceeded #5005

jadhavmanoj opened this issue Aug 27, 2018 · 4 comments

Comments

@jadhavmanoj
Copy link

Issue Description:
Database server raised an error MongoError: quota exceeded. It is not handle in parse server.

Expected Results:
Parse server should throw this error. Parse server expecting Error object but there is no check for it. mongo server throws string as MongoError: quota exceeded.

Actual Outcome:
Exact error should be logged

Environment Setup

  • Server
    • parse-server version (Be specific! Don't say 'latest'.) : 2.7
    • Operating System: ubuntu
    • Localhost or remote server? AWS
  • Database
    • Localhost or remote server? Mlab

Logs/Trace

var/app/current/node_modules/parse-server/lib/ParseServer.js:218
          throw err;
          ^
MongoError: quota exceeded
    at Function.MongoError.create (/var/app/current/node_modules/agenda/node_modules/mongodb-core/lib/error.js:31:11)
    at toError (/var/app/current/node_modules/agenda/node_modules/mongodb/lib/utils.js:139:22)
    at /var/app/current/node_modules/agenda/node_modules/mongodb/lib/collection.js:748:67
    at /var/app/current/node_modules/agenda/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! start_prod: `node --trace-warnings --max-old-space-size=2048 -r dotenv/config server.js`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the hinge-server@1.0.0 start_prod script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have added below code to fix for now

process.on('uncaughtException', err => {
        if (typeof err === string) {
          process.stderr.write(`mongodb error ${err}.`);
        }
        if (err.code === 'EADDRINUSE') {
          // user-friendly message for this common error
          process.stderr.write(`Unable to listen on port ${err.port}. The port is already in use.`);
          process.exit(0);
        } else {
          throw err;
        }
      });

Just want to confirm is that, whatever is fixed is correct or should be handle in different way.

Thanks

@flovilmart
Copy link
Contributor

Thanks for reporting the issue.

The error is just thrown back, as it is. I’m not sure what the issue is. You shared the logs that actually show that the error is properly logged.

@nebitrams
Copy link

I am planning to upgrade to parse-server v3.0.0 next month. May I check with you what is the latest MondoDB version supported? I am planning to upgrade my mLab Mongo DB from 3.2.10 to 3.4.16.

Where can I find the supported mongoDB version on parse website?

@flovilmart
Copy link
Contributor

All versions of mongodb are supported.

@stale
Copy link

stale bot commented Oct 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

3 participants