Troubleshooting the CLI
This topic describes how to resolve issues that you might encounter when installing Python or the CLI, or when using the CLI.
Installation Errors
If you see an error similar to this when installing with pip:
Could not fetch URL https://pypi.org/simple/oci-cli/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/oci-cli/ (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:877)'),)) - skipping Your machine may not be connected to external internet, or your network settings are blocking access to pypi. Consult with your network administrator to fix your network settings, or try performing an Offline Installation or using the Container Image.
Upgrade Errors
If you are seeing an outdated version number after performing a CLI upgrade, you should try uninstalling the previous version of the CLI.
oci setup find-installations Note that this command is not available in CLI versions 3.4.0 and earlier.
Service Errors
401 Error - Not Authenticated
A service error has a status of 401 and a code of NotAuthenticated might indicate an invalid configuration file.
Please follow the instructions in Setting up the Configuration File to set up and verify your configuration file.
SSL Errors
Request Exception
RequestException: HTTPSConnectionPool(host='<some_service_endpoint>', port=443): Max retries exceeded with url: <some_url> (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])"))) Please follow the instructions in Setting up the Configuration File to set up and verify your configuration file.
Certification Verify Failed Using a Local Certification
A CERTIFICATE_VERIFY_FAILED exception might indicate that the CLI cannot find the additional certification your operation requires.
export CERT_PATH=$(python3 -m certifi) This will return output similar to the following:/usr/local/lib/python3/site-packages/certifi/cacert.pem export REQUESTS_CA_BUNDLE=${CERT_PATH} Certification Verify Failed Using a Certification in an Instance
A CERTIFICATE_VERIFY_FAILED exception might indicate that the CLI cannot find the additional certification your operation requires. In some cases, the certification file may already be provisioned in the host.
export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem export REQUESTS_CA_BUNDLE=path_to_cert_bundle_file Certification Verify Failed: URL Error
If your machine is running a macOS variant of python 3.6 or 3.7, and you see the following message despite setting your certification path correctly:urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1051)> ERROR: Failed to download virtualenv package. Please check that your trusted certificates are up to date and include the certificates necessary to verify github.com /Applications/Python 3.7/Install Certificates.command Run the CLI installer after the Certificates command runs successfully.
Oracle Linux Permissions Issues
On Oracle Linux 7.3, if you encounter permission issues when running pip install, you might need to use sudo.
oci Command Not Found
If the oci command isn't found, this can be caused by one of the following reasons:
- pip installed the package to a different virtual environment than your active one.
- You switched to a different active virtual environment after you installed the CLI.
To determine where the CLI is installed, run the which pip and which oci commands.
ERROR: Could not find config file at /root/.oci/config
This error can occur when running a CLI command such as the following:
oci iam authentication-policy get --compartment-id <tenancy_OCID> If the config file isn't found, use one of the following options:
- Use the Console to create a CLI session.
- Use the Cloud Shell.
- Create a
configfile using one the options in Setting up the Configuration File.
Wheel File Won't Install
If the wheel file won't install, verify that pip is up to date. To update pip, run the pip install -U pip command. Try to install the wheel again.
Windows Issues
If the oci command isn't found, make sure that the oci.exe location is in your path (for example, the Scripts directory in your Python installation).
No Matching Distribution Found
Error: No matching distribution found for oci-cli==3.x.x
This error occurs if you are attempting to install the CLI in a Python 2 environment. Support for Python 2 was deprecated as of August 1, 2021.
To resolve this issue, update your Python to version 3.6.5 or later. If you require Python 2, any CLI version starting with 2.x.x will still support Python 2.
Silent Data Corruption Using put Command
Issue: Users using the oci os object put command with data from STDIN might see silent data corruption in FIPS mode or in an environment which uses a FIPS-compliant OpenSSL version. The CLI reports that the upload operation was successful, but no data is uploaded.
To mitigate this issue, update the OCI CLI version to 3.4.1 or greater.
Users initially setting up FIPS for the CLI should follow the instructions in Using FIPS-validated Libraries
Contact Information
If you want to search for an issue not listed here, contribute ideas, report a bug, get notified about updates, or have questions or feedback, use one of the following links.
Contributions
Got a fix for a bug, or a new feature you'd like to contribute? The CLI is open source and accepting pull requests on GitHub.
Notifications
To be notified when a new version of the CLI is released, subscribe to the Atom feed.
Questions or Feedback
Ways to get in touch:
- GitHub: To search for issues or to file bugs and feature requests.
- Stack Overflow: Use the oracle-cloud-infrastructure and oci-cli tags in your post.
- Developer Tools section of the Oracle Cloud forums
- My Oracle Support