Closed jjabo closed 3 years ago
Thanks for the heads up! This is a super simple fix, but I'm surprised they changed the SASL mechanism in this way.
Can you try the latest master branch
I haven't updated my environments just yet, as I just had a vacation. I'll be able to better evaluate this once I'm all updated.
I checked it against the master/6.0 branch and it seems fixed! However, the first connection takes about 10-15 seconds - is that expected behavior?
This was the fastest response and fix ever - Thank you!
@jjabo You're welcome! On DEBUG mode, the password hashing used to authenticate to MongoDB is unfortunately quite slow. Swift is extremely unoptimised in DEBUG compilation. You'll notice a significant performance improvement on RELEASE builds, which is what production must always be compiled on. The credential proof is only computed once, and cached after that. However, inbetween launches this cache is lost. You can, if you want to, save that cache to the disk & load it again the next boot. If you're interested in that, please poke me on Discord :)
Thanks again. That is super helpful info and advice! :) Looking forward to the next tag/release including the bugfix.
Tagged!
The connection to mongodb fails, using vapor 4, the fluent-mongo-driver and the connection string mongodb://UserAdmin:ABCDEF@localhost:27017/admin Following error is produced in MongoKitten: [ ERROR ] Connection to Host(hostname: "localhost", port: 27017) disconnected with error MongoGenericErrorReply(ok: 0, errorMessage: Optional("BSON field \'saslContinue.conversationId\' is the wrong type \'long\', expected type \'int\'"), code: Optional(14), codeName: Optional("TypeMismatch"))
The connection works using e.g. MongoDB Compass. I tried as mechanisms SCRAM-SHA-1, SCRAM-SHA-256 and auto. If I disable the authorization the connection works.
The mongodb user account looks as follows: [ { _id: 'admin.UserAdmin', userId: UUID("5f48a642-221b-4399-bfe5-2524587d7d5a"), user: 'UserAdmin', db: 'admin', roles: [ { role: 'readWriteAnyDatabase', db: 'admin' }, { role: 'userAdminAnyDatabase', db: 'admin' } ], mechanisms: [ 'SCRAM-SHA-1', 'SCRAM-SHA-256' ] } ]
Environment: