FujiwaraChoki/MoneyPrinterV2 · error · ValueError
Firefox profile path does not exist or is not a directory: {
Error message
Firefox profile path does not exist or is not a directory: {fp_profile_path} What it means
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.
Source
Thrown at src/classes/Twitter.py:56
fp_profile_path (str): The path to the Firefox profile
Returns:
None
"""
self.account_uuid: str = account_uuid
self.account_nickname: str = account_nickname
self.fp_profile_path: str = fp_profile_path
self.topic: str = topic
# Initialize the Firefox profile
self.options: Options = Options()
# Set headless state of browser
if get_headless():
self.options.add_argument("--headless")
if not os.path.isdir(fp_profile_path):
raise ValueError(
f"Firefox profile path does not exist or is not a directory: {fp_profile_path}"
)
# Set the profile path
self.options.add_argument("-profile")
self.options.add_argument(fp_profile_path)
# Set the service
self.service: Service = Service(GeckoDriverManager().install())
# Initialize the browser
self.browser: webdriver.Firefox = webdriver.Firefox(
service=self.service, options=self.options
)
self.wait: WebDriverWait = WebDriverWait(self.browser, 30)
def post(self, text: Optional[str] = None) -> None:
"""View on GitHub (pinned to 5192af8eca)
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)
Example fix
# before
fp_profile_path = "~/mozilla/firefox/xyz.default-release"
# after
import os
fp_profile_path = os.path.abspath(os.path.expanduser("~/mozilla/firefox/xyz.default-release"))
assert os.path.isdir(fp_profile_path), fp_profile_path Defensive patterns
Strategy: validation
Validate before calling
import os
path = os.path.abspath(os.path.expanduser(fp_profile_path))
if not os.path.isdir(path):
raise SystemExit(f"Configure Firefox profile at {path}") Type guard
def is_valid_profile_path(p: str) -> bool:
import os
return isinstance(p, str) and os.path.isdir(os.path.expanduser(p)) Try / catch
try:
twitter = Twitter(fp_profile_path)
except ValueError as e:
print(f"Bad profile config: {e}"); raise Prevention
- Store absolute profile paths in config.json
- Expand ~ before validation
- Include profile-path checks in preflight scripts
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Firefox profile path does not exist or is not a directory: {
- Firefox profile path does not exist or is not a directory: {
- Could not find tweet text box. Ensure you are logged into X
- Could not find the Post button on X compose screen.
AI-assisted analysis of FujiwaraChoki/MoneyPrinterV2@5192af8eca (2026-08-28).
Data as JSON: /api/errors/fc3af62622bff11d.
Report an issue: GitHub.