Skip to content

Exception: Error getting browser User-Agent. <urlopen error [WinError 10054]  #1119

@xueli12

Description

@xueli12

Have you checked our README?

  • I have checked the README

Have you followed our Troubleshooting?

  • I have followed your Troubleshooting

Is there already an issue for your problem?

  • I have checked older issues, open and closed

Have you checked the discussions?

  • I have read the Discussions

Environment

- FlareSolverr version: 3.3.16
- Last working FlareSolverr version: 3.3.16
- Operating system: win10
- Are you using Docker: no
- FlareSolverr User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 
- Are you using a VPN: no
- Are you using a Proxy: no
- Are you using Captcha Solver: no
- URL to test this issue:https://www.baidu.com

Description

Since I am in China, I may not be able to access most websites from other countries.When I don't turn on the system proxy, launching the flaresolverr service results in the error below, and it does not pass the test.
When I use Clash to turn on the system proxy , running flaresolverr can pass the test, after which I shut down the system proxy and flaresolverr can function normally.I have already set the environment variable TEST_URL to a URL that our country can access, but it is still ineffective, TEST_URL=https://www.baidu.com/. I used the following batch script:

@echo off
set LOG_LEVEL=debug
set LANG=en_GB
set HEADLESS=true
set TEST_URL=https://www.baidu.com
python src/flaresolverr.py

no system proxy.Flaresolverr encounters an error:
image

Enable the system proxy using Clash.Then flaresolverr can run:
}0A8~F(8)8NKZNRZV1CSOZJ

As I'm located in China, I might face difficulties accessing a majority of websites from other nations.Upon not activating the system proxy, I encounter an error when initiating the flaresolverr service, preventing it from passing the tests.However, once I activate the system proxy using Clash, flaresolverr seems to successfully pass the tests. Subsequently, on disabling the system proxy, flaresolverr continues to operate as expected.I have already set the environment variable TEST_URL to a URL that our country can access, but it is still ineffective, TEST_URL=https://www.baidu.com/.

Logged Error Messages

λ E:\批量移动文件python\FlareSolverr-3.3.16\start.bat
2024-03-12 01:48:03 INFO     ReqId 33280 FlareSolverr 3.3.16
2024-03-12 01:48:03 DEBUG    ReqId 33280 Debug log enabled
2024-03-12 01:48:03 INFO     ReqId 33280 Testing web browser installation...
2024-03-12 01:48:03 INFO     ReqId 33280 Platform: Windows-10-10.0.19045-SP0
2024-03-12 01:48:04 INFO     ReqId 33280 Chrome / Chromium path: C:\Users\Administrator.000\AppData\Local\Google\Chrome\Application\chrome.exe
2024-03-12 01:48:04 INFO     ReqId 33280 Chrome / Chromium major version: 122
2024-03-12 01:48:04 INFO     ReqId 33280 Launching web browser...
2024-03-12 01:48:04 DEBUG    ReqId 33280 Launching web browser...
2024-03-12 01:48:04 ERROR    ReqId 33280 Error starting Chrome: <urlopen error [WinError 10054] 远程主机强迫关闭了一个现有的连接。>
Traceback (most recent call last):
  File "E:\批量移动文件python\FlareSolverr-3.3.16\src\utils.py", line 308, in get_user_agent
    driver = get_webdriver()
             ^^^^^^^^^^^^^^^
  File "E:\批量移动文件python\FlareSolverr-3.3.16\src\utils.py", line 195, in get_webdriver
    PATCHED_DRIVER_PATH = os.path.join(driver.patcher.data_path, driver.patcher.exe_name)
                                       ^^^^^^
UnboundLocalError: cannot access local variable 'driver' where it is not associated with a value

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\批量移动文件python\FlareSolverr-3.3.16\src\flaresolverr.py", line 105, in <module>
    flaresolverr_service.test_browser_installation()
  File "E:\批量移动文件python\FlareSolverr-3.3.16\src\flaresolverr_service.py", line 72, in test_browser_installation
    user_agent = utils.get_user_agent()
                 ^^^^^^^^^^^^^^^^^^^^^^
  File "E:\批量移动文件python\FlareSolverr-3.3.16\src\utils.py", line 314, in get_user_agent
    raise Exception("Error getting browser User-Agent. " + str(e))
Exception: Error getting browser User-Agent. cannot access local variable 'driver' where it is not associated with a value

Screenshots

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy