reactioncommerce / migrator

Command line interface for migrating MongoDB databases
Apache License 2.0
4 stars 5 forks source link

Reserved characters in mongodb URL break parsing #27

Open jfelten opened 3 years ago

jfelten commented 3 years ago

Special shell characters like '$' and '@' break the url parser when used like:

MONGO_URL="mongodb://user@domain.com:PasswordWith$@host1:27017,host2:27017/reaction?replicaSet=rs0&readPreference=primaryPreferred&authSource=admin" npx migrator migrate

Characters must be escaped:

MONGO_URL="mongodb://user\@domain.com:PasswordWith\$@host1:27017,host2:27017/reaction?replicaSet=rs0&readPreference=primaryPreferred&authSource=admin" npx migrator migrate

As is the error message is confusing and vague. Can documentation and error messages to ask uses to verify this? A simple error message asking to check for this will save users a lot of time and confusion.

loan-laux commented 3 years ago

Thanks @jfelten. Can an admin move this issue to migrator?