[JIRA] (JENKINS-56871) EC2 Plugin fails to terminate spot instances after agent deleted

2 views
Skip to first unread message

gordon.shieh@safe.com (JIRA)

unread,
Apr 3, 2019, 8:35:02 PM4/3/19
to jenkinsc...@googlegroups.com
Gordon Shieh created an issue
 
Jenkins / Bug JENKINS-56871
EC2 Plugin fails to terminate spot instances after agent deleted
Issue Type: Bug Bug
Assignee: FABRIZIO MANFREDI
Components: ec2-plugin
Created: 2019-04-04 00:34
Environment: CJE Managed Master 2.138.1.2-rolling
EC2Plugin 1.42
Priority: Critical Critical
Reporter: Gordon Shieh

We had a case where idle instances that were supposedly deleted still running on EC2.
To reproduce:
Launch EC2 template with spot instance enabled
Immediately delete that instance.
On the Spot request console, the request will be "cancelled"
But the associated EC2 instance is still running, and orphaned.

We had a case where we had so many of these orphaned instances that we reached the instance cap of our account.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ravibagri2@gmail.com (JIRA)

unread,
May 2, 2019, 1:12:03 PM5/2/19
to jenkinsc...@googlegroups.com
Ravi Bagri commented on Bug JENKINS-56871
 
Re: EC2 Plugin fails to terminate spot instances after agent deleted

I recently faced the same issue. later after investing into my cloud-trail logs i found that jenkins role was missing the permission to terminate the instance. 

Below is the log snippet.

"eventName": "TerminateInstances",
"awsRegion": "us-west-2",
"userAgent": "aws-sdk-java/1.11.457 Linux/4.9.0-6-amd64 OpenJDK_64-Bit_Server_VM/25.212-b01 java/1.8.0_212 groovy/2.4.12",
"errorCode": "Client.UnauthorizedOperation",
"errorMessage": "You are not authorized to perform this operation. Encoded authorization failure message:
After adding the appropriate permission it seems to have resolved. 

ravibagri2@gmail.com (JIRA)

unread,
May 2, 2019, 1:14:02 PM5/2/19
to jenkinsc...@googlegroups.com
Ravi Bagri edited a comment on Bug JENKINS-56871
I recently faced the same issue. later after investing into my cloud-trail logs i found that jenkins role was missing had the permission to cancel the spot request but the permission to terminate instance was missing. So that's why the spot request was getting cancelled but the instance was still persisting


Below is the log snippet.

~"eventName": "TerminateInstances",~
~"awsRegion": "us-west-2",~
~"userAgent": "aws-sdk-java/1.11.457 Linux/4.9.0-6-amd64 OpenJDK_64-Bit_Server_VM/25.212-b01 java/1.8.0_212 groovy/2.4.12",~
~"errorCode": "Client.UnauthorizedOperation",~
~"errorMessage": "You are not authorized to perform this operation. Encoded authorization failure message:~

After adding the appropriate permission it seems to have resolved. 

fabrizio.manfredi@gmail.com (JIRA)

unread,
May 2, 2019, 1:40:02 PM5/2/19
to jenkinsc...@googlegroups.com

thanks for the investigation, did you use the iam roles suggested in the wiki page ? 

nigel.armstrong@braincorp.com (JIRA)

unread,
Apr 3, 2020, 1:50:03 AM4/3/20
to jenkinsc...@googlegroups.com
Nigel Armstrong closed an issue as Not A Defect
 

User found issue with iam role

Change By: Nigel Armstrong
Status: Open Closed
Resolution: Not A Defect
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages