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

KeyError: 'PublicIpAddress' #24

Closed
claffin opened this issue May 10, 2021 · 0 comments · Fixed by #27
Closed

KeyError: 'PublicIpAddress' #24

claffin opened this issue May 10, 2021 · 0 comments · Fixed by #27
Labels
bug Something isn't working

Comments

@claffin
Copy link
Owner

claffin commented May 10, 2021

AWS creates the instance but doesn't allocate the IP instantly so when CloudProxy reads the response from AWS it cannot find the IP and causes the key error.

CloudProxy should still continue to work as once AWS allocates the IP, it stops raising the exception. Will fix in near future.

Traceback (most recent call last):

  File "/usr/local/lib/python3.8/threading.py", line 890, in _bootstrap
    self._bootstrap_inner()
    │    └ <function Thread._bootstrap_inner at 0x7fd7f2af6040>
    └ <Thread(ThreadPoolExecutor-0_1, started daemon 140565377611520)>
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
    │    └ <function Thread.run at 0x7fd7f2af5d30>
    └ <Thread(ThreadPoolExecutor-0_1, started daemon 140565377611520)>
  File "/usr/local/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {}
    │    │        │    │        └ <Thread(ThreadPoolExecutor-0_1, started daemon 140565377611520)>
    │    │        │    └ (<weakref at 0x7fd7efa8d400; to 'ThreadPoolExecutor' at 0x7fd7f12318b0>, <_queue.SimpleQueue object at 0x7fd7efb74950>, None,...
    │    │        └ <Thread(ThreadPoolExecutor-0_1, started daemon 140565377611520)>
    │    └ <function _worker at 0x7fd7f11f2d30>
    └ <Thread(ThreadPoolExecutor-0_1, started daemon 140565377611520)>
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 80, in _worker
    work_item.run()
    │         └ <function _WorkItem.run at 0x7fd7f11f2c10>
    └ <concurrent.futures.thread._WorkItem object at 0x7fd7efa93280>
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
             │    │   │    │       │    └ {}
             │    │   │    │       └ <concurrent.futures.thread._WorkItem object at 0x7fd7efa93280>
             │    │   │    └ [<Job (id=251677fd631043ddbb85e5197ee666dc name=aws_manager)>, 'default', [datetime.datetime(2021, 5, 10, 10, 34, 57, 579415,...
             │    │   └ <concurrent.futures.thread._WorkItem object at 0x7fd7efa93280>
             │    └ <function run_job at 0x7fd7f11fdf70>
             └ <concurrent.futures.thread._WorkItem object at 0x7fd7efa93280>
> File "/usr/local/lib/python3.8/site-packages/apscheduler/executors/base.py", line 125, in run_job
    retval = job.func(*job.args, **job.kwargs)
             │   │     │   │       │   └ <member 'kwargs' of 'Job' objects>
             │   │     │   │       └ <Job (id=251677fd631043ddbb85e5197ee666dc name=aws_manager)>
             │   │     │   └ <member 'args' of 'Job' objects>
             │   │     └ <Job (id=251677fd631043ddbb85e5197ee666dc name=aws_manager)>
             │   └ <member 'func' of 'Job' objects>
             └ <Job (id=251677fd631043ddbb85e5197ee666dc name=aws_manager)>

  File "/app/cloudproxy/providers/manager.py", line 15, in aws_manager
    ip_list = aws_start()
              └ <function aws_start at 0x7fd7efc91550>

  File "/app/cloudproxy/providers/aws/main.py", line 92, in aws_start
    aws_check_delete()
    └ <function aws_check_delete at 0x7fd7efc914c0>

  File "/app/cloudproxy/providers/aws/main.py", line 77, in aws_check_delete
    if instance["Instances"][0]["PublicIpAddress"] in delete_queue:
       │                                              └ set()
       └ {'Groups': [], 'Instances': [{'AmiLaunchIndex': 0, 'ImageId': 'ami-096cb92bb3580c759', 'InstanceId': 'i-0b18cc1721ffae51a', '...

KeyError: 'PublicIpAddress'

Originally posted by @sblfc in #21 (comment)

@claffin claffin added the bug Something isn't working label May 10, 2021
xanrag added a commit to xanrag/cloudproxy that referenced this issue Jun 4, 2021
claffin added a commit that referenced this issue Jun 6, 2021
Bugfix issue #24, bugfix AWS delete only checking first instance.
@claffin claffin closed this as completed Jun 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant