Troubleshooting
On this page
Command Errors
Error: missing credentials
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.
mongocli: command not found
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.
401 (request "Unauthorized") You are not authorized for this resource.
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.
401 (request "Unauthorized") Current user is not authorized to perform this action.
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).
401 (request "Unauthorized") The currently logged in user does not have the group creator role in organization <org-id>.
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.
403 (request "Forbidden") IP address <ip-address> is not allowed to access this resource.
The API key specified in your configuration file is not on the access list for the requested project.
404 (request "Not Found") An invalid group ID <group-id> was specified.
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.
404 (request "Not Found") Organization <org-id> is not an Atlas organization.
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
.
Unsupported service: <service-name>
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.
Alert Config Not Deleted
This error might appear if MongoDB CLI cannot delete the alert configuration specified by the ID.
Configuration Errors
Blank output when reading home directory
This error might appear if MongoDB CLI cannot access your home directory.
HOMEDRIVE, HOMEPATH, or USERPROFILE are blank
This error might appear if MongoDB CLI cannot access your home directory.