dask / dask-ec2

Start a cluster in EC2 for dask.distributed
106 stars 37 forks source link

CreateTags breaks when no tags passed #90

Closed limx0 closed 6 years ago

limx0 commented 7 years ago

When trying to call dask-ec2 up with no tags, the following error occurs.

Unexpected EC2 error: An error occurred (InvalidParameterValue) when calling the CreateTags operation: You must specify one or more tags to create

Full py.test traceback

..\ec2.py:281: in launch
    v.create_tags(DryRun=False, Tags=custom_tags)
C:\Users\Brad\Anaconda2\envs\dev\lib\site-packages\boto3\resources\factory.py:520: in do_action
    response = action(self, *args, **kwargs)
C:\Users\Brad\Anaconda2\envs\dev\lib\site-packages\boto3\resources\action.py:83: in __call__
    response = getattr(parent.meta.client, operation_name)(**params)
C:\Users\Brad\AppData\Roaming\Python\Python35\site-packages\botocore\client.py:253: in _api_call
    return self._make_api_call(operation_name, kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <botocore.client.EC2 object at 0x00000292AD61F5F8>
operation_name = 'CreateTags'
api_params = {'DryRun': False, 'Resources': ['vol-075fa03fa2a55b142'], 'Tags': []}

    def _make_api_call(self, operation_name, api_params):
        operation_model = self._service_model.operation_model(operation_name)
        request_context = {
            'client_region': self.meta.region_name,
            'client_config': self.meta.config,
            'has_streaming_input': operation_model.has_streaming_input,
            'auth_type': operation_model.auth_type,
        }
        request_dict = self._convert_to_request_dict(
            api_params, operation_model, context=request_context)

        handler, event_response = self.meta.events.emit_until_response(
            'before-call.{endpoint_prefix}.{operation_name}'.format(
                endpoint_prefix=self._service_model.endpoint_prefix,
                operation_name=operation_name),
            model=operation_model, params=request_dict,
            request_signer=self._request_signer, context=request_context)

        if event_response is not None:
            http, parsed_response = event_response
        else:
            http, parsed_response = self._endpoint.make_request(
                operation_model, request_dict)

        self.meta.events.emit(
            'after-call.{endpoint_prefix}.{operation_name}'.format(
                endpoint_prefix=self._service_model.endpoint_prefix,
                operation_name=operation_name),
            http_response=http, parsed=parsed_response,
            model=operation_model, context=request_context
        )

        if http.status_code >= 300:
            error_code = parsed_response.get("Error", {}).get("Code")
            error_class = self.exceptions.from_code(error_code)
>           raise error_class(parsed_response, operation_name)
E           botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CreateTags operation: You must specify one or more tags to create
spnichol commented 7 years ago

I also had this issue. You can pass in dummy tag parameters when you create the instances. Like this:

dask-ec2 up --keyname yourkeyname --keypair ~/.ssh/yourkey.pem --tags dummy:tag

ljofreflor commented 7 years ago

what is the porpose of this parameter?