ec2-init: user-data scripts don't work

Bug #376740 reported by Eric Hammond
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EC2 init scripts
Fix Released
Undecided
Unassigned
Ubuntu on EC2
Invalid
Undecided
Scott Moser
Hardy
Invalid
Undecided
Unassigned
VMBuilder
Fix Released
Medium
Unassigned
ec2-init (Ubuntu)
Fix Released
High
Scott Moser
Hardy
Invalid
Medium
Unassigned
Jaunty
Invalid
Medium
Unassigned
Karmic
Fix Released
High
Scott Moser

Bug Description

Original problem reported by ablert on irc.freenode.net ##aws

This is a problem on at least the following AMI and possibly others:

  ami-5d59be34
  canonical-cloud-us/ubuntu-hardy-20090422-i386.manifest.xml

Steps to reproduce:

  # Create a simple user-data script

  cat >>tmp.sh <<EOM
#!/bin/bash
apt-get update
EOM

  # Start the instance

  ec2-run-instances --user-data-file tmp.sh --key ec2 ami-5d59be34

  [ssh to ubuntu@ the new instance]

  # Check the user-data script output

  grep user-data /var/log/syslog

The output includes a line like this:

  May 14 23:24:18 ubuntu user-data: W: GPG error: http://ppa.launchpad.net hardy Release: The following
  signatures couldn't be verified because the public key is not available: NO_PUBKEY E048451D9EE6D873

Revision history for this message
Eric Hammond (esh) wrote :

This might be fixed by #373055

Revision history for this message
Peter Magnusson (kmpm) wrote :

Is there a way to ignore the error and make aptitude finish anyway until this bug gets fixed.
Looking on the last line from the messages log that I attached it looks like aptitude is waiting for some confirmation even though I use "export DEBIAN_FRONTEND=noninteractive" and
"aptitude -y -q update && aptitude -y -q safe-upgrade "

Revision history for this message
Soren Hansen (soren) wrote :

The PPA code in VMBuilder predates signed repositories, and hasn't really been updated to reflect the new reality. This needs fixing.

I imagine a --archive-key option to VMBuilder that lets you specify archive keys to be fetched and added during build.

Changed in vmbuilder:
importance: Undecided → Medium
status: New → Confirmed
Changed in ubuntu-on-ec2:
status: New → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

Since the user-data script is the last one to be executed now this is fixed now.

Regards
chuck

Changed in ubuntu-on-ec2:
status: Confirmed → Fix Committed
Revision history for this message
Chuck Short (zulcss) wrote :

This is fixed for vmbuilder as well.

Regards
chuck

Changed in vmbuilder:
status: Confirmed → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

I'm re-opening this.
  I just tested on karmic alpha-4 (ami-59b25230) , and the user-data-script functionality is now completely broken. To verify, either:
a.start an ec2 instance as defined above
b. simply run '/usr/bin/ec2-run-user-data'

The result of either is ('a' will show in /var/log/messages, 'b' to the console):

Traceback (most recent call last):
  File "/usr/bin/ec2-run-user-data", line 28, in <module>
    content_type_handlers = { 'text/x-shellscript' : handle_shell_script,
NameError: name 'handle_shell_script' is not defined

Changed in ubuntu-on-ec2:
status: Fix Committed → Confirmed
Scott Moser (smoser)
Changed in ubuntu-on-ec2:
importance: Undecided → Critical
Revision history for this message
Scott Moser (smoser) wrote :

I've verified that the simple change at http://bazaar.launchpad.net/~smoser/ec2-init/ec2-init.smoser/revision/60 , fixes the problem.

I booted ami-59b25230 , changed /usr/bin/ec2-run-user-data , 'rm /var/lib/ec2/*', rebooted, and verified that my user data script ran (and also that ssh keys changed, as you would expect because the rm caused all ec2-init to re-run).

Eric Hammond (esh)
Changed in ec2-init:
status: New → Confirmed
Soren Hansen (soren)
Changed in ec2-init:
status: Confirmed → Fix Released
status: Fix Released → Fix Committed
Eric Hammond (esh)
summary: - user-data script: "public key is not available" for PPA
+ ec2-init: user-data scripts don't work
Revision history for this message
Soren Hansen (soren) wrote :

Sorry about the noise. With Launchpad's new UI, it's almost too easy to change the status of a bug task :)

Marking as Fix released in ec2-init. The fix was included in the 0.4.999 release of ec2-init. Now we need to backport as necessary and build new images.

Changed in ec2-init:
status: Fix Committed → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote :

Daily Karmic images are fixed. We need to backport the fix(es) to the affected releases.

Changed in ubuntu-on-ec2:
assignee: nobody → Scott Moser (smoser)
status: Confirmed → Triaged
Matt Zimmerman (mdz)
Changed in ec2-init (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in ubuntu-on-ec2:
importance: Critical → High
Changed in ec2-init (Ubuntu Jaunty):
status: New → Triaged
importance: Undecided → High
status: Triaged → Invalid
Changed in ec2-init (Ubuntu Karmic):
assignee: nobody → Scott Moser (smoser)
Changed in ec2-init (Ubuntu Jaunty):
status: Invalid → Triaged
importance: High → Medium
assignee: nobody → Scott Moser (smoser)
Changed in ec2-init (Ubuntu Hardy):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

I'm marking the tasks invalid for Hardy and Jaunty. The user data scripts run fine on those images, when they run. The issue for those is really bug 308530, which we do intend to fix.

Changed in ec2-init (Ubuntu Hardy):
status: Triaged → Invalid
Changed in ec2-init (Ubuntu Jaunty):
status: Triaged → Invalid
Scott Moser (smoser)
tags: added: ec2-images uec-images
Revision history for this message
Scott Moser (smoser) wrote :

I'm marking the ubuntu-on-ec2 task as 'invalid'. The distribution/package tasks should cover this.

Changed in ubuntu-on-ec2:
status: Triaged → Invalid
Revision history for this message
Scott Moser (smoser) wrote :

This is fixed in latest ec2-init packages. I have verfied functional user-data scripts in alpha5 release.

Changed in ec2-init (Ubuntu Jaunty):
assignee: Scott Moser (smoser) → nobody
Changed in ec2-init (Ubuntu Karmic):
status: Triaged → Fix Released
Changed in vmbuilder:
status: Fix Committed → Fix Released
Scott Moser (smoser)
Changed in ubuntu-on-ec2:
importance: High → Undecided
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.