{"record":{"id":"fc3af62622bff11d","repo":"FujiwaraChoki/MoneyPrinterV2","slug":"firefox-profile-path-does-not-exist-or-is-not-a-di-fc3af6","errorCode":null,"errorMessage":"Firefox profile path does not exist or is not a directory: {fp_profile_path}","messagePattern":"Firefox profile path does not exist or is not a directory: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/classes/Twitter.py","lineNumber":56,"sourceCode":"            fp_profile_path (str): The path to the Firefox profile\n\n        Returns:\n            None\n        \"\"\"\n        self.account_uuid: str = account_uuid\n        self.account_nickname: str = account_nickname\n        self.fp_profile_path: str = fp_profile_path\n        self.topic: str = topic\n\n        # Initialize the Firefox profile\n        self.options: Options = Options()\n\n        # Set headless state of browser\n        if get_headless():\n            self.options.add_argument(\"--headless\")\n\n        if not os.path.isdir(fp_profile_path):\n            raise ValueError(\n                f\"Firefox profile path does not exist or is not a directory: {fp_profile_path}\"\n            )\n\n        # Set the profile path\n        self.options.add_argument(\"-profile\")\n        self.options.add_argument(fp_profile_path)\n\n        # Set the service\n        self.service: Service = Service(GeckoDriverManager().install())\n\n        # Initialize the browser\n        self.browser: webdriver.Firefox = webdriver.Firefox(\n            service=self.service, options=self.options\n        )\n        self.wait: WebDriverWait = WebDriverWait(self.browser, 30)\n\n    def post(self, text: Optional[str] = None) -> None:\n        \"\"\"","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/FujiwaraChoki/MoneyPrinterV2/blob/5192af8eca97759f941834b947e3ceb209da0649/src/classes/Twitter.py#L38-L74","documentation":"ValueError raised in Twitter.__init__ when the configured Firefox profile path fails os.path.isdir, i.e. it does not exist or is a file. The check runs before selenium-wire's Firefox options attach `-profile`, so the browser never launches.","triggerScenarios":"Instantiating the Twitter class with an fp_profile_path that is missing, misspelled, a plain file, or on an unmounted volume while get_headless() is being configured.","commonSituations":"config.json pointing to a Windows path on Linux, profile directory moved/deleted, relative path resolved from wrong CWD, or fresh clone without profile setup.","solutions":["Verify the path exists: `ls -la <fp_profile_path>` and confirm it is a directory","Use an absolute path to the Firefox profile in config.json","If the profile was moved, update the fp_profile_path setting","Create/restore the profile (run Firefox once with -P to materialize it)"],"exampleFix":"# before\nfp_profile_path = \"~/mozilla/firefox/xyz.default-release\"\n# after\nimport os\nfp_profile_path = os.path.abspath(os.path.expanduser(\"~/mozilla/firefox/xyz.default-release\"))\nassert os.path.isdir(fp_profile_path), fp_profile_path","handlingStrategy":"validation","validationCode":"import os\npath = os.path.abspath(os.path.expanduser(fp_profile_path))\nif not os.path.isdir(path):\n    raise SystemExit(f\"Configure Firefox profile at {path}\")","typeGuard":"def is_valid_profile_path(p: str) -> bool:\n    import os\n    return isinstance(p, str) and os.path.isdir(os.path.expanduser(p))","tryCatchPattern":"try:\n    twitter = Twitter(fp_profile_path)\nexcept ValueError as e:\n    print(f\"Bad profile config: {e}\"); raise","preventionTips":["Store absolute profile paths in config.json","Expand ~ before validation","Include profile-path checks in preflight scripts"],"tags":["selenium","firefox","config-validation","twitter"],"backgroundTag":"invalid-config-path","analyzedSha":"5192af8eca97759f941834b947e3ceb209da0649","analyzedAt":"2026-08-28T10:31:46.474Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}