Docs Menu
Docs Home
/ /
MongoDB Command Line Interface

Troubleshooting

On this page

  • Command Errors
  • Configuration Errors

You might not have properly set up your API keys. Ensure that you added your API keys to your profile or your environment variables. If you created a profile with a custom name or are using more than one profile, ensure that you are specifying the correct profile with the --profile flag.

For more information on properly configuring your profile, see Configure the MongoDB CLI.

The mongocli executable might be in a directory which is not in your path. You can either add the directory to your path, move the executable to a directory which is in your path, or run the executable directly from its location.

The credentials you have provided are not valid for the project specified in your MongoDB CLI command. Check your public and private key strings for accuracy.

If your credentials are stored in a configuration file, make sure that the configuration file is in the correct location. The default location is the .config folder of your home directory. If you move the configuration file somewhere else, be sure to specify the location in the $XDG_CONFIG_HOME environment variable. If MongoDB CLI cannot find your configuration file and no credentials are stored in environment variables, a 401 error will result.

The API key specified in your configuration file does not have permission to perform the requested action. API keys are configured with specific permission levels, from Project Read Only (minimum permission level) up to Project Owner (full permissions).

This error might appear when trying to create a new project. Your specified API key must have the Organization Project Creator role at the organization level in order to create new projects.

The API key specified in your configuration file is not on the access list for the requested project.

The project ID entered with the command does not exist. Check your project ID by navigating to the Settings sub-section of the Project section in the Atlas left-side navigation.

Note

group ID and project ID are synonymous in MongoDB cloud services.

To use the MongoDB CLI with Cloud Manager or Ops Manager, you must specify the service in your configuration file. If you don't specify a service, MongoDB CLI defaults to Atlas.

Some operations are available only for Atlas, while others are available only for Cloud Manager or Ops Manager. This error might appear if you request an operation which is not available for the specified service.

This error might appear if MongoDB CLI cannot delete the alert configuration specified by the ID.

This error might appear if MongoDB CLI cannot access your home directory.

This error might appear if MongoDB CLI cannot access your home directory.