Skip to content


Subversion checkout URL

You can clone with
Download ZIP


fixed apt-get #404

wants to merge 1 commit into from

2 participants


I have been getting a lot of:

Err raring/main librtmp-dev amd64 2.4+20111222.git4e06e21-1ubuntu1
403 Forbidden
Failed to fetch 403 Forbidden

The past two days. Would you consider something like to following to resolve this issue?

I am uncomfortable about changing the source list behind the scenes but I don't think having to configure source list options is really in line with the it just works behavior that I like about starcluster.

Suggestions are welcome.

David Stuebe fixed apt-get 09b86db

Not only are ec2 archives failing, but now the ubuntu archives are too. I think that is because ubuntu has withdrawn support for 13.04. In my mind the starcluster folks really need to create a new ami based on the latest 14.04. I took a crack at upgrading a 13.04 ami to 14.04, but it's a bit over my head. Until then, I think it's fair to regard the starcluster project as broken. After all, if you follow the current Quick-Start documentation, you will end up with a broken system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 13, 2014
  1. fixed apt-get

    David Stuebe authored
This page is out of date. Refresh to see the latest.
Showing with 26 additions and 2 deletions.
  1. +26 −2 starcluster/
28 starcluster/
@@ -31,6 +31,7 @@
from starcluster import exception
from starcluster.logger import log
+from starcluster.exception import RemoteCommandFailed
class NodeManager(managers.Manager):
@@ -92,6 +93,7 @@ def __init__(self, instance, key_location, alias=None, user='root'):
self._num_procs = None
self._memory = None
self._user_data = None
+ self.apt_get_initialized=False
def __repr__(self):
return '<Node: %s (%s)>' % (self.alias,
@@ -1137,6 +1139,29 @@ def apt_command(self, cmd):
cmd = "DEBIAN_FRONTEND='noninteractive' " + cmd
+ def apt_do(self, cmd):
+ tried_source = False
+ while True:
+ try:
+ if not self.apt_get_initialized:
+ log.warn('Doing apt clean and update')
+ self.apt_command('clean')
+ self.apt_command('update')
+ self.apt_get_initialized = True
+ self.apt_command(cmd)
+ break
+ except RemoteCommandFailed as rcf:
+ if not tried_source:
+ log.warn("apt cmd '%s' failed. Trying a different source..." % cmd)
+ self.ssh.execute("cp /etc/apt/sources.list /etc/apt/sources.list.orig")
+ self.ssh.execute("sed -i 's/us-east-1.ec2/us/g' /etc/apt/sources.list")
+ self.apt_get_initialized = False
+ tried_source = True
+ else:
+ raise rcf
def apt_install(self, pkgs):
Install a set of packages via apt-get.
@@ -1144,8 +1169,7 @@ def apt_install(self, pkgs):
pkgs is a string that contains one or more packages separated by a
- self.apt_command('update')
- self.apt_command('install %s' % pkgs)
+ self.apt_do('install %s' % pkgs)
def yum_command(self, cmd):
Something went wrong with that request. Please try again.