Bobcares

How to fix automation failed to start error?

by | Sep 1, 2020

Systems Manager Automation simplifies common maintenance and deployment tasks of EC2 instances and other AWS resources. At times automation failed to start error triggers with a message access denied or invalid assume role.

As a part of our AWS Support Services, we help our Customers to fix AWS related errors regularly.

Let us today discuss the possible causes and fixes for this error.

Automation failed to start error

Systems Manager Automation helps to simplify the common tasks of EC2 instances and other AWS resources.

Automation enables you to build automation workflows, create custom workflows, receive notifications about automation tasks, and monitor automation progress.

However, automation execution can fail with an access denied error or an invalid assume role error. This can happen due to improper configuration of IAM users, roles, and policies for automation.

Access Denied to Systems Manager API

A very common message with the Automation failed to start error is the access denied. It can occur when the IAM user attempting to start the Automation execution does not have permission to invoke the StartAutomationExecution API or if it does not have permission to invoke the API by using the specific Automation document. A typical error message resembles:

Error message: User: user xxx is not authorized to perform: ssm:StartAutomationExecution on resource: document arn (Service: AWSSimpleSystemsManagement; Status Code: 400; Error Code: AccessDeniedException; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

To resolve this issue, we need to attach the required IAM policy to the corresponding user account.

Use the following procedure to configure a user account to use Automation. The user account we choose will have permission to configure and run Automation.

  1. In the IAM navigation pane, choose Users, and then choose the user account we want to configure.
  2. On the Permissions tab, in the policies list, verify that either the AmazonSSMFullAccess policy is listed or there is a comparable policy that gives the account permissions to access Systems Manager.
  3. Choose to Add inline policy.
  4. On the Create policy page, choose Visual Editor, and then choose Choose a service.
  5. From AWS Services, choose AWS Identity and Access Management.
  6. For Actions, enter PassRole in the Filter actions prompt, and choose PassRole.
  7. In the Resources section, choose Add ARN, paste the ARN for the Automation service role, and then choose Add.
  8. Choose Review policy.
  9. On the Review Policy page, provide a Name for the policy and then choose to Create policy.

 

Access Denied Because of Missing PassRole Permissions

Another common cause for an access denied message is when the IAM user does not have PassRole permission. The error message looks like:

Error message: User: user xxx is not authorized to perform: iam:PassRole on resource: automation assume role arn (Service: AWSSimpleSystemsManagement; Status Code: 400; Error Code: AccessDeniedException; Request ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

To resolve this issue, attach the iam:PassRole policy to the role of the IAM user attempting to start the Automation execution.

This enables the Automation service to pass the role to other services or Systems Manager capabilities when running Automation workflows.

To attach the iam:PassRole policy to your Automation role:

  1. In the Summary page for the role you just created, choose the Permissions tab.
  2. Choose to Add inline policy.
  3. On the Create policy page, choose the Visual editor tab.
  4. Choose Service, and then choose IAM.
  5. Choose Select actions.
  6. In the Filter actions text box, type PassRole, and then choose the PassRole option.
  7. Choose Resources. Verify that Specific is selected, and then choose Add ARN.
  8. In the Specify ARN for role field, paste the Automation role ARN.
  9. Choose Add.
  10. Choose Review policy.
  11. On the Review Policy page, type a name and then choose Create Policy.

 

Invalid assume role

While we run Automation, it either provides an assume role in the document or passes a parameter value for the document. If the assume role is not specified or configured properly, it leads to errors.

For instance, a malformed assume role can trigger an error “The assume role is improperly formatted”.

To resolve this issue, verify that a valid assume the role is specified in the Automation document or as a runtime parameter when running the Automation.

Likewise, when the assume role does not exist, it triggers the error “The defined assume role is unable to be assumed.

To resolve this issue, we need to create a role for automation. Use the following procedure to create a service role (or assume role) for Systems Manager Automation.

  1. Open the IAM console at https://console.aws.amazon.com/iam/.
  2. In the navigation pane, choose Roles, and then choose Create role.
  3. For the select type of trusted entity, choose AWS service.
  4. In the Choose a use case section, choose Systems Manager, and then choose Next: Permissions.
  5. On the Attached permissions policy page, search for the AmazonSSMAutomationRole policy, choose it, and then choose Next: Review.
  6. Then, on the Review page, type a name in the Role name box, and then type a description.
  7. Choose to Create role. The system returns you to the Roles page.
  8. Now on the Roles page, choose the role you just created to open the Summary page. Note the Role Name and Role ARN.

 

[Need any further assistance in fixing Automation errors? – We’re available 24*7]

Conclusion

In short, Systems Manager Automation simplifies common maintenance and deployment tasks of EC2 instances and other AWS resources. At times automation fails to start with an access denied error or an invalid assume role error. Today, we saw how our Support Engineers fix this error.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF