'Spot Instance Error while creating a normal instance with Boto lib

I'm facing this Spot instance issue while creating an instance with the boto AWS library even if I'm not asking for a Spot instance. The issue is similar to this one : You cannot specify tags for Spot instances requests if there are no Spot instances requests being created by the request

[2022-04-19 15:39:19,236: ERROR/ForkPoolWorker-3] Task apps.broadcast.tasks.create_instance[43ea4c10-1010-47c3-9d0a-e4828fd1945c] raised unexpected: ClientError('An error occurred (InvalidParameterValue) when calling the RunInstances operation: You cannot specify tags for Spot instances requests if there are no Spot instances requests being created by the request.')

I'm using the last version of boto and here is my traceback :

    Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/celery/app/trace.py", line 650, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/src/app/apps/broadcast/tasks.py", line 139, in create_instance
    dry_run=dry_run
  File "/usr/src/app/lib/wowza/instance.py", line 110, in create_instance
    **config_override,
  File "/usr/src/app/lib/awsutils/ec2/deployment.py", line 51, in create_instance
    instance_list = __ressource(region).create_instances(**args)
  File "/usr/local/lib/python3.7/site-packages/boto3/resources/factory.py", line 580, in do_action
    response = action(self, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/boto3/resources/action.py", line 88, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 415, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python3.7/site-packages/botocore/client.py", line 745, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the RunInstances operation: You cannot specify tags for Spot instances requests if there are no Spot instances requests being created by the request.

I'm simply creating an instance from a LaunchTemplate and never setting a spot instance.

Could this be related to something else?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source