Open Pujith01 opened 2 months ago
Remove # TODO from your oci_config file
key_file=/home/ubuntu/oracle-freetier-instance-creation/oci_api_private_key.pem
This solved the issue for me if it doesn't for you it may be another issue.
do the following in console
source .venv/bin/activate
python3 main.py
And you should see an output error that will tell you what is wrong.
@Pujith01 if its 401 , get a new API key and try again
I am having the same issue. This is the error
File "/home/ubuntu/oracle-freetier-instance-creation/main.py", line 86, in <module> iam_client = oci.identity.IdentityClient(config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.12/site-packages/oci/identity/identity_client.py", line 90, in __init__ signer = Signer( ^^^^^^^ File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.12/site-packages/oci/signer.py", line 255, in __init__ self.private_key = load_private_key_from_file(private_key_file_location, pass_phrase) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.12/site-packages/oci/signer.py", line 33, in load_private_key_from_file return load_private_key(private_key_data, pass_phrase) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.12/site-packages/oci/signer.py", line 86, in load_private_key raise InvalidPrivateKey("The provided key is not a private key, or the provided passphrase is incorrect.") oci.exceptions.InvalidPrivateKey: The provided key is not a private key, or the provided passphrase is incorrect.
But the private key is the key I just generated and used.
I did all the configuration in VM.Standard.E2.1.Micro. It installed all the dependencies and in the end, it gave this unhandled exception.