MongoDB deployment does not support retryable writes

I’m trying to test a simple sharded MongoDB cluster configuration, with MongoDB 4.4.6 on Ubuntu 20.04, installed from the official mongodb-org package. I ran the following steps:

  1. Start up shard servers:
    mkdir ./mongo1 ./mongo2
    mongod --shardsvr --dbpath ./mongo1 --port 27014
    mongod --shardsvr --dbpath ./mongo2 --port 27015

  2. Start up config server:
    mkdir ./mongoconfig
    mongod --configsvr --replSet configSet --dbpath ./mongoconfig --port 27016

  3. Connected to the config server using mongo localhost:27016 and ran the following command to initiate the (single-node) config server cluster:
    rs.initiate({ _id: 'configSet', configsvr: true, members: [ { _id: 0, host: 'localhost:27016' } ] })

  4. Start up mongos:
    mongos --configdb configSet/localhost:27016 --port 27020

  5. Connect to mongos in the admin database with mongo localhost:27020/admin, and configure sharding servers:

  6. Configure sharding for database test and collection test.cities:
    db.runCommand({ enablesharding : "test" })
    db.runCommand({ shardcollection : "test.cities", key : {name : 1} })

  7. Finally, import some test data using mongoimport.
    The data to import is in the file cities.json, whose content is:
    [{"name":"Sant Julià de Lòria", "country":"AD", "timezone":"Europe/Andorra", "population":8022, "location": { "longitude":42.46372, "latitude":1.49129} }, {"name":"Pas de la Casa", "country":"AD", "timezone":"Europe/Andorra", "population":2363, "location": { "longitude":42.54277, "latitude":1.73361} }]
    The import command is:
    mongoimport --host localhost:27020 --db test --collection cities --type json cities.json --jsonArray

When running the import command, I get the following error:

Failed: this MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string

I also tried the following, which gives the exact same error:

mongoimport --uri "mongodb://localhost:27020/?retryWrites=false" --db test --collection cities --type json cities.json --jsonArray

What am I missing? How do I make retryable writes work in this simple sharded cluster?

Thank you.

What is the version of your mongoimport?
Check this link


Thank you for the reply.

The version of mongoimport that I used is 100.4.0, which is a bit higher than the “Fix Version/s” reported in the ticket (100.2.1),.