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

cannot connect to chrome - some of the time #33

Closed
LazerJesus opened this issue Dec 5, 2023 · 3 comments
Closed

cannot connect to chrome - some of the time #33

LazerJesus opened this issue Dec 5, 2023 · 3 comments

Comments

@LazerJesus
Copy link

about 4 of 5 times running ad_clicker i get the attached error.
1/5 no problem and it does what its supposed to.
I run poetry run python ad_clicker.py -q "dogfood" -t 5 --headless
its locally installed using git clone and up to date, running on Mac M2.

Traceback (most recent call last):
  File "/Users/finn/code/ad_clicker/ad_clicker.py", line 150, in <module>
    main()
  File "/Users/finn/code/ad_clicker/ad_clicker.py", line 122, in main
    driver = create_webdriver(proxy, args.auth, args.headless, args.incognito)
  File "/Users/finn/code/ad_clicker/utils.py", line 340, in create_webdriver
    driver = undetected_chromedriver.Chrome(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 466, in __init__
    super(Chrome, self).__init__(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/chrome/webdriver.py", line 84, in __init__
    super().__init__(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/chromium/webdriver.py", line 104, in __init__
    super().__init__(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 286, in __init__
    self.start_session(capabilities, browser_profile)
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 724, in start_session
    super(selenium.webdriver.chrome.webdriver.WebDriver, self).start_session(
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 378, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "/Users/finn/Library/Caches/pypoetry/virtualenvs/ad-clicker-s-_YzNe_-py3.10/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 245, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot connect to chrome at 127.0.0.1:54572
from chrome not reachable
Stacktrace:
0   undetected_chromedriver             0x0000000100ceed28 undetected_chromedriver + 4795688
1   undetected_chromedriver             0x0000000100ce62b3 undetected_chromedriver + 4760243
2   undetected_chromedriver             0x00000001008bf6bd undetected_chromedriver + 407229
3   undetected_chromedriver             0x00000001008a94ba undetected_chromedriver + 316602
4   undetected_chromedriver             0x00000001008fc0b3 undetected_chromedriver + 655539
5   undetected_chromedriver             0x00000001008f2dd7 undetected_chromedriver + 617943
6   undetected_chromedriver             0x000000010093fafb undetected_chromedriver + 932603
7   undetected_chromedriver             0x0000000100935a73 undetected_chromedriver + 891507
8   undetected_chromedriver             0x0000000100900143 undetected_chromedriver + 672067
9   undetected_chromedriver             0x000000010090131e undetected_chromedriver + 676638
10  undetected_chromedriver             0x0000000100caf795 undetected_chromedriver + 4536213
11  undetected_chromedriver             0x0000000100cb4853 undetected_chromedriver + 4556883
12  undetected_chromedriver             0x0000000100c95001 undetected_chromedriver + 4427777
13  undetected_chromedriver             0x0000000100cb559d undetected_chromedriver + 4560285
14  undetected_chromedriver             0x0000000100c8648c undetected_chromedriver + 4367500
15  undetected_chromedriver             0x0000000100cd50e8 undetected_chromedriver + 4690152
16  undetected_chromedriver             0x0000000100cd529e undetected_chromedriver + 4690590
17  undetected_chromedriver             0x0000000100ce5eee undetected_chromedriver + 4759278
18  libsystem_pthread.dylib             0x00007ff80bcd31d3 _pthread_start + 125
19  libsystem_pthread.dylib             0x00007ff80bccebd3 thread_start + 15

@coskundeniz
Copy link
Owner

I don't recommend headless mode since it increases the chance of blocking. Try without headless. Also, it can be a Mac related issue.

@LazerJesus
Copy link
Author

i dont think its a blocking question. according to the error message the script can connect to chrome.
how might this be mac related?

@coskundeniz
Copy link
Owner

I said it may be Mac related because I am a Linux user and don't see this error. Also, most premium buyers are Windows users and didn't see it on their system either. You can retry by deleting downloaded chromedriver and without headless. Thanks.

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

2 participants