# Buggy code
def start(self, rootJob):
    """
    Invoke a Toil workflow with the given job as the root for an initial run. This method
    must be called in the body of a ``with Toil(...) as toil:`` statement. This method should
    not be called more than once for a workflow that has not finished.

    :param toil.job.Job rootJob: The root job of the workflow
    :return: The root job's return value
    """
    self._assertContextManagerUsed()
    if self.config.restart:
        raise ToilRestartException(
            "A Toil workflow can only be started once. Use Toil.restart() to resume it."
        )

    self._batchSystem = self.createBatchSystem(
        self.config, jobStore=self._jobStore, userScript=rootJob.getUserScript()
    )
    try:
        self._setBatchSystemEnvVars()
        self._serialiseEnv()
        self._cacheAllJobs()

        # Make a file to store the root job's return value in
        rootJobReturnValueID = self._jobStore.getEmptyFileStoreID()

        # Add the root job return value as a promise
        rootJob._rvs[()].append(rootJobReturnValueID)

        # Write the name of the promise file in a shared file
        with self._jobStore.writeSharedFileStream("rootJobReturnValue") as fH:
            fH.write(rootJobReturnValueID)

        # Setup the first wrapper and cache it
        job = rootJob._serialiseFirstJob(self._jobStore)
        self._cacheJob(job)

        self._setProvisioner()
        return self._runMainLoop(job)
    finally:
        self._shutdownBatchSystem()


# Traceback (ImportError)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ---TOIL WORKER OUTPUT LOG---
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Next available file descriptor: 10
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.worker:Next available file descriptor: 10
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:Setting read timeout to 65
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:"GET /acmarkellotoilvgjobstore11xxjobitems(PartitionKey='default',RowKey='fc48619f_e141_4211_8ab9_3004f95b16df')?$select= HTTP/1.1" 200 None
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Parsed jobWrapper
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.worker:Parsed jobWrapper
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Got a command to run: _toil b5feca2d_3cbf_46a6_81cc_43d5f3a43cb6 /home/cmarkello/toilvenv/local/lib/python2.7/site-packages toil_vg.vg_evaluation_pipeline
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.worker:Got a command to run: _toil b5feca2d_3cbf_46a6_81cc_43d5f3a43cb6 /home/cmarkello/toilvenv/local/lib/python2.7/site-packages toil_vg.vg_evaluation_pipeline
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:toil.job:Loading user module ModuleDescriptor(dirPath='/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', name='toil_vg.vg_evaluation_pipeline').
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   WARNING:toil.resource:Can't find resource for leader path '/home/cmarkello/toilvenv/local/lib/python2.7/site-packages/toil_vg'
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   WARNING:toil.resource:Can't localize module ModuleDescriptor(dirPath='/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', name='toil_vg.vg_evaluation_pipeline')
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ERROR:toil.job:Failed to import user module ModuleDescriptor(dirPath='/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', name='toil_vg.vg_evaluation_pipeline') from sys.path=['/home/cmarkello/toilvenv/bin', '/home/cmarkello/toilvenv/lib/python2.7', '/home/cmarkello/toilvenv/lib/python2.7/plat-x86_64-linux-gnu', '/home/cmarkello/toilvenv/lib/python2.7/lib-tk', '/home/cmarkello/toilvenv/lib/python2.7/lib-old', '/home/cmarkello/toilvenv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/home/cmarkello/toilvenv/local/lib/python2.7/site-packages', '/home/cmarkello/toil/src', '/home/cmarkello/toilvenv/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages/mesos.interface-0.22.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/mesos-0.22.0-py2.7-linux-x86_64.egg', '/home/cmarkello/toil-scripts/src', '/usr/local/lib/python2.7/site-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/dist-packages']
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Traceback (most recent call last):
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/home/cmarkello/toil/src/toil/worker.py", line 316, in main
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       job = Job._loadJob(jobWrapper.command, jobStore)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/home/cmarkello/toil/src/toil/job.py", line 666, in _loadJob
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       userModule = cls._loadUserModule(userModule)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/home/cmarkello/toil/src/toil/job.py", line 640, in _loadUserModuleWARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       return importlib.import_module(userModule.name)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:     File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:       __import__(name)
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ImportError: No module named toil_vg.vg_evaluation_pipeline
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   Exiting the worker because of a failed jobWrapper on host c1agent3
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   ERROR:toil.worker:Exiting the worker because of a failed jobWrapper on host c1agent3
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:Setting read timeout to 65
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   DEBUG:urllib3.connectionpool:"GET /acmarkellotoilvgjobstore11xxjobitems(PartitionKey='default',RowKey='fc48619f_e141_4211_8ab9_3004f95b16df')?$select= HTTP/1.1" 200 None
WARNING:toil.leader:fc48619f_e141_4211_8ab9_3004f95b16df:   WARNING:toil.jobWrapper:Due to failure we are reducing the remaining retry count of job fc48619f_e141_4211_8ab9_3004f95b16df to 0

# Fixed code
def start(self, rootJob):
    """
    Invoke a Toil workflow with the given job as the root for an initial run. This method
    must be called in the body of a ``with Toil(...) as toil:`` statement. This method should
    not be called more than once for a workflow that has not finished.

    :param toil.job.Job rootJob: The root job of the workflow
    :return: The root job's return value
    """
    self._assertContextManagerUsed()
    if self.config.restart:
        raise ToilRestartException(
            "A Toil workflow can only be started once. Use Toil.restart() to resume it."
        )

    self._batchSystem = self.createBatchSystem(self.config)
    self._setupHotDeployment(rootJob.getUserScript())
    try:
        self._setBatchSystemEnvVars()
        self._serialiseEnv()
        self._cacheAllJobs()

        # Make a file to store the root job's return value in
        rootJobReturnValueID = self._jobStore.getEmptyFileStoreID()

        # Add the root job return value as a promise
        rootJob._rvs[()].append(rootJobReturnValueID)

        # Write the name of the promise file in a shared file
        with self._jobStore.writeSharedFileStream("rootJobReturnValue") as fH:
            fH.write(rootJobReturnValueID)

        # Setup the first wrapper and cache it
        job = rootJob._serialiseFirstJob(self._jobStore)
        self._cacheJob(job)

        self._setProvisioner()
        return self._runMainLoop(job)
    finally:
        self._shutdownBatchSystem()