Closed FLOKHOME closed 5 months ago
this is probably due to improper oci_config
file
check if your file is having 6 lines and you mentioned the key file path properly, here is a sample_oci_config
Here is the content (censored): [DEFAULT] user=ocid1.user.oc1..aaaaaaaasu........ fingerprint=89:8c:48:18:c6:XXXXXXXX tenancy=ocid1.tenancy.oc1..aaaaaaaa....... region=eu-frankfurt-1 key_file=/home/ubuntu/oracle-freetier-instance-creation/oci_api_private_key.pem
try running the main.py file, if you encounter any errors, share the error msg here
To activate the environment and execute the Python file, you can use the following commands once you are in project root directory:
source .venv/bin/activate
python3 main.py
Seems to be a problem with the key ?!
Traceback (most recent call last): File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.10/site-packages/oci/signer.py", line 53, in load_private_key return serialization.load_pem_private_key(secret, pass_phrase, backend=backend) File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.10/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 494, in _handle_key_loading_error raise ValueError( ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [<OpenSSLError(code=503841036, lib=60, reason=524556, reason_text=unsupported)>])
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ubuntu/oracle-freetier-instance-creation/main.py", line 52, in
Found ! Error 40....40 cm in front of the screen... I downloaded the API private key, but did not enter the content 1:1 in the "oci_api_private_key.pem"...
tail -f launch_instance.log
2024-03-11 10:02:22,144 - INFO - Command: launch_instance Output: {'status': 500, 'code': 'InternalError', 'message': 'Out of host capacity.'} 2024-03-11 10:04:23,133 - INFO - Command: launch_instance Output: {'status': 500, 'code': 'InternalError', 'message': 'Out of host capacity.
great. I'll update the bash script to handle OCI_CONFIG errors and provide informative feedback to users
I have one more question: The AD is always AD-1, AD-2 etc, not AD1, AD2 ? Is the "-" relevant?
yes, -
is essential. if you see the full availability domain names in the screenshot, you see they are actually ending with AD-1 , AD-2 , we are filtering these based on how they end
Also interesting:
Also interesting:
that's Oracle's measures for spam prevention. We wait for a brief period when encountering such occurrences before attempting a retry
Release v1.1 is handling these improper config file errors. Hence closing the issue
Hello and thank you for the project. Unfortunately I can't get it to work. I have created the configuration, executed the script - no errors. But the log files (launch_instance.log and setup_and_info.log) remain empty.
oci.env:
Folder:
Script-Output
Have I overlooked something or done something wrong?