mohankumarpaluru / oracle-freetier-instance-creation

A script to create free instance
MIT License
176 stars 34 forks source link

ERROR, script not working #26

Closed Sermatty closed 5 months ago

Sermatty commented 5 months ago

Describe the bug

Hello,

I wanted to check if the script was working, but I noticed that the logs were completely empty. Therefore, I executed the following commands:

source .venv/bin/activate python3 main.py However, I encountered the following error:

Traceback (most recent call last): File "/home/ubuntu/oracle-freetier-instance-creation/main.py", line 67, in config = oci.config.from_file(oci_config_path) File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.10/site-packages/oci/config.py", line 120, in from_file invalid_key_file_path_checker(config, expanded_file_location, profile_name) File "/home/ubuntu/oracle-freetier-instance-creation/.venv/lib/python3.10/site-packages/oci/config.py", line 224, in invalid_key_file_path_checker raise InvalidKeyFilePath(message) oci.exceptions.InvalidKeyFilePath: Config file /home/ubuntu/oracle-freetier-instance-creation/oci_config is invalid: the key_file's value '</home/ubuntu/oracle-freetier-instance-creation/oci_api_private_key.pem> # TODO' at line 6 must be a valid file path. For more info about config file and how to get required information, see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm

Instance Type (please complete the following information):

Environment (please complete the following information):

Additional context here's my oci.env config:

OCI Configuration

OCI_CONFIG=/home/ubuntu/oracle-freetier-instance-creation/oci_config OCT_FREE_AD=AD-1,AD-2,AD-3 DISPLAY_NAME=main

The other free shape is AMD: VM.Standard.E2.1.Micro

OCI_COMPUTE_SHAPE=VM.Standard.A1.Flex SECOND_MICRO_INSTANCE=True REQUEST_WAIT_TIME_SECS=600 SSH_AUTHORIZED_KEYS_FILE=/home/ubuntu/oracle-freetier-instance-creation/id_rsa.pub

SUBNET_ID to use ONLY in case running in local or a non E2.1.Micro instance

OCI_SUBNET_ID= OCI_IMAGE_ID=

The following will be ignored if OCI_IMAGE_ID is specified

OPERATING_SYSTEM=Canonical Ubuntu OS_VERSION=22.0

mohankumarpaluru commented 5 months ago

it clear says that the oci API private key is not present. double check if it's placed in the correct location

Sermatty commented 5 months ago

image

Sermatty commented 5 months ago

i followed the tutorial, and it should be present

Sermatty commented 5 months ago

this is the what the ls command shows

LICENSE launch_instance.log oci_api_private_key.pem sample_oci_config README.md main.py oci_config setup_and_info.log email_content.html oci.env requirements.txt setup_init.sh

mohankumarpaluru commented 5 months ago

what is your directory

image

whats the project location? is it /home/ubuntu/oracle-freetier-instance-creation/ or something different?

Sermatty commented 5 months ago

yes it is, can you check if the permission for the key and config are right? image

Sermatty commented 5 months ago

ok, I think i found the error; I removed the comment .TODO in the oci_config file, now it's popolating the log with the message:

2024-06-26 08:52:36,212 - INFO - Command: launch_instance-- Output: {'status': 500, 'code': 'InternalError', 'message': 'Out of host capacity.'}

is it correct?