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

Load balancer mode requires driver version 4+ #201

Open
RubenatorX opened this issue May 4, 2022 · 14 comments
Open

Load balancer mode requires driver version 4+ #201

RubenatorX opened this issue May 4, 2022 · 14 comments
Labels

Comments

@RubenatorX
Copy link

So, due to a change in mongodb atlas server, I've had to upgrade the mongodb driver to 4.1+ (currently 4.1.4), but, when I try to use windston-mongodb after that update I get:

{
  level: 'trace',
  db: 'mongodb+srv://***/***?retryWrites=true&w=majority',
  collection: 'server_logs',
  options: { useNewUrlParser: true, useUnifiedTopology: true }
}
winston-mongodb: error initialising logger MongoParseError: Load balancer mode requires driver version 4+
    at QueryReqWrap.callback (***\project\node_modules\winston-mongodb\node_modules\mongodb\lib\core\uri_parser.js:111:27)
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:212:10)
    at QueryReqWrap.callbackTrampoline (internal/async_hooks.js:130:17)

Does this package not support driver 4.1+? or do I just have something misconfigured?

@asdfdelta
Copy link

Did you ever solve this?

@RubenatorX
Copy link
Author

Did you ever solve this?

nope

@asdfdelta
Copy link

@RubenatorX I found the issue. The package is using Mongoose v5, it needs to upgrade to v6 in order to take advantage of the v4 driver from Mongodb.

I ended up copying the index.js and put it in a separate file at my root. Then installed the latest Mongoose and fastify-plugin, require('./newfilelocation.js') instead of the package and it seems to work great so far. A shame these guys don't maintain any of these packages.

@RubenatorX
Copy link
Author

RubenatorX commented Aug 25, 2022

@RubenatorX I found the issue. The package is using Mongoose v5, it needs to upgrade to v6 in order to take advantage of the v4 driver from Mongodb.

I ended up copying the index.js and put it in a separate file at my root. Then installed the latest Mongoose and fastify-plugin, require('./newfilelocation.js') instead of the package and it seems to work great so far. A shame these guys don't maintain any of these packages.

@asdfdelta Ew. But ty haha. Not sure if I will try that or just handle error reporting/logging with something else

@asdfdelta
Copy link

@RubenatorX I thought briefly about making a 3rd package and trying to keep that up to date, but then https://xkcd.com/927/

If you take that plunge, let me know so I can import your package lol

@wbt
Copy link

wbt commented Aug 26, 2022

A shame these guys don't maintain any of these packages.

To be clear, there is zero funding to do so and as one of the most active maintainers these days, I don't currently use the Mongo driver so I don't have a lot of familiarity or incentive to dive into the tech and gain it. https://xkcd.com/2347/ is a little more on the nose here...

@asdfdelta
Copy link

That's why we create issues to help you guys out. Just updating the package.json to use the v6 adapter of Mongoose will solve this issue.

@wbt
Copy link

wbt commented Nov 15, 2022

Just updating the package.json to use the v6 adapter of Mongoose will solve this issue.

Useful to know and the first time it's been said, but there's also backwards compatibility testing & verification that this doesn't break existing code. That's real work and hard for me specifically as I'm not currently a user of the mongoDB module.

@asdfdelta
Copy link

https://mongoosejs.com/docs/migrating_to_6.html

I suppose there might be issues there, yeah. It's a shame you created something that cannot ever be updated, could in the very least open up the PRs for review or allow someone else to take it over.

@wbt
Copy link

wbt commented Dec 14, 2022

The project is open to PRs and any submitted PRs are open to anyone testing and reviewing them to say what they found.

@1986webdeveloper
Copy link

1986webdeveloper commented Mar 16, 2023

So, due to a change in mongodb atlas server, I've had to upgrade the mongodb driver to 4.1+ (currently 4.1.4), but, when I try to use windston-mongodb after that update I get:

{
  level: 'trace',
  db: 'mongodb+srv://***/***?retryWrites=true&w=majority',
  collection: 'server_logs',
  options: { useNewUrlParser: true, useUnifiedTopology: true }
}
winston-mongodb: error initialising logger MongoParseError: Load balancer mode requires driver version 4+
    at QueryReqWrap.callback (***\project\node_modules\winston-mongodb\node_modules\mongodb\lib\core\uri_parser.js:111:27)
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:212:10)
    at QueryReqWrap.callbackTrampoline (internal/async_hooks.js:130:17)

Does this package not support driver 4.1+? or do I just have something misconfigured?

Hello is it resolved ? because I m still facing issue Even I upgraded my mongoose version from v5 to v6

@DABH
Copy link
Contributor

DABH commented Jul 13, 2023

We updated to the latest version of mongoose on master, but we still need help upgrading to the latest mongodb package, see #223. If anyone is willing to step up and volunteer to fix this, it would be a huge help and would likely solve this and several related issues on the project.

@klemensz
Copy link

klemensz commented Jul 14, 2023

If anyone is willing to step up and volunteer to fix this

You mean because of the failing unit tests?

@DABH
Copy link
Contributor

DABH commented Jul 14, 2023

Yes

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

No branches or pull requests

7 participants