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 removing IPs from SGs #328

Closed
ShishirPatil opened this issue May 4, 2022 · 2 comments
Closed

AWS removing IPs from SGs #328

ShishirPatil opened this issue May 4, 2022 · 2 comments
Assignees

Comments

@ShishirPatil
Copy link
Member

Related to #239

Command to replicate: pip install -e ".[all]" && skylark deprovision && ./scripts/pack_docker.sh && skylark cp s3://exps-skylark-us-east-1 s3://exps-skylark-us-west-1

15:03:06 [ERROR] Error running <lambda> with args functools.partial(<bound method AWSCloudProvider.remove_ip_from_security_group of <skylark.compute.aws.aws
_cloud_provider.AWSCloudProvider object at 0x7f921ce03220>>, 'us-east-1', '13.56.150.125'): An error occurred (InvalidPermission.NotFound) when calling the 
RevokeSecurityGroupIngress operation: The specified rule does not exist in this security group.
15:03:06 [ERROR] Error running <lambda> with args functools.partial(<bound method AWSCloudProvider.remove_ip_from_security_group of <skylark.compute.aws.aws
_cloud_provider.AWSCloudProvider object at 0x7f921ce03220>>, 'us-west-1', '13.56.150.125'): An error occurred (InvalidPermission.NotFound) when calling the 
RevokeSecurityGroupIngress operation: The specified rule does not exist in this security group.
15:03:07 [ERROR] Error running <lambda> with args functools.partial(<bound method AWSCloudProvider.remove_ip_from_security_group of <skylark.compute.aws.aws
_cloud_provider.AWSCloudProvider object at 0x7f921ce03220>>, 'us-east-1', '52.5.93.215'): An error occurred (InvalidPermission.NotFound) when calling the Re
vokeSecurityGroupIngress operation: The specified rule does not exist in this security group.
15:03:08 [ERROR] Error running <lambda> with args functools.partial(<bound method AWSCloudProvider.remove_ip_from_security_group of <skylark.compute.aws.aws
_cloud_provider.AWSCloudProvider object at 0x7f921ce03220>>, 'us-west-1', '52.5.93.215'): An error occurred (InvalidPermission.NotFound) when calling the Re
vokeSecurityGroupIngress operation: The specified rule does not exist in this security group.
Traceback (most recent call last):
  File "/home/ubuntu/miniconda/bin/skylark", line 33, in <module>
    sys.exit(load_entry_point('skylark', 'console_scripts', 'skylark')())
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/ubuntu/skylark/skylark/cli/cli.py", line 183, in cp
    replicate_helper(
  File "/home/ubuntu/skylark/skylark/cli/cli_helper.py", line 322, in replicate_helper
    rc.deprovision_gateways()
  File "/home/ubuntu/skylark/skylark/replicate/replicator_client.py", line 235, in deprovision_gateways
    do_parallel(lambda fn: fn(), aws_jobs)
  File "/home/ubuntu/skylark/skylark/utils/utils.py", line 94, in do_parallel
    args, result = future.result()
  File "/home/ubuntu/miniconda/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/home/ubuntu/miniconda/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/ubuntu/miniconda/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ubuntu/skylark/skylark/utils/utils.py", line 82, in wrapped_fn
    raise e
  File "/home/ubuntu/skylark/skylark/utils/utils.py", line 79, in wrapped_fn
    return args, func(args)
  File "/home/ubuntu/skylark/skylark/replicate/replicator_client.py", line 235, in <lambda>
    do_parallel(lambda fn: fn(), aws_jobs)
  File "/home/ubuntu/skylark/skylark/compute/aws/aws_cloud_provider.py", line 272, in remove_ip_from_security_group
    raise e
  File "/home/ubuntu/skylark/skylark/compute/aws/aws_cloud_provider.py", line 266, in remove_ip_from_security_group
    sg.revoke_ingress(
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/boto3/resources/factory.py", line 520, in do_action
    response = action(self, *args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/botocore/client.py", line 391, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/botocore/client.py", line 719, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidPermission.NotFound) when calling the RevokeSecurityGroupIngress operation: The specified rule do
es not exist in this security group.
@ShishirPatil
Copy link
Member Author

Related to above, even while de-provisioning:

Deprovisioning 2 instances
✔ Deprovisioning (2/2) in 0.70s
⠏ Deleting VPCs (0/2)15:06:18 [ERROR] Error running <lambda> with args ('us-west-1', 'vpc-0a6c38d044fb77fd5'): An error occurred (DependencyViolation) when 
calling the DeleteSecurityGroup operation: resource sg-0a86088c652270581 has a dependent object
⠋ Deleting VPCs (0/2)15:06:19 [ERROR] Error running <lambda> with args ('us-east-1', 'vpc-078dc146f7bfc7e86'): An error occurred (DependencyViolation) when 
calling the DeleteSecurityGroup operation: resource sg-0990fd93e7a114fa8 has a dependent object
Traceback (most recent call last):
  File "/home/ubuntu/miniconda/bin/skylark", line 33, in <module>
    sys.exit(load_entry_point('skylark', 'console_scripts', 'skylark')())
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/typer/main.py", line 214, in __call__
    return get_command(self)(*args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/typer/main.py", line 500, in wrapper
    return callback(**use_params)  # type: ignore
  File "/home/ubuntu/skylark/skylark/cli/cli.py", line 199, in deprovision
    deprovision_skylark_instances()
  File "/home/ubuntu/skylark/skylark/cli/cli_helper.py", line 400, in deprovision_skylark_instances
    do_parallel(lambda args: aws.delete_vpc(*args), args, desc="Deleting VPCs", spinner=True, spinner_persist=True)
  File "/home/ubuntu/skylark/skylark/utils/utils.py", line 94, in do_parallel
    args, result = future.result()
  File "/home/ubuntu/miniconda/lib/python3.8/concurrent/futures/_base.py", line 437, in result
    return self.__get_result()
  File "/home/ubuntu/miniconda/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/home/ubuntu/miniconda/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ubuntu/skylark/skylark/utils/utils.py", line 82, in wrapped_fn
    raise e
  File "/home/ubuntu/skylark/skylark/utils/utils.py", line 79, in wrapped_fn
    return args, func(args)
  File "/home/ubuntu/skylark/skylark/cli/cli_helper.py", line 400, in <lambda>
    do_parallel(lambda args: aws.delete_vpc(*args), args, desc="Deleting VPCs", spinner=True, spinner_persist=True)
  File "/home/ubuntu/skylark/skylark/compute/aws/aws_cloud_provider.py", line 188, in delete_vpc
    sg.delete()
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/boto3/resources/factory.py", line 520, in do_action
    response = action(self, *args, **kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/boto3/resources/action.py", line 83, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/botocore/client.py", line 391, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/ubuntu/miniconda/lib/python3.8/site-packages/botocore/client.py", line 719, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (DependencyViolation) when calling the DeleteSecurityGroup operation: resource sg-0a86088c652270581 has a
 dependent object

@parasj
Copy link
Contributor

parasj commented May 10, 2022

Fixed by #334

@parasj parasj closed this as completed May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants