Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug features crashing selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0 #90

Open
zakblacki opened this issue Jan 24, 2025 · 13 comments

Comments

@zakblacki
Copy link

zakblacki commented Jan 24, 2025

Here is my config.json

    `{
      "verbose": true,
      "firefox_profile": "/Users/g-besoin/Library/Application Support/Firefox/Profiles/3ofmjrlf.default",
      "headless": false,
      "twitter_language": "English",
      "llm": "gpt4",
      "image_prompt_llm": "gpt4",
      "image_model": "v3",
      "threads": 3,
      "zip_url": "",
      "is_for_kids": false,
      "google_maps_scraper": "https://github.com/gosom/google-maps-scraper/archive/refs/tags/v1.7.5.zip",
      "email": {
        "smtp_server": "smtp.gmail.com",
        "smtp_port": 587,
        "username": "",
        "password": ""
      },
      "google_maps_scraper_niche": "",
      "scraper_timeout": 300,
      "outreach_message_subject": "I have a question...",
      "outreach_message_body_file": "outreach_message.html",
      "assembly_ai_api_key": "XXXXXmyAPI",
      "font": "bold_font.ttf",
      "imagemagick_path": "/opt/homebrew/bin/convert"
    }
    `
    

Here's the error log :

ℹ️ Starting YT Shorts Automater...
+----+--------------------------------------+----------+---------+
| ID |                 UUID                 | Nickname |  Niche  |
+----+--------------------------------------+----------+---------+
| 1  | 969d7784-0bfb-4c5a-b4e4-5c15244cee78 | zakblack | science |
+----+--------------------------------------+----------+---------+
❓ Select an account to start: 1
Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 92, in main
    youtube = YouTube(
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/YouTube.py", line 83, in __init__
    self.browser: webdriver.Firefox = webdriver.Firefox(service=self.service, options=self.options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in __init__
    self.start_session(capabilities)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 342, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0

ℹ️ Starting Twitter Bot...
+----+--------------------------------------+----------+---------------+
| ID |                 UUID                 | Nickname | Account Topic |
+----+--------------------------------------+----------+---------------+
| 1  | fb3e2275-3f83-422a-93fc-28160d14fcce | zakblack |    science    |
+----+--------------------------------------+----------+---------------+
❓ Select an account to start: 1
Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 212, in main
    twitter = Twitter(selected_account["id"], selected_account["nickname"], selected_account["firefox_profile"], selected_account["topic"])
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Twitter.py", line 59, in __init__
    self.browser: webdriver.Firefox = webdriver.Firefox(service=self.service, options=self.options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 250, in __init__
    self.start_session(capabilities)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 342, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0

=> Scraper finished with an error.
Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 348, in main
    outreach.start()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Outreach.py", line 186, in start
    items = self.get_items_from_file(output_path)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/Outreach.py", line 126, in get_items_from_file
    with open(file_name, "r", errors="ignore") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/g-besoin/Desktop/print/MoneyPrinterV2/.mp/scraper_results.csv'


Affiliate 

Traceback (most recent call last):
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 377, in <module>
    main()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/main.py", line 338, in main
    afm = AffiliateMarketing(selected_product["affiliate_link"], account["firefox_profile"], account["id"], account["nickname"], account["topic"])
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/AFM.py", line 64, in __init__
    self.scrape_product_information()
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/src/classes/AFM.py", line 72, in scrape_product_information
    self.browser.get(self.affiliate_link)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 454, in get
    self.execute(Command.GET, {"url": url})
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
    self.error_handler.check_response(response)
  File "/Users/g-besoin/Desktop/print/MoneyPrinterV2/myenv/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 232, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: Malformed URL: URL constructor:  is not a valid URL.
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
InvalidArgumentError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:384:5
GeckoDriver.prototype.navigateTo@chrome://remote/content/marionette/driver.sys.mjs:1054:11

What Im I doing wrong ?

Image
@zakblacki zakblacki changed the title Bug YT/TW both crashing selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0 Bug features crashing selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 0 Jan 24, 2025
@pinky969
Copy link

I am having the same issue

@paltaa
Copy link

paltaa commented Feb 9, 2025

@zakblacki did you find a fix for this? same issue in macos

@skp225
Copy link

skp225 commented Feb 13, 2025

Getting the same error AI is saying:

"This new error "WebDriverException: Process unexpectedly closed with status 0" typically occurs when:

The GeckoDriver executable is missing from the system PATH
There's a version mismatch between Firefox and Selenium
The browser fails to start due to incorrect options or profile configuration"

@wlnt360
Copy link

wlnt360 commented Feb 14, 2025

same issue on Mac M1

@FujiwaraChoki
Copy link
Owner

What Python version are you on?

@ragnorcap
Copy link

headless needs to be true , and youll need to tweak twitter script to accept headless . it should already have a variable for that. i just spent like 2 hours working through that. if anyone knows how to find the daggone tweet button that would be nice. i keep timing out or elemtn not found, prettty sure elon nerfed selenium

@ragnorcap
Copy link

also , youre gonna run into a topic issue when trying to post tweets at first, so make sure to set topic to niche , its set topic to topic and i cant get that to work but i got the former to work (i dont know what im doing just vibing and helpin out lol)

@ragnorcap
Copy link

also change your set prefrence in all your scripts from the two lines to this

self.options.set_preference("profile", fp_profile_path)

@ayan4m1
Copy link
Contributor

ayan4m1 commented Feb 18, 2025

@ragnorcap Change div to button in the XPath selector 😉

@FujiwaraChoki
Copy link
Owner

@ragnorcap Change div to button in the XPath selector 😉

Could you please make a PR?

@ayan4m1
Copy link
Contributor

ayan4m1 commented Feb 18, 2025

@ragnorcap Change div to button in the XPath selector 😉

Could you please make a PR?

Sure, there are a few other fixes I have applied in trying to get things to work smoothly, I'll make a separate PR for those as well.

EDIT: #108 #109

@FujiwaraChoki
Copy link
Owner

Report if #108 fixes the issue please, thx

@ayan4m1
Copy link
Contributor

ayan4m1 commented Feb 19, 2025

I think this is related to this issue, from geckodriver release notes

Known problems

    Startup hang with Firefox running in a container (e.g. snap, flatpak):

    When Firefox is packaged inside a container (like the default Firefox browser
    shipped with Ubuntu 22.04), it may see a different filesystem to the host.
    This can affect access to the generated profile directory, which may result
    in a hang when starting Firefox. Workarounds are listed in the geckodriver
    [usage documentation](https://firefox-source-docs.mozilla.org/testing/geckodriver/Usage.html#Running-Firefox-in-an-container-based-package).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants