{"record":{"id":"b477fcfc9105effe","repo":"nodejs/node","slug":"failed-to-parse-isolate-map-file-s-s","errorCode":null,"errorMessage":"Failed to parse isolate map file \"%s\": %s","messagePattern":"Failed to parse isolate map file \"(.+?)\": (.+?)","errorType":"exception","errorClass":"MBErr","httpStatus":null,"severity":"error","filePath":"deps/v8/tools/mb/mb.py","lineNumber":591,"sourceCode":"  def ReadIsolateMap(self):\n    if not self.args.isolate_map_files:\n      self.args.isolate_map_files = [self.default_isolate_map]\n\n    for f in self.args.isolate_map_files:\n      if not self.Exists(f):\n        raise MBErr('isolate map file not found at %s' % f)\n    isolate_maps = {}\n    for isolate_map in self.args.isolate_map_files:\n      try:\n        isolate_map = ast.literal_eval(self.ReadFile(isolate_map))\n        duplicates = set(isolate_map).intersection(isolate_maps)\n        if duplicates:\n          raise MBErr(\n              'Duplicate targets in isolate map files: %s.' %\n              ', '.join(duplicates))\n        isolate_maps.update(isolate_map)\n      except SyntaxError as e:\n        raise MBErr('Failed to parse isolate map file \"%s\": %s' %\n                    (isolate_map, e)) from e\n    return isolate_maps\n\n  def ConfigFromArgs(self):\n    if self.args.config:\n      if self.args.builder_group or self.args.builder:\n        raise MBErr(\n          'Can not specific both -c/--config and -m/--builder-group or '\n          '-b/--builder')\n\n      return self.args.config\n\n    if not self.args.builder_group or not self.args.builder:\n      raise MBErr('Must specify either -c/--config or '\n                  '(-m/--builder-group and -b/--builder)')\n\n    if not self.args.builder_group in self.builder_groups:\n      raise MBErr('Builder groups name \"%s\" not found in \"%s\"' %","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/v8/tools/mb/mb.py#L573-L609","documentation":"ReadIsolateMap() parses each isolate map file with ast.literal_eval. On SyntaxError it re-raises as MBErr('Failed to parse isolate map file \"%s\": %s') chaining the cause. Note the format args use the post-parse variable name `isolate_map` (which has been reassigned to the file contents), so the filename in the message may be misleading — cross-check with the -i list.","triggerScenarios":"An isolate map file (default gn_isolate_map.pyl or any -i file) is not a valid Python literal: unbalanced brackets, bad quoting, invalid token. ast.literal_eval raises SyntaxError, caught and converted.","commonSituations":"Hand-editing an isolate map and introducing a syntax error; merge-conflict markers left in; a stray trailing comma or missing quote; tab/space mixing in the literal.","solutions":["Validate each -i file with `python3 -c \"import ast; ast.literal_eval(open('<file>').read())\"` to find the exact parse error, then fix it.","Remove any unresolved merge-conflict markers from the isolate map.","If the error message's filename looks wrong (due to the variable reuse), check all -i files, not just the named one."],"exampleFix":"// before\n  'v8_unittests': {\n    'label': '//test/cctest:cctest'   // missing closing brace\n// after\n  'v8_unittests': {\n    'label': '//test/cctest:cctest',\n    'type': 'console_test_launcher',\n  },","handlingStrategy":"validation","validationCode":"import ast\nfor f in isolate_map_files:\n    try:\n        ast.literal_eval(open(f).read())\n    except SyntaxError as e:\n        sys.exit(f'isolate map {f} parse error at line {e.lineno}: {e.msg}')","typeGuard":"null","tryCatchPattern":"try:\n    data = ast.literal_eval(text)\nexcept SyntaxError as e:\n    raise MBErr(f'Failed to parse isolate map file \"{path}\": {e}') from e","preventionTips":["Validate every isolate map file with ast.literal_eval before running mb.","Clear all merge-conflict markers from map files.","Because the error reuses the `isolate_map` variable for the filename, check ALL -i files when this fires."],"tags":["mb","isolate","parse-error","ast","v8-build"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}