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

Timestamp Auto closed the TCP cause MongoNetworkError #49

Open
kayac-chang opened this issue Aug 13, 2019 · 0 comments
Open

Timestamp Auto closed the TCP cause MongoNetworkError #49

kayac-chang opened this issue Aug 13, 2019 · 0 comments

Comments

@kayac-chang
Copy link

I Worked with

  • "mongoose": 5.6.9
  • "mongoose-timestamp": 0.6.0

Do you want to request a feature or report a bug?
I want to report a bug.

What is the current behavior?
When I working with a long process task like transfer data from MySQL to Mongo Atlas.
I try so many time but finally I got this:

(node:74121) UnhandledPromiseRejectionWarning: MongoNetworkError: connection 2 to cluster0-shard-00-01-ug0nb.gcp.mongodb.net:27017 closed
    at TLSSocket.<anonymous> (/Users/kayac/Projects/Work/Backend_Server/node_modules/mongodb-core/lib/connection/connection.js:352:9)
    at Object.onceWrapper (events.js:288:20)
    at TLSSocket.emit (events.js:200:13)
    at net.js:586:12
    at TCP.done (_tls_wrap.js:479:7)

And My config like this:

    const db = await mongoose.connect(path, {
        useNewUrlParser: true,
        socketTimeoutMS: 600 * 1000,
        connectTimeoutMS: 600 * 1000,
        autoReconnect: true,
        keepAlive: true,
        reconnectTries: 30,
        poolSize: 20,
    });

socketTimeoutMSand connectTimeoutMS both doesn't help.

But I remove the

const timestamps = require('mongoose-timestamp');
Schema.plugin(timestamps);

And My task success.

Did mongoose timestamp auto close the TCP connection when process too long?

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

1 participant