{"record":{"id":"e577fc11f1b38710","repo":"nodejs/node","slug":"is-not-a-file","errorCode":null,"errorMessage":"{} is not a file","messagePattern":"(.+?) is not a file","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"deps/v8/tools/adb-d8.py","lineNumber":44,"sourceCode":"import subprocess\nimport SocketServer # TODO(leszeks): python 3 compatibility\n\ndef CreateFileHandlerClass(root_dirs, verbose):\n  class FileHandler(SocketServer.BaseRequestHandler):\n    def handle(self):\n      data = self.request.recv(1024);\n      while data[-1] != \"\\0\":\n        data += self.request.recv(1024);\n\n      filename = data[0:-1]\n\n      try:\n        filename = os.path.abspath(filename)\n\n        if not any(filename.startswith(root) for root in root_dirs):\n          raise Exception(\"{} not in roots {}\".format(filename, root_dirs))\n        if not os.path.isfile(filename):\n          raise Exception(\"{} is not a file\".format(filename))\n\n        if verbose:\n          sys.stdout.write(\"Serving {}\\r\\n\".format(os.path.relpath(filename)))\n\n        with open(filename) as f:\n          contents = f.read();\n          self.request.sendall(struct.pack(\"!i\", len(contents)))\n          self.request.sendall(contents)\n\n      except Exception as e:\n        if verbose:\n          sys.stderr.write(\n            \"Request failed ({})\\n\".format(e).replace('\\n','\\r\\n'))\n        self.request.sendall(struct.pack(\"!i\", -1))\n\n  return FileHandler\n\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/v8/tools/adb-d8.py#L26-L62","documentation":"The adb-d8 file server's second guard: even after a requested path passes the root-prefix check, it must point at a real regular file. If the resolved absolute path is a directory, a broken symlink, or simply doesn't exist, the server raises rather than trying to read it.","triggerScenarios":"Raised in FileHandler.handle() when `not os.path.isfile(filename)` is true, immediately after the roots-prefix check passes.","commonSituations":"Device requests a path that exists in the source layout but wasn't built (e.g. a .so that only appears after `make`); requesting a directory by mistake; a symlink target that's missing on the host; stale d8 payload manifest referencing deleted files.","solutions":["Build the requested artifact on the host first so the file actually exists.","Point the device/d8 at the correct file path (check for typos or a missing build-prefix like out/Release/).","If using symlinks, ensure the link target is present on the host."],"exampleFix":"# before: request out/Release/d8 but only out/Default/d8 was built\n# after: build the Release target, or request out/Default/d8","handlingStrategy":"validation","validationCode":"import os\nassert os.path.isfile(filename), f'{filename} is not a regular file; build it or fix the path'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build all artifacts the device may request before starting the file server.","Keep the device-side payload manifest in sync with what the host actually built."],"tags":["v8","d8","android","adb","missing-file"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}