Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS image ID: IndexError: list index out of range #3213

Closed
concretevitamin opened this issue Feb 22, 2024 · 0 comments · Fixed by #3216
Closed

AWS image ID: IndexError: list index out of range #3213

concretevitamin opened this issue Feb 22, 2024 · 0 comments · Fixed by #3216
Labels
bug Something isn't working P0
Milestone

Comments

@concretevitamin
Copy link
Member

concretevitamin commented Feb 22, 2024

commit 9d05415

Repro (from a user, so this is likely a private image)

resources:
 any_of:
    - cloud: aws
      region: us-west-2
      image_id:
        us-west-2: ami-0514bcd0cfc2aa8e2
      cpus: 2+
      memory: 4+
      disk_size: 50
      use_spot: true

sky launch test.yaml shows

...
  File "/Users/zongheng/Dropbox/workspace/riselab/sky-computing/sky/resources.py", line 1223, in _from_yaml_config_single
    return Resources(**resources_fields)
  File "/Users/zongheng/Dropbox/workspace/riselab/sky-computing/sky/resources.py", line 206, in __init__
    self._try_validate_image_id()
  File "/Users/zongheng/Dropbox/workspace/riselab/sky-computing/sky/resources.py", line 819, in _try_validate_image_id
    image_size = self.cloud.get_image_size(image_id, region)
  File "/Users/zongheng/Dropbox/workspace/riselab/sky-computing/sky/clouds/aws.py", line 262, in get_image_size
    image_info = image_info['Images'][0]
IndexError: list index out of range

Changing AMI id to -1234 shows this error correctly:

ValueError: Image 'ami-1234' not found in AWS region us-west-2.

To find AWS AMI IDs: https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-images.html#examples
Example: ami-0729d913a335efca7
@concretevitamin concretevitamin added bug Something isn't working P0 labels Feb 22, 2024
@concretevitamin concretevitamin added this to the v0.5 milestone Feb 22, 2024
@concretevitamin concretevitamin mentioned this issue Feb 22, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant