This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

St2 aws run failing security token included in the request is invalid site-packages/st2common/runners/utils.py

st2 run aws.ec2_get_all_tags

id: 60ae1858807900e911ac5045
action.ref: aws.ec2_get_all_tags
context.user: st2admin
parameters: None
status: failed
start_timestamp: Wed, 26 May 2021 09:43:52 UTC
end_timestamp: Wed, 26 May 2021 09:43:55 UTC
result:
exit_code: 1
result: None
stderr: "Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/runners/utils.py”, line 134, in get_action_class_instance
action_instance = action_cls(**kwargs)
TypeError: init() got an unexpected keyword argument ‘action_service’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py”, line 334, in
obj.run()
File “/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py”, line 192, in run
action = self._get_action_instance()
File “/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py”, line 261, in _get_action_instance
action_service=action_service)
File “/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/runners/utils.py”, line 143, in get_action_class_instance
action_instance = action_cls(**kwargs)
File “/opt/stackstorm/packs/aws/actions/lib/action.py”, line 67, in init
self.account_id = self.session.client(‘sts’).get_caller_identity().get(‘Account’)
File “/opt/stackstorm/virtualenvs/aws/lib/python3.6/site-packages/botocore/client.py”, line 251, in _api_call
return self._make_api_call(operation_name, kwargs)
File “/opt/stackstorm/virtualenvs/aws/lib/python3.6/site-packages/botocore/client.py”, line 537, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.

Check your AWS pack configuration and ensure that the client token that you are using is valid.

Can you run other actions in the AWS pack?

st2 execution get 60ae05f2807900e911ac502d
id: 60ae05f2807900e911ac502d
action.ref: aws.ec2_get_all_instances
context.user: st2admin
parameters: None
status: failed (2s elapsed)
start_timestamp: Wed, 26 May 2021 08:25:22 UTC
end_timestamp: Wed, 26 May 2021 08:25:24 UTC
result:
exit_code: 1
result: None
stderr: "Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/runners/utils.py”, line 134, in get_action_class_instance
action_instance = action_cls(**kwargs)
TypeError: init() got an unexpected keyword argument ‘action_service’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py”, line 334, in
obj.run()
File “/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py”, line 192, in run
action = self._get_action_instance()
File “/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py”, line 261, in _get_action_instance
action_service=action_service)
File “/opt/stackstorm/st2/lib/python3.6/site-packages/st2common/runners/utils.py”, line 143, in get_action_class_instance
action_instance = action_cls(**kwargs)
File “/opt/stackstorm/packs/aws/actions/lib/action.py”, line 67, in init
self.account_id = self.session.client(‘sts’).get_caller_identity().get(‘Account’)
File “/opt/stackstorm/virtualenvs/aws/lib/python3.6/site-packages/botocore/client.py”, line 251, in _api_call
return self._make_api_call(operation_name, kwargs)
File “/opt/stackstorm/virtualenvs/aws/lib/python3.6/site-packages/botocore/client.py”, line 537, in _make_api_call
raise ClientError(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidClientTokenId) when calling the GetCallerIdentity operation: The security token included in the request is invalid.

Have checked aws.yaml


aws_access_key_id: ***hgg
aws_secret_access_key: ********
aws_security_token: ‘’
region: us-east-1
debug: true

service_notifications_sensor:
host: localhost
port: 12345
path: /my-path

actions:
roles:
- arn:aws:iam::*****:role/stackstorm_ADMIN_ACCESS

from where it picks yaml file
location of the file /opt/stackstorm/aws.yaml or /opt/stackstorm/pack/aws/aws.yaml