{"record":{"id":"add5debd43111ddc","repo":"FujiwaraChoki/MoneyPrinterV2","slug":"expected-built-scraper-binary-at-built-binary","errorCode":null,"errorMessage":"Expected built scraper binary at: {built_binary}","messagePattern":"Expected built scraper binary at: (.+?)","errorType":"error_code","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/classes/Outreach.py","lineNumber":112,"sourceCode":"            if platform.system() == \"Windows\"\n            else \"google-maps-scraper\"\n        )\n        if os.path.exists(binary_name):\n            print(colored(\"=> Scraper already built. Skipping build.\", \"blue\"))\n            return\n\n        scraper_dir = self._find_scraper_dir()\n        if not scraper_dir:\n            raise FileNotFoundError(\n                \"Could not locate extracted google-maps-scraper directory.\"\n            )\n\n        subprocess.run([\"go\", \"mod\", \"download\"], cwd=scraper_dir, check=True)\n        subprocess.run([\"go\", \"build\"], cwd=scraper_dir, check=True)\n\n        built_binary = os.path.join(scraper_dir, binary_name)\n        if not os.path.exists(built_binary):\n            raise FileNotFoundError(f\"Expected built scraper binary at: {built_binary}\")\n\n        os.replace(built_binary, binary_name)\n\n    def run_scraper_with_args_for_30_seconds(self, args: str, timeout=300) -> None:\n        \"\"\"\n        Run the scraper with the specified arguments for 30 seconds.\n\n        Args:\n            args (str): The arguments to run the scraper with.\n            timeout (int): The time to run the scraper for.\n\n        Returns:\n            None\n        \"\"\"\n        info(\" => Running scraper...\")\n        binary_name = (\n            \"google-maps-scraper.exe\"\n            if platform.system() == \"Windows\"","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/FujiwaraChoki/MoneyPrinterV2/blob/5192af8eca97759f941834b947e3ceb209da0649/src/classes/Outreach.py#L94-L130","documentation":"Raised by Outreach.build_scraper after `go build` succeeds but the expected binary is not at scraper_dir/<binary_name>. This means the Go toolchain produced output under a different name/location than expected (Go names binaries after the module/directory, not necessarily the expected name).","triggerScenarios":"The Go module's directory name differs from binary_name, so `go build -`-style default output lands elsewhere; go.mod module renames in a newer scraper release; or a stale/empty build directory.","commonSituations":"Upgrading google-maps-scraper to a version whose module name changed; building on a machine where GOBIN/GOFLAGS redirect output; running build with cached failure without check=True catching it.","solutions":["Pin the scraper release version whose module name matches binary_name","Build with an explicit output flag: subprocess.run(['go','build','-o', binary_name], cwd=scraper_dir, check=True) so the binary lands where expected","Verify the extracted scraper's go.mod module name matches the expected binary name"],"exampleFix":"// before\nsubprocess.run([\"go\", \"build\"], cwd=scraper_dir, check=True)\nbuilt_binary = os.path.join(scraper_dir, binary_name)\n\n// after\nsubprocess.run([\"go\", \"build\", \"-o\", binary_name], cwd=scraper_dir, check=True)\nbuilt_binary = os.path.join(scraper_dir, binary_name)","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    outreach.build_scraper()\nexcept FileNotFoundError as exc:\n    # binary landed under the Go module's own name — build with explicit -o\n    subprocess.run([\"go\", \"build\", \"-o\", binary_name], cwd=scraper_dir, check=True)","preventionTips":["Always build Go binaries with an explicit -o <name> so output location is deterministic","Check the scraper's go.mod module name matches the expected binary name when upgrading versions","Smoke-test the binary exists and is executable right after the build step"],"tags":["python","go","build","scraper"],"backgroundTag":"build-output-mismatch","analyzedSha":"5192af8eca97759f941834b947e3ceb209da0649","analyzedAt":"2026-08-28T10:31:46.474Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}