[JIRA] [ec2-plugin] (JENKINS-33443) Init script fails to create ~/.hudson-run-init on completion and runs multiple times

2 views
Skip to first unread message

mihelich@google.com (JIRA)

unread,
Mar 9, 2016, 8:02:10 PM3/9/16
to jenkinsc...@googlegroups.com
Patrick Mihelich created an issue
 
Jenkins / Bug JENKINS-33443
Init script fails to create ~/.hudson-run-init on completion and runs multiple times
Issue Type: Bug Bug
Assignee: Francis Upton
Components: ec2-plugin
Created: 10/Mar/16 1:01 AM
Environment: Jenkins 1.625.3
Amazon EC2 plugin 1.31
Master and slaves running Ubuntu 14.04
Priority: Minor Minor
Reporter: Patrick Mihelich

I noticed my Unix slaves on EC2 do not have a ~/.hudson-run-init file, despite running the init script (and following setup steps) successfully. As a result, when they're brought back up from a stopped state, they run the init script again, wasting ~20 minutes.

Some relevant AMI configuration:

  • Remote FS root: /home/ubuntu
  • Remote user: ubuntu
  • AMI Type: unix
  • Root command prefix: sudo
  • Init script is essentially: sudo $HOME/init_script.sh

On a successfully connected slave, I expect to see /home/ubuntu/.hudson-run-init, but there's no such file. I took a quick look at EC2UnixLauncher.java, and everything looks reasonable. My only question is why touch ~/.hudson-run-init would need to be run as root. But both touch ~/.hudson-run-init and sudo touch ~/.hudson-run-init produce the expected file when run manually as the ubuntu user. So I'm a bit stumped.

I'm testing out touching the file myself in the init script as a workaround.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

perrin@opencloud.com (JIRA)

unread,
Jun 24, 2016, 8:56:03 AM6/24/16
to jenkinsc...@googlegroups.com
Perrin Morrow commented on Bug JENKINS-33443
 
Re: Init script fails to create ~/.hudson-run-init on completion and runs multiple times

We've been seeing this behaviour too, but not consistently. Some of the time the file is created, and I can't see any obvious pattern.

I am currently running a patched version of the plugin in our staging environment, with extra logging around the creation of the file to see why it might be failing. But so far it has created the file every time.

It's possible my call to

waitCompletion(sess);

which I added to get the exit status may have caused it to work more reliably.

I'll do some more testing next week.

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

perrin@opencloud.com (JIRA)

unread,
Jun 19, 2018, 12:14:02 AM6/19/18
to jenkinsc...@googlegroups.com

Well "more testing next week" turned into two years, sorry about that.

I've pushed the code we've been running with for those two years in this pull request.

 

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

raihaan.shouhell@autodesk.com (JIRA)

unread,
Jul 29, 2019, 5:15:03 AM7/29/19
to jenkinsc...@googlegroups.com
Raihaan Shouhell resolved as Fixed
 

PR has been merged if this is still an issue please reopen this with a new version of the plugin

Change By: Raihaan Shouhell
Status: Open Resolved
Resolution: Fixed
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages