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] Opening ports should not fail if port is already open #4576

Open
romilbhardwaj opened this issue Jan 16, 2025 · 0 comments
Open

[AWS] Opening ports should not fail if port is already open #4576

romilbhardwaj opened this issue Jan 16, 2025 · 0 comments

Comments

@romilbhardwaj
Copy link
Collaborator

Approximate repro:

  1. sky launch -c myclus --cloud --ports 8888
  2. Use AWS console to terminate myclus VM and delete ~/.sky/state.db
  3. Run sky launch -c myclus --cloud --ports 8888 again. Raises already exists error. If the port is already open, it should silently proceed.
Traceback (most recent call last):
  File "/path/to/project/utils/launch_api_server.py", line 28, in <module>
    sky.launch(
  File "/path/to/venv/lib/python3.11/site-packages/sky/utils/common_utils.py", line 386, in _record
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/utils/common_utils.py", line 386, in _record
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/utils/execution.py", line 455, in launch
    return _execute(
           ^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/utils/execution.py", line 281, in _execute
    handle = backend.provision(task, stream_logs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/utils/common_utils.py", line 386, in _record
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/backends/backend.py", line 60, in provision
    return self._provision(task, to_provision, stream_logs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/backends/cloud_vm_ray_backend.py", line 2865, in _provision
    self._update_after_cluster_provisioned(
  File "/path/to/venv/lib/python3.11/site-packages/sky/backends/cloud_vm_ray_backend.py", line 3011, in _update_after_cluster_provisioned
    self._open_ports(handle)
  File "/path/to/venv/lib/python3.11/site-packages/sky/backends/cloud_vm_ray_backend.py", line 2949, in _open_ports
    return _open_ports(handle)
           ^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/provision/__init__.py", line 50, in wrapper
    return impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/sky/provision/aws/instance.py", line 824, in open_ports
    authorize_ingress(IPPermissions=ip_permissions)
  File "/path/to/venv/lib/python3.11/site-packages/boto3/resources/action.py", line 581, in do_action
    response = action(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/boto3/resources/factory.py", line 88, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/botocore/client.py", line 569, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/path/to/venv/lib/python3.11/site-packages/botocore/client.py", line 1023, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidPermission.Duplicate) when calling the AuthorizeSecurityGroupIngress operation: the specified rule "peer: 0.0.0.0/0, TCP, port 45008, ALLOW" already exists
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

1 participant