# Buggy code
def __init__(
    self, accountName, namePrefix, config=None, jobChunkSize=maxAzureTablePropertySize
):
    self.jobChunkSize = jobChunkSize
    self.keyPath = None

    self.account_key = _fetchAzureAccountKey(accountName)
    self.accountName = accountName
    # Table names have strict requirements in Azure
    self.namePrefix = self._sanitizeTableName(namePrefix)
    logger.debug("Creating job store with name prefix '%s'" % self.namePrefix)

    # These are the main API entrypoints.
    self.tableService = TableService(
        account_key=self.account_key, account_name=accountName
    )
    self.blobService = BlobService(
        account_key=self.account_key, account_name=accountName
    )

    exists = self._jobStoreExists()
    self._checkJobStoreCreation(
        config is not None, exists, accountName + ":" + self.namePrefix
    )

    # Serialized jobs table
    self.jobItems = self._getOrCreateTable(self.qualify("jobs"))
    # Job<->file mapping table
    self.jobFileIDs = self._getOrCreateTable(self.qualify("jobFileIDs"))

    # Container for all shared and unshared files
    self.files = self._getOrCreateBlobContainer(self.qualify("files"))

    # Stats and logging strings
    self.statsFiles = self._getOrCreateBlobContainer(self.qualify("statsfiles"))
    # File IDs that contain stats and logging strings
    self.statsFileIDs = self._getOrCreateTable(self.qualify("statsFileIDs"))

    super(AzureJobStore, self).__init__(config=config)

    if self.config.cseKey is not None:
        self.keyPath = self.config.cseKey


# Traceback (toil.jobStores.abstractJobStore.NoSuchFileException)
cmarkello@c1master1:~$ toil clean azure:hgvm:hgvmevaljobstore
2016-05-13 23:08:36,438 INFO:toil.lib.bioio: Logging set at level: INFO
2016-05-13 23:08:36,445 INFO:toil.utils.toilClean: Parsed arguments
2016-05-13 23:08:36,445 INFO:toil.utils.toilClean: Checking if we have files for toil
2016-05-13 23:08:36,525 INFO:requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): hgvm.table.core.windows.net
2016-05-13 23:08:36,724 INFO:requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): hgvm.blob.core.windows.net
Traceback (most recent call last):
File "/usr/local/bin/toil", line 9, in <module>
load_entry_point('toil==3.2.0a2', 'console_scripts', 'toil')()
File "/usr/local/lib/python2.7/dist-packages/toil/utils/toilMain.py", line 30, in main
module.main()
File "/usr/local/lib/python2.7/dist-packages/toil/utils/toilClean.py", line 53, in main
jobStore = Toil.loadOrCreateJobStore(options.jobStore)
File "/usr/local/lib/python2.7/dist-packages/toil/common.py", line 589, in loadOrCreateJobStore
return AzureJobStore(account, namePrefix, config=config)
File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/azureJobStore.py", line 120, in __init__
super(AzureJobStore, self).__init__(config=config)
File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/abstractJobStore.py", line 141, in __init__
with self.readSharedFileStream("config.pickle") as fileHandle:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/usr/local/lib/python2.7/dist-packages/toil/jobStores/azureJobStore.py", line 318, in readSharedFileStream
raise NoSuchFileException(sharedFileID)
toil.jobStores.abstractJobStore.NoSuchFileException: File 'a77581f6_ad82_5142_acb7_5a6b01eab3fb' does not exist

# Fixed code
def __init__(self, locator, jobChunkSize=maxAzureTablePropertySize):
    super(AzureJobStore, self).__init__()
    accountName, namePrefix = locator.split(":", 1)
    if "--" in namePrefix:
        raise ValueError(
            "Invalid name prefix '%s'. Name prefixes may not contain %s."
            % (namePrefix, self.nameSeparator)
        )
    if not self.containerNameRe.match(namePrefix):
        raise ValueError(
            "Invalid name prefix '%s'. Name prefixes must contain only digits, "
            "hyphens or lower-case letters and must not start or end in a "
            "hyphen." % namePrefix
        )
    # Reserve 13 for separator and suffix
    if len(namePrefix) > self.maxContainerNameLen - self.maxNameLen - len(
        self.nameSeparator
    ):
        raise ValueError(
            (
                "Invalid name prefix '%s'. Name prefixes may not be longer than 50 "
                "characters." % namePrefix
            )
        )
    if "--" in namePrefix:
        raise ValueError(
            "Invalid name prefix '%s'. Name prefixes may not contain "
            "%s." % (namePrefix, self.nameSeparator)
        )
    self.locator = locator
    self.jobChunkSize = jobChunkSize
    self.accountKey = _fetchAzureAccountKey(accountName)
    self.accountName = accountName
    # Table names have strict requirements in Azure
    self.namePrefix = self._sanitizeTableName(namePrefix)
    # These are the main API entry points.
    self.tableService = TableService(
        account_key=self.accountKey, account_name=accountName
    )
    self.blobService = BlobService(
        account_key=self.accountKey, account_name=accountName
    )
    # Serialized jobs table
    self.jobItems = None
    # Job<->file mapping table
    self.jobFileIDs = None
    # Container for all shared and unshared files
    self.files = None
    # Stats and logging strings
    self.statsFiles = None
    # File IDs that contain stats and logging strings
    self.statsFileIDs = None