prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  FileArtifactExtraction Tasks failing
  From a recent run:
  ```
  * FileArtifactExtractionTask: image_export.py failed for artifact TomcatFiles - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact SshdConfigFile - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact RedisConfigFile - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact JupyterConfigFile - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact ApacheAccessLogs - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact NginxAccessLogs - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact GKEDockerContainerLogs - local_path not provided.
  * FileArtifactExtractionTask: image_export.py failed for artifact LinuxScheduleFiles - local_path not provided.
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `turbinia/workers/artifact.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 # Copyright 2015 Google Inc.
  3 #
  4 # Licensed under the Apache License, Version 2.0 (the "License");
  5 # you may not use this file except in compliance with the License.
  6 # You may obtain a copy of the License at
  7 #
  8 #      http://www.apache.org/licenses/LICENSE-2.0
  9 #
  10 # Unless required by applicable law or agreed to in writing, software
  11 # distributed under the License is distributed on an "AS IS" BASIS,
  12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 # See the License for the specific language governing permissions and
  14 # limitations under the License.
  15 """Task for running Plaso."""
  16 
  17 from __future__ import unicode_literals
  18 
  19 import os
  20 
  21 from turbinia import config
  22 from turbinia.evidence import ExportedFileArtifact
  23 from turbinia.evidence import EvidenceState as state
  24 from turbinia.workers import TurbiniaTask
  25 
  26 
  27 class FileArtifactExtractionTask(TurbiniaTask):
  28   """Task to run image_export (log2timeline)."""
  29 
  30   REQUIRED_STATES = [state.ATTACHED]
  31 
  32   def __init__(self, artifact_name='FileArtifact'):
  33     super(FileArtifactExtractionTask, self).__init__()
  34     self.artifact_name = artifact_name
  35 
  36   def run(self, evidence, result):
  37     """Extracts artifacts using Plaso image_export.py.
  38 
  39     Args:
  40         evidence (Evidence object):  The evidence we will process.
  41         result (TurbiniaTaskResult): The object to place task results into.
  42 
  43     Returns:
  44         TurbiniaTaskResult object.
  45     """
  46     config.LoadConfig()
  47 
  48     export_directory = os.path.join(self.output_dir, 'export')
  49     image_export_log = os.path.join(
  50         self.output_dir, '{0:s}.log'.format(self.id))
  51 
  52     cmd = [
  53         'sudo',
  54         'image_export.py',
  55         '--no-hashes',
  56         '--logfile',
  57         image_export_log,
  58         '-w',
  59         export_directory,
  60         '--partitions',
  61         'all',
  62         '--volumes',
  63         'all',
  64         '--unattended',
  65         '--artifact_filters',
  66         self.artifact_name,
  67     ]
  68     if config.DEBUG_TASKS or self.task_config.get('debug_tasks'):
  69       cmd.append('-d')
  70 
  71     if evidence.credentials:
  72       for credential_type, credential_data in evidence.credentials:
  73         cmd.extend([
  74             '--credential', '{0:s}:{1:s}'.format(
  75                 credential_type, credential_data)
  76         ])
  77 
  78     # Path to the source image/directory.
  79     cmd.append(evidence.local_path)
  80     if not evidence.local_path:
  81       result.log('Tried to run image_export without local_path')
  82       result.close(
  83           self, False,
  84           'image_export.py failed for artifact {0:s} - local_path not provided.'
  85           .format(self.artifact_name))
  86       return result
  87 
  88     result.log('Running image_export as [{0:s}]'.format(' '.join(cmd)))
  89 
  90     ret, _ = self.execute(cmd, result, log_files=[image_export_log])
  91     if ret:
  92       result.close(
  93           self, False, 'image_export.py failed for artifact {0:s}.'.format(
  94               self.artifact_name))
  95       return result
  96 
  97     for dirpath, _, filenames in os.walk(export_directory):
  98       for filename in filenames:
  99         exported_artifact = ExportedFileArtifact(
  100             artifact_name=self.artifact_name, source_path=os.path.join(
  101                 dirpath, filename))
  102         result.log('Adding artifact {0:s}'.format(filename))
  103         result.add_evidence(exported_artifact, evidence.config)
  104 
  105     result.close(
  106         self, True, 'Extracted {0:d} new {1:s} artifacts'.format(
  107             len(result.evidence), self.artifact_name))
  108 
  109     return result
  110
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/turbinia/workers/artifact.py b/turbinia/workers/artifact.py
  --- a/turbinia/workers/artifact.py
  +++ b/turbinia/workers/artifact.py
  @@ -27,7 +27,7 @@
   class FileArtifactExtractionTask(TurbiniaTask):
     """Task to run image_export (log2timeline)."""
   
  -  REQUIRED_STATES = [state.ATTACHED]
  +  REQUIRED_STATES = [state.ATTACHED, state.CONTAINER_MOUNTED]
   
     def __init__(self, artifact_name='FileArtifact'):
       super(FileArtifactExtractionTask, self).__init__()
  
verification_info: {"golden_diff": "diff --git a/turbinia/workers/artifact.py b/turbinia/workers/artifact.py\n--- a/turbinia/workers/artifact.py\n+++ b/turbinia/workers/artifact.py\n@@ -27,7 +27,7 @@\n class FileArtifactExtractionTask(TurbiniaTask):\n   \"\"\"Task to run image_export (log2timeline).\"\"\"\n \n-  REQUIRED_STATES = [state.ATTACHED]\n+  REQUIRED_STATES = [state.ATTACHED, state.CONTAINER_MOUNTED]\n \n   def __init__(self, artifact_name='FileArtifact'):\n     super(FileArtifactExtractionTask, self).__init__()\n", "issue": "FileArtifactExtraction Tasks failing\nFrom a recent run:\r\n```\r\n* FileArtifactExtractionTask: image_export.py failed for artifact TomcatFiles - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact SshdConfigFile - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact RedisConfigFile - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact JupyterConfigFile - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact ApacheAccessLogs - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact NginxAccessLogs - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact GKEDockerContainerLogs - local_path not provided.\r\n* FileArtifactExtractionTask: image_export.py failed for artifact LinuxScheduleFiles - local_path not provided.\r\n```\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright 2015 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Task for running Plaso.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom turbinia import config\nfrom turbinia.evidence import ExportedFileArtifact\nfrom turbinia.evidence import EvidenceState as state\nfrom turbinia.workers import TurbiniaTask\n\n\nclass FileArtifactExtractionTask(TurbiniaTask):\n  \"\"\"Task to run image_export (log2timeline).\"\"\"\n\n  REQUIRED_STATES = [state.ATTACHED]\n\n  def __init__(self, artifact_name='FileArtifact'):\n    super(FileArtifactExtractionTask, self).__init__()\n    self.artifact_name = artifact_name\n\n  def run(self, evidence, result):\n    \"\"\"Extracts artifacts using Plaso image_export.py.\n\n    Args:\n        evidence (Evidence object):  The evidence we will process.\n        result (TurbiniaTaskResult): The object to place task results into.\n\n    Returns:\n        TurbiniaTaskResult object.\n    \"\"\"\n    config.LoadConfig()\n\n    export_directory = os.path.join(self.output_dir, 'export')\n    image_export_log = os.path.join(\n        self.output_dir, '{0:s}.log'.format(self.id))\n\n    cmd = [\n        'sudo',\n        'image_export.py',\n        '--no-hashes',\n        '--logfile',\n        image_export_log,\n        '-w',\n        export_directory,\n        '--partitions',\n        'all',\n        '--volumes',\n        'all',\n        '--unattended',\n        '--artifact_filters',\n        self.artifact_name,\n    ]\n    if config.DEBUG_TASKS or self.task_config.get('debug_tasks'):\n      cmd.append('-d')\n\n    if evidence.credentials:\n      for credential_type, credential_data in evidence.credentials:\n        cmd.extend([\n            '--credential', '{0:s}:{1:s}'.format(\n                credential_type, credential_data)\n        ])\n\n    # Path to the source image/directory.\n    cmd.append(evidence.local_path)\n    if not evidence.local_path:\n      result.log('Tried to run image_export without local_path')\n      result.close(\n          self, False,\n          'image_export.py failed for artifact {0:s} - local_path not provided.'\n          .format(self.artifact_name))\n      return result\n\n    result.log('Running image_export as [{0:s}]'.format(' '.join(cmd)))\n\n    ret, _ = self.execute(cmd, result, log_files=[image_export_log])\n    if ret:\n      result.close(\n          self, False, 'image_export.py failed for artifact {0:s}.'.format(\n              self.artifact_name))\n      return result\n\n    for dirpath, _, filenames in os.walk(export_directory):\n      for filename in filenames:\n        exported_artifact = ExportedFileArtifact(\n            artifact_name=self.artifact_name, source_path=os.path.join(\n                dirpath, filename))\n        result.log('Adding artifact {0:s}'.format(filename))\n        result.add_evidence(exported_artifact, evidence.config)\n\n    result.close(\n        self, True, 'Extracted {0:d} new {1:s} artifacts'.format(\n            len(result.evidence), self.artifact_name))\n\n    return result\n", "path": "turbinia/workers/artifact.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright 2015 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Task for running Plaso.\"\"\"\n\nfrom __future__ import unicode_literals\n\nimport os\n\nfrom turbinia import config\nfrom turbinia.evidence import ExportedFileArtifact\nfrom turbinia.evidence import EvidenceState as state\nfrom turbinia.workers import TurbiniaTask\n\n\nclass FileArtifactExtractionTask(TurbiniaTask):\n  \"\"\"Task to run image_export (log2timeline).\"\"\"\n\n  REQUIRED_STATES = [state.ATTACHED, state.CONTAINER_MOUNTED]\n\n  def __init__(self, artifact_name='FileArtifact'):\n    super(FileArtifactExtractionTask, self).__init__()\n    self.artifact_name = artifact_name\n\n  def run(self, evidence, result):\n    \"\"\"Extracts artifacts using Plaso image_export.py.\n\n    Args:\n        evidence (Evidence object):  The evidence we will process.\n        result (TurbiniaTaskResult): The object to place task results into.\n\n    Returns:\n        TurbiniaTaskResult object.\n    \"\"\"\n    config.LoadConfig()\n\n    export_directory = os.path.join(self.output_dir, 'export')\n    image_export_log = os.path.join(\n        self.output_dir, '{0:s}.log'.format(self.id))\n\n    cmd = [\n        'sudo',\n        'image_export.py',\n        '--no-hashes',\n        '--logfile',\n        image_export_log,\n        '-w',\n        export_directory,\n        '--partitions',\n        'all',\n        '--volumes',\n        'all',\n        '--unattended',\n        '--artifact_filters',\n        self.artifact_name,\n    ]\n    if config.DEBUG_TASKS or self.task_config.get('debug_tasks'):\n      cmd.append('-d')\n\n    if evidence.credentials:\n      for credential_type, credential_data in evidence.credentials:\n        cmd.extend([\n            '--credential', '{0:s}:{1:s}'.format(\n                credential_type, credential_data)\n        ])\n\n    # Path to the source image/directory.\n    cmd.append(evidence.local_path)\n    if not evidence.local_path:\n      result.log('Tried to run image_export without local_path')\n      result.close(\n          self, False,\n          'image_export.py failed for artifact {0:s} - local_path not provided.'\n          .format(self.artifact_name))\n      return result\n\n    result.log('Running image_export as [{0:s}]'.format(' '.join(cmd)))\n\n    ret, _ = self.execute(cmd, result, log_files=[image_export_log])\n    if ret:\n      result.close(\n          self, False, 'image_export.py failed for artifact {0:s}.'.format(\n              self.artifact_name))\n      return result\n\n    for dirpath, _, filenames in os.walk(export_directory):\n      for filename in filenames:\n        exported_artifact = ExportedFileArtifact(\n            artifact_name=self.artifact_name, source_path=os.path.join(\n                dirpath, filename))\n        result.log('Adding artifact {0:s}'.format(filename))\n        result.add_evidence(exported_artifact, evidence.config)\n\n    result.close(\n        self, True, 'Extracted {0:d} new {1:s} artifacts'.format(\n            len(result.evidence), self.artifact_name))\n\n    return result\n", "path": "turbinia/workers/artifact.py"}]}