Mongoimport error: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field

I am trying to import some json files to mongodb collections using following command on a server other than mongodb server:

mongoimport --host IP --port 27017 -u myuser -p mypass --authenticationDatabase admin --db dbname --collection collection --drop --type json --file absolutejsonfilepath --jsonArray

It is throwing following error:

server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.

How ever If I hit the same command on mongodb server itself then it works. I have checked all credentials & other details. All details are correct.

update

if I run the command using -vvvv parameter (for verbose output) then I got this:

2022-05-12T12:29:22.261+0000    checking options
2022-05-12T12:29:22.262+0000            dumping with object check disabled
2022-05-12T12:29:22.262+0000    will listen for SIGTERM, SIGINT, and SIGKILL
2022-05-12T12:29:22.283+0000    got error from options parsing: error connecting to db server: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
2022-05-12T12:29:22.283+0000    Failed: error connecting to db server: server returned error on SASL authentication step: BSON field 'saslContinue.mechanism' is an unknown field.
1 Like

What is your mongodb version and mongoimport version?
It could be due to version related issues
Try to use latest mongoimport from mongodb tools

Mongodb version: 5.0.8
Mongoimport version: 100.5.2

I have latest version of Mongoimport 100.5.2 on my machine.

Can you connect to your db from the host where you are trying to run mongoimport?
Are you using any special characters in your password?
If yes try to escape it
or
Does it work with lower version of mongoimport?

Can you connect to your db from the host where you are trying to run mongoimport? YES
Are you using any special characters in your password? NO
Does it work with lower version of mongoimport?
I AM NOT ABLE TO DOWNGRADE TO VERSION 100.5.1. THE INSTALLATION STEPS MENTIONED IN THE BELOW LINK GIVES ERROR:

ERROR: dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

It worked with the mongoimport version 100.5.1. For downgrade issue I removed all db tools from the host using command:

sudo apt-get --purge remove mongodb-org
sudo apt purge mongodb*

After that I force install mongodb tools on the host:

sudo dpkg -i --force-all mongodb-database-tools-ubuntu2004-x86_64-100.5.1.deb

After that I tried mongoimport command on the host then it worked.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.