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

Challenge solving not working with multiple sessions in parallel #896

Open
4 tasks done
filo891 opened this issue Sep 9, 2023 · 6 comments
Open
4 tasks done

Challenge solving not working with multiple sessions in parallel #896

filo891 opened this issue Sep 9, 2023 · 6 comments
Labels
help wanted Extra attention is needed

Comments

@filo891
Copy link

filo891 commented Sep 9, 2023

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.4
- Last working FlareSolverr version: N/A
- Operating system: Linux-6.0.0-0.deb11.2-amd64-x86_64-with-glibc2.31
- Are you using Docker: [yes/no] yes
- FlareSolverr User-Agent (see log traces or / endpoint): Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537
- Are you using a VPN: [yes/no] no
- Are you using a Proxy: [yes/no] yes
- Are you using Captcha Solver: [yes/no] no
- If using captcha solver, which one:
- URL to test this issue: https://uloz.to/

Description

When trying to use Flaresolverr in "parallel mode" (created multiple sessions and made parallel requests on each session), only the challenge in the first session is resolved, the remaining ones are timing out regardless the timeout value configured.

Logged Error Messages

2023-09-09 17:54:21 INFO     Incoming request => POST /v1 body: {'cmd': 'sessions.list'}
2023-09-09 17:54:21 INFO     Response in 0.0 s
2023-09-09 17:54:21 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-09-09 17:54:32 INFO     Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'proxy': {'url': 'socks5://192.168.45.151:9050'}}
2023-09-09 17:54:32 INFO     Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'proxy': {'url': 'socks5://192.168.45.151:9052'}}
2023-09-09 17:54:32 INFO     Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'proxy': {'url': 'socks5://192.168.45.151:9054'}}
2023-09-09 17:54:34 INFO     Response in 1.678 s
2023-09-09 17:54:34 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-09-09 17:54:34 INFO     Incoming request => POST /v1 body: {'maxTimeout': 180000, 'session': 'ee9a2330-4f39-11ee-8314-000c297f36bc', 'url': 'https://uloz.to/', 'cmd': 'request.get'}
2023-09-09 17:54:34 INFO     Response in 1.863 s
2023-09-09 17:54:34 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-09-09 17:54:34 INFO     Incoming request => POST /v1 body: {'maxTimeout': 180000, 'session': 'ee99d5e2-4f39-11ee-84a3-000c297f36bc', 'url': 'https://uloz.to/', 'cmd': 'request.get'}
2023-09-09 17:54:35 INFO     Response in 2.088 s
2023-09-09 17:54:35 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-09-09 17:54:35 INFO     Incoming request => POST /v1 body: {'maxTimeout': 180000, 'session': 'ee9a5c88-4f39-11ee-a31f-000c297f36bc', 'url': 'https://uloz.to/', 'cmd': 'request.get'}
2023-09-09 17:54:38 INFO     Challenge detected. Title found: Just a moment...
2023-09-09 17:54:39 INFO     Challenge detected. Title found: Just a moment...
2023-09-09 17:54:40 INFO     Challenge detected. Title found: Just a moment...
2023-09-09 17:54:53 INFO     Challenge solved!
2023-09-09 17:54:53 INFO     Response in 18.05 s
2023-09-09 17:54:53 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-09-09 17:57:34 ERROR    Error: Error solving the challenge. Timeout after 180.0 seconds.
2023-09-09 17:57:34 INFO     Response in 180.116 s
2023-09-09 17:57:34 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error
2023-09-09 17:57:34 ERROR    Error: Error solving the challenge. Timeout after 180.0 seconds.
2023-09-09 17:57:34 INFO     Response in 180.106 s
2023-09-09 17:57:34 INFO     127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error

Screenshots

No response

@filo891 filo891 changed the title Challenge solving working with multiple sessions in parallel Challenge solving not working with multiple sessions in parallel Sep 9, 2023
@ilike2burnthing ilike2burnthing added the help wanted Extra attention is needed label Sep 10, 2023
@NabiKAZ
Copy link
Contributor

NabiKAZ commented Oct 17, 2023

What I see in the log. You have already sent three session creation requests. But you probably didn't use the returned UUID of that created session in the next request and sent a fixed UUID ee99d5e2-4f39-11ee-84a3-000c297f36bc for all three requests.

You will get output like this after each call to sessions.create:

{
   status: 'ok',
   message: 'Session created successfully.',
   session: '10c2d807-6d0e-11ee-b14a-005056c00008',
   startTimestamp: 1697561767322,
   endTimestamp: 1697561767880,
   version: '3.3.6'
}

Now you need to send the session in the request.get request.
In this way, all three requests are processed independently and do not affect each other.

@filo891
Copy link
Author

filo891 commented Oct 17, 2023 via email

@NabiKAZ
Copy link
Contributor

NabiKAZ commented Oct 17, 2023

Logically, instead of reproducing and simulating your work. It would be better if you leave a code sample of what you have done.

Anyway, I did this using chatGPT and wrote the following code for testing.

At first, I thought the UUID outputs were the same, but the more I looked, I saw that they are very similar, but they are different.
When I checked your log again, I saw that it is the same and all three of your codes are also different:
ee9a2330-4f39-11ee-8314-000c297f36bc
ee99d5e2-4f39-11ee-84a3-000c297f36bc
ee9a5c88-4f39-11ee-a31f-000c297f36bc

As a result, the problem is not generated from the session.

The site you are testing is limited to a certain region, which unfortunately is not possible to test on. I tested on another site and there was no problem.

You can also test with that site and the sample code I wrote. If there is no problem with this code and the site, then that site is probably blocking consecutive requests, and for further investigation, you should provide a temporary proxy for the desired location so that further investigation can be done.

Sample Code:

Click me
import fetch from 'node-fetch';

const flareUrl = 'http://127.0.0.1:8191/v1';
const targetUrl = 'https://www.000webhost.com/cpanel-login';

async function createSession() {
    const createSessionRequest = {
        cmd: 'sessions.create',
        maxTimeout: 60000,
    };

    const requestOptions = {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify(createSessionRequest),
    };

    try {
        const response = await fetch(flareUrl, requestOptions);

        if (response.ok) {
            const sessionData = await response.json();
            const session = sessionData.session;
            console.log('Session:', session);
            return session;
        } else {
            throw new Error('Session creation request failed');
        }
    } catch (error) {
        throw error;
    }
}

async function openSiteWithSession(session) {
    const requestBody = {
        cmd: 'request.get',
        url: targetUrl,
        maxTimeout: 60000,
        session: session,
    };

    const requestOptions = {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
        },
        body: JSON.stringify(requestBody),
    };

    try {
        const response = await fetch(flareUrl, requestOptions);

        if (response.ok) {
            const data = await response.json();
            console.log(data);
        } else {
            console.error('Site opening request failed');
        }
    } catch (error) {
        console.error('An error occurred:', error);
    }
}

async function main() {
    try {
        const sessionPromises = Array(3).fill(null).map(() => createSession());
        const sessions = await Promise.all(sessionPromises);

        const sitePromises = sessions.map(session => openSiteWithSession(session));
        await Promise.all(sitePromises);
    } catch (error) {
        console.error('An error occurred:', error);
    }
}

main();

LOG FlareSolverr:

Click me
C:\Nabi\FlareSolverr>python src\flaresolverr.py
2023-10-17 21:40:13 INFO     ReqId 8144 FlareSolverr 3.3.6
2023-10-17 21:40:13 DEBUG    ReqId 8144 Debug log enabled
2023-10-17 21:40:13 INFO     ReqId 8144 Testing web browser installation...
2023-10-17 21:40:13 INFO     ReqId 8144 Platform: Windows-10-10.0.22000-SP0
2023-10-17 21:40:13 INFO     ReqId 8144 Chrome / Chromium path: C:\Program Files\Google\Chrome\Application\chrome.exe
2023-10-17 21:40:13 INFO     ReqId 8144 Chrome / Chromium major version: 118
2023-10-17 21:40:13 INFO     ReqId 8144 Launching web browser...
2023-10-17 21:40:13 DEBUG    ReqId 8144 Launching web browser...
2023-10-17 21:40:57 DEBUG    ReqId 8144 Started executable: `C:\Users\Nabi\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe` in a child process with pid: 14144
2023-10-17 21:40:57 INFO     ReqId 8144 FlareSolverr User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
2023-10-17 21:40:57 INFO     ReqId 8144 Test successful!
2023-10-17 21:40:57 INFO     ReqId 8144 Serving on http://0.0.0.0:8191
2023-10-17 21:41:00 INFO     ReqId 17796 Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'maxTimeout': 60000}
2023-10-17 21:41:00 DEBUG    ReqId 17796 Creating new session...
2023-10-17 21:41:00 INFO     ReqId 27788 Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'maxTimeout': 60000}
2023-10-17 21:41:00 INFO     ReqId 21452 Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'maxTimeout': 60000}
2023-10-17 21:41:00 DEBUG    ReqId 21452 Creating new session...
2023-10-17 21:41:00 DEBUG    ReqId 27788 Creating new session...
2023-10-17 21:41:00 DEBUG    ReqId 27788 Launching web browser...
2023-10-17 21:41:00 DEBUG    ReqId 21452 Launching web browser...
2023-10-17 21:41:00 DEBUG    ReqId 17796 Launching web browser...
2023-10-17 21:41:00 DEBUG    ReqId 21452 Started executable: `C:\Users\Nabi\appdata\roaming\undetected_chromedriver\chromedriver.exe` in a child process with pid: 25592
2023-10-17 21:41:00 DEBUG    ReqId 17796 Started executable: `C:\Users\Nabi\appdata\roaming\undetected_chromedriver\chromedriver.exe` in a child process with pid: 24676
2023-10-17 21:41:00 DEBUG    ReqId 27788 Started executable: `C:\Users\Nabi\appdata\roaming\undetected_chromedriver\chromedriver.exe` in a child process with pid: 15040
2023-10-17 21:41:00 DEBUG    ReqId 21452 Response => POST /v1 body: {'status': 'ok', 'message': 'Session created successfully.', 'session': '86bcb7a1-6d18-11ee-b24b-005056c00008', 'startTimestamp': 1697566260220, 'endTimestamp': 1697566260780, 'version': '3.3.6'}
2023-10-17 21:41:00 INFO     ReqId 21452 Response in 0.56 s
2023-10-17 21:41:00 DEBUG    ReqId 27788 Response => POST /v1 body: {'status': 'ok', 'message': 'Session created successfully.', 'session': '86bcb7a2-6d18-11ee-9fda-005056c00008', 'startTimestamp': 1697566260220, 'endTimestamp': 1697566260780, 'version': '3.3.6'}
2023-10-17 21:41:00 INFO     ReqId 21452 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-17 21:41:00 INFO     ReqId 27788 Response in 0.56 s
2023-10-17 21:41:00 INFO     ReqId 27788 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-17 21:41:00 DEBUG    ReqId 17796 Response => POST /v1 body: {'status': 'ok', 'message': 'Session created successfully.', 'session': '86bc91a1-6d18-11ee-870d-005056c00008', 'startTimestamp': 1697566260219, 'endTimestamp': 1697566260791, 'version': '3.3.6'}
2023-10-17 21:41:00 INFO     ReqId 17796 Response in 0.572 s
2023-10-17 21:41:00 INFO     ReqId 17796 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-17 21:41:00 INFO     ReqId 18920 Incoming request => POST /v1 body: {'cmd': 'request.get', 'url': 'https://www.000webhost.com/cpanel-login', 'maxTimeout': 60000, 'session': '86bc91a1-6d18-11ee-870d-005056c00008'}
2023-10-17 21:41:00 INFO     ReqId 21452 Incoming request => POST /v1 body: {'cmd': 'request.get', 'url': 'https://www.000webhost.com/cpanel-login', 'maxTimeout': 60000, 'session': '86bcb7a2-6d18-11ee-9fda-005056c00008'}
2023-10-17 21:41:00 DEBUG    ReqId 18920 existing session is used to perform the request (session_id=86bc91a1-6d18-11ee-870d-005056c00008, lifetime=0:00:00.003997, ttl=None)
2023-10-17 21:41:00 INFO     ReqId 27788 Incoming request => POST /v1 body: {'cmd': 'request.get', 'url': 'https://www.000webhost.com/cpanel-login', 'maxTimeout': 60000, 'session': '86bcb7a1-6d18-11ee-b24b-005056c00008'}
2023-10-17 21:41:00 DEBUG    ReqId 21452 existing session is used to perform the request (session_id=86bcb7a2-6d18-11ee-9fda-005056c00008, lifetime=0:00:00.014431, ttl=None)
2023-10-17 21:41:00 DEBUG    ReqId 27788 existing session is used to perform the request (session_id=86bcb7a1-6d18-11ee-b24b-005056c00008, lifetime=0:00:00.015960, ttl=None)
2023-10-17 21:41:00 DEBUG    ReqId 20548 Navigating to... https://www.000webhost.com/cpanel-login
2023-10-17 21:41:00 DEBUG    ReqId 2800 Navigating to... https://www.000webhost.com/cpanel-login
2023-10-17 21:41:00 DEBUG    ReqId 26072 Navigating to... https://www.000webhost.com/cpanel-login
2023-10-17 21:41:03 INFO     ReqId 20548 Challenge detected. Title found: Just a moment...
2023-10-17 21:41:03 DEBUG    ReqId 20548 Waiting for title (attempt 1): Just a moment...
2023-10-17 21:41:03 INFO     ReqId 2800 Challenge detected. Title found: Just a moment...
2023-10-17 21:41:03 DEBUG    ReqId 2800 Waiting for title (attempt 1): Just a moment...
2023-10-17 21:41:03 INFO     ReqId 26072 Challenge detected. Title found: Just a moment...
2023-10-17 21:41:03 DEBUG    ReqId 26072 Waiting for title (attempt 1): Just a moment...
2023-10-17 21:41:04 DEBUG    ReqId 20548 Timeout waiting for selector
2023-10-17 21:41:04 DEBUG    ReqId 20548 Try to find the Cloudflare verify checkbox...
2023-10-17 21:41:04 DEBUG    ReqId 2800 Timeout waiting for selector
2023-10-17 21:41:04 DEBUG    ReqId 2800 Try to find the Cloudflare verify checkbox...
2023-10-17 21:41:04 DEBUG    ReqId 2800 Cloudflare verify checkbox not found on the page.
2023-10-17 21:41:04 DEBUG    ReqId 2800 Try to find the Cloudflare 'Verify you are human' button...
2023-10-17 21:41:04 DEBUG    ReqId 2800 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-17 21:41:04 DEBUG    ReqId 20548 Cloudflare verify checkbox not found on the page.
2023-10-17 21:41:04 DEBUG    ReqId 20548 Try to find the Cloudflare 'Verify you are human' button...
2023-10-17 21:41:04 DEBUG    ReqId 20548 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-17 21:41:05 DEBUG    ReqId 26072 Timeout waiting for selector
2023-10-17 21:41:05 DEBUG    ReqId 26072 Try to find the Cloudflare verify checkbox...
2023-10-17 21:41:05 DEBUG    ReqId 26072 Cloudflare verify checkbox not found on the page.
2023-10-17 21:41:05 DEBUG    ReqId 26072 Try to find the Cloudflare 'Verify you are human' button...
2023-10-17 21:41:05 DEBUG    ReqId 26072 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-17 21:41:06 DEBUG    ReqId 2800 Waiting for title (attempt 2): Just a moment...
2023-10-17 21:41:06 DEBUG    ReqId 20548 Waiting for title (attempt 2): Just a moment...
2023-10-17 21:41:07 DEBUG    ReqId 26072 Waiting for title (attempt 2): Just a moment...
2023-10-17 21:41:07 DEBUG    ReqId 2800 Timeout waiting for selector
2023-10-17 21:41:07 DEBUG    ReqId 2800 Try to find the Cloudflare verify checkbox...
2023-10-17 21:41:07 DEBUG    ReqId 20548 Timeout waiting for selector
2023-10-17 21:41:07 DEBUG    ReqId 20548 Try to find the Cloudflare verify checkbox...
2023-10-17 21:41:08 DEBUG    ReqId 2800 Cloudflare verify checkbox found and clicked!
2023-10-17 21:41:08 DEBUG    ReqId 2800 Try to find the Cloudflare 'Verify you are human' button...
2023-10-17 21:41:08 DEBUG    ReqId 2800 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-17 21:41:08 DEBUG    ReqId 20548 Cloudflare verify checkbox found and clicked!
2023-10-17 21:41:08 DEBUG    ReqId 20548 Try to find the Cloudflare 'Verify you are human' button...
2023-10-17 21:41:08 DEBUG    ReqId 20548 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-17 21:41:08 DEBUG    ReqId 26072 Timeout waiting for selector
2023-10-17 21:41:08 DEBUG    ReqId 26072 Try to find the Cloudflare verify checkbox...
2023-10-17 21:41:09 DEBUG    ReqId 26072 Cloudflare verify checkbox found and clicked!
2023-10-17 21:41:09 DEBUG    ReqId 26072 Try to find the Cloudflare 'Verify you are human' button...
2023-10-17 21:41:09 DEBUG    ReqId 26072 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-17 21:41:10 DEBUG    ReqId 2800 Waiting for title (attempt 3): Just a moment...
2023-10-17 21:41:10 DEBUG    ReqId 20548 Waiting for title (attempt 3): Just a moment...
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for title (attempt 3): DDoS-Guard
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): #cf-challenge-running
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): .ray_id
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): .attack-box
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): #cf-please-wait
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): #challenge-spinner
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): #trk_jschal_js
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): td.info #js_info
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for selector (attempt 3): div.vc div.text-box h2
2023-10-17 21:41:33 DEBUG    ReqId 20548 Waiting for redirect
2023-10-17 21:41:33 INFO     ReqId 20548 Challenge solved!
2023-10-17 21:41:33 DEBUG    ReqId 18920 Response => POST /v1 body: {'status': 'ok', 'message': 'Challenge solved!', 'solution': {'url': 'https://www.000webhost.com/cpanel-login', 'status': 200, 'cookies': [...], 'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36', 'headers': {}, 'response': '<html lang="en-us"...</html>'}, 'startTimestamp': 1697566260794, 'endTimestamp': 1697566293632, 'version': '3.3.6'}
2023-10-17 21:41:33 INFO     ReqId 18920 Response in 32.838 s
2023-10-17 21:41:33 INFO     ReqId 18920 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for title (attempt 3): DDoS-Guard
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): #cf-challenge-running
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): .ray_id
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): .attack-box
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): #cf-please-wait
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): #challenge-spinner
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): #trk_jschal_js
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): td.info #js_info
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for selector (attempt 3): div.vc div.text-box h2
2023-10-17 21:41:33 DEBUG    ReqId 2800 Waiting for redirect
2023-10-17 21:41:33 INFO     ReqId 2800 Challenge solved!
2023-10-17 21:41:33 DEBUG    ReqId 21452 Response => POST /v1 body: {'status': 'ok', 'message': 'Challenge solved!', 'solution': {'url': 'https://www.000webhost.com/cpanel-login', 'status': 200, 'cookies': [...], 'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36', 'headers': {}, 'response': '<html lang="en-us"...</html>'}, 'startTimestamp': 1697566260795, 'endTimestamp': 1697566293992, 'version': '3.3.6'}
2023-10-17 21:41:34 INFO     ReqId 21452 Response in 33.197 s
2023-10-17 21:41:34 INFO     ReqId 21452 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for title (attempt 3): Just a moment...
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for title (attempt 3): DDoS-Guard
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): #cf-challenge-running
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): .ray_id
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): .attack-box
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): #cf-please-wait
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): #challenge-spinner
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): #trk_jschal_js
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): td.info #js_info
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for selector (attempt 3): div.vc div.text-box h2
2023-10-17 21:41:36 DEBUG    ReqId 26072 Waiting for redirect
2023-10-17 21:41:37 DEBUG    ReqId 26072 Timeout waiting for redirect
2023-10-17 21:41:37 INFO     ReqId 26072 Challenge solved!
2023-10-17 21:41:37 DEBUG    ReqId 27788 Response => POST /v1 body: {'status': 'ok', 'message': 'Challenge solved!', 'solution': {'url': 'https://www.000webhost.com/cpanel-login', 'status': 200, 'cookies': [...], 'userAgent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36', 'headers': {}, 'response': '<html lang="en-us"...</html>'}, 'startTimestamp': 1697566260795, 'endTimestamp': 1697566297205, 'version': '3.3.6'}
2023-10-17 21:41:37 INFO     ReqId 27788 Response in 36.41 s
2023-10-17 21:41:37 INFO     ReqId 27788 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK

LOG Test App:

Click me
PS C:\Nabi\vaghte-sefarat> node .\test_FlareSolverr_multiple.mjs
Session: 86bcb7a1-6d18-11ee-b24b-005056c00008
Session: 86bcb7a2-6d18-11ee-9fda-005056c00008
Session: 86bc91a1-6d18-11ee-870d-005056c00008
{
  status: 'ok',
  message: 'Challenge solved!',
  solution: {
    url: 'https://www.000webhost.com/cpanel-login',
    status: 200,
    cookies: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ],
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
    headers: {},
    response: '<html lang="en-us"...
  },
  startTimestamp: 1697566260794,
  endTimestamp: 1697566293632,
  version: '3.3.6'
}
{
  status: 'ok',
  message: 'Challenge solved!',
  solution: {
    url: 'https://www.000webhost.com/cpanel-login',
    status: 200,
    cookies: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ],
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
    headers: {},
    response: '<html lang="en-us"...
  },
  startTimestamp: 1697566260795,
  endTimestamp: 1697566293992,
  version: '3.3.6'
}
{
  status: 'ok',
  message: 'Challenge solved!',
  solution: {
    url: 'https://www.000webhost.com/cpanel-login',
    status: 200,
    cookies: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ],
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36',
    headers: {},
    response: '<html lang="en-us"...
  },
  startTimestamp: 1697566260795,
  endTimestamp: 1697566297205,
  version: '3.3.6'
}

@filo891
Copy link
Author

filo891 commented Oct 20, 2023

Hi,

I have tried with your code and I'm still being able to reproduce the issue. This time with the debug log enabled.

From what I can see you are running Flaresolverr on Windows while I'm using the Linux container. I have started it using the following command:

docker run -d \
  --name=flaresolverr \
  -e LOG_LEVEL=debug\
  --restart unless-stopped \
  --network host \
  ghcr.io/flaresolverr/flaresolverr:latest

Flaresolverr

2023-10-20 19:16:49 INFO     ReqId 140354217711424 FlareSolverr 3.3.6
2023-10-20 19:16:49 DEBUG    ReqId 140354217711424 Debug log enabled
2023-10-20 19:16:49 INFO     ReqId 140354217711424 Testing web browser installation...
2023-10-20 19:16:49 INFO     ReqId 140354217711424 Platform: Linux-6.1.0-0.deb11.11-amd64-x86_64-with-glibc2.31
2023-10-20 19:16:49 INFO     ReqId 140354217711424 Chrome / Chromium path: /usr/bin/chromium
2023-10-20 19:16:50 INFO     ReqId 140354217711424 Chrome / Chromium major version: 116
2023-10-20 19:16:50 INFO     ReqId 140354217711424 Launching web browser...
2023-10-20 19:16:50 DEBUG    ReqId 140354217711424 Launching web browser...
2023-10-20 19:16:50 DEBUG    ReqId 140354217711424 Started executable: `/app/chromedriver` in a child process with pid: 32
2023-10-20 19:16:51 INFO     ReqId 140354217711424 FlareSolverr User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
2023-10-20 19:16:51 INFO     ReqId 140354217711424 Test successful!
2023-10-20 19:16:51 INFO     ReqId 140354217711424 Serving on http://0.0.0.0:8191
2023-10-20 19:17:09 INFO     ReqId 140354185119488 Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'maxTimeout': 60000}
2023-10-20 19:17:09 DEBUG    ReqId 140354185119488 Creating new session...
2023-10-20 19:17:09 DEBUG    ReqId 140354185119488 Launching web browser...
2023-10-20 19:17:09 INFO     ReqId 140354095412992 Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'maxTimeout': 60000}
2023-10-20 19:17:09 DEBUG    ReqId 140354095412992 Creating new session...
2023-10-20 19:17:09 DEBUG    ReqId 140354095412992 Launching web browser...
2023-10-20 19:17:09 INFO     ReqId 140354176726784 Incoming request => POST /v1 body: {'cmd': 'sessions.create', 'maxTimeout': 60000}
2023-10-20 19:17:09 DEBUG    ReqId 140354176726784 Creating new session...
2023-10-20 19:17:09 DEBUG    ReqId 140354176726784 Launching web browser...
2023-10-20 19:17:09 DEBUG    ReqId 140354185119488 Started executable: `/app/chromedriver` in a child process with pid: 166
2023-10-20 19:17:09 DEBUG    ReqId 140354095412992 Started executable: `/app/chromedriver` in a child process with pid: 171
2023-10-20 19:17:09 DEBUG    ReqId 140354176726784 Started executable: `/app/chromedriver` in a child process with pid: 175
2023-10-20 19:17:11 DEBUG    ReqId 140354095412992 Response => POST /v1 body: {'status': 'ok', 'message': 'Session created successfully.', 'session': '440eeafe-6f7d-11ee-b8c7-000c297f36bc', 'startTimestamp': 1697829429848, 'endTimestamp': 1697829431764, 'version': '3.3.6'}
2023-10-20 19:17:11 INFO     ReqId 140354095412992 Response in 1.916 s
2023-10-20 19:17:11 INFO     ReqId 140354095412992 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-20 19:17:11 DEBUG    ReqId 140354176726784 Response => POST /v1 body: {'status': 'ok', 'message': 'Session created successfully.', 'session': '440f4fda-6f7d-11ee-bc2e-000c297f36bc', 'startTimestamp': 1697829429851, 'endTimestamp': 1697829431934, 'version': '3.3.6'}
2023-10-20 19:17:11 INFO     ReqId 140354176726784 Response in 2.083 s
2023-10-20 19:17:11 INFO     ReqId 140354176726784 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-20 19:17:12 DEBUG    ReqId 140354185119488 Response => POST /v1 body: {'status': 'ok', 'message': 'Session created successfully.', 'session': '440ea710-6f7d-11ee-85b2-000c297f36bc', 'startTimestamp': 1697829429846, 'endTimestamp': 1697829432129, 'version': '3.3.6'}
2023-10-20 19:17:12 INFO     ReqId 140354185119488 Response in 2.283 s
2023-10-20 19:17:12 INFO     ReqId 140354185119488 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-20 19:17:12 INFO     ReqId 140354176726784 Incoming request => POST /v1 body: {'cmd': 'request.get', 'url': 'https://www.000webhost.com/cpanel-login', 'maxTimeout': 60000, 'session': '440ea710-6f7d-11ee-85b2-000c297f36bc'}
2023-10-20 19:17:12 DEBUG    ReqId 140354176726784 existing session is used to perform the request (session_id=440ea710-6f7d-11ee-85b2-000c297f36bc, lifetime=0:00:00.023691, ttl=None)
2023-10-20 19:17:12 INFO     ReqId 140354087020288 Incoming request => POST /v1 body: {'cmd': 'request.get', 'url': 'https://www.000webhost.com/cpanel-login', 'maxTimeout': 60000, 'session': '440eeafe-6f7d-11ee-b8c7-000c297f36bc'}
2023-10-20 19:17:12 INFO     ReqId 140354095412992 Incoming request => POST /v1 body: {'cmd': 'request.get', 'url': 'https://www.000webhost.com/cpanel-login', 'maxTimeout': 60000, 'session': '440f4fda-6f7d-11ee-bc2e-000c297f36bc'}
2023-10-20 19:17:12 DEBUG    ReqId 140354087020288 existing session is used to perform the request (session_id=440eeafe-6f7d-11ee-b8c7-000c297f36bc, lifetime=0:00:00.392780, ttl=None)
2023-10-20 19:17:12 DEBUG    ReqId 140354095412992 existing session is used to perform the request (session_id=440f4fda-6f7d-11ee-bc2e-000c297f36bc, lifetime=0:00:00.224491, ttl=None)
2023-10-20 19:17:12 DEBUG    ReqId 140354078627584 Navigating to... https://www.000webhost.com/cpanel-login
2023-10-20 19:17:12 DEBUG    ReqId 140354061842176 Navigating to... https://www.000webhost.com/cpanel-login
2023-10-20 19:17:12 DEBUG    ReqId 140354070234880 Navigating to... https://www.000webhost.com/cpanel-login
2023-10-20 19:17:14 INFO     ReqId 140354078627584 Challenge detected. Title found: Just a moment...
2023-10-20 19:17:14 DEBUG    ReqId 140354078627584 Waiting for title (attempt 1): Just a moment...
2023-10-20 19:17:14 INFO     ReqId 140354061842176 Challenge detected. Title found: Just a moment...
2023-10-20 19:17:14 DEBUG    ReqId 140354061842176 Waiting for title (attempt 1): Just a moment...
2023-10-20 19:17:14 INFO     ReqId 140354070234880 Challenge detected. Title found: Just a moment...
2023-10-20 19:17:14 DEBUG    ReqId 140354070234880 Waiting for title (attempt 1): Just a moment...
2023-10-20 19:17:15 DEBUG    ReqId 140354078627584 Timeout waiting for selector
2023-10-20 19:17:15 DEBUG    ReqId 140354078627584 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:15 DEBUG    ReqId 140354061842176 Timeout waiting for selector
2023-10-20 19:17:15 DEBUG    ReqId 140354061842176 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:15 DEBUG    ReqId 140354070234880 Timeout waiting for selector
2023-10-20 19:17:15 DEBUG    ReqId 140354070234880 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:16 DEBUG    ReqId 140354061842176 Cloudflare verify checkbox not found on the page.
2023-10-20 19:17:16 DEBUG    ReqId 140354078627584 Cloudflare verify checkbox not found on the page.
2023-10-20 19:17:16 DEBUG    ReqId 140354061842176 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:16 DEBUG    ReqId 140354078627584 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:16 DEBUG    ReqId 140354061842176 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:16 DEBUG    ReqId 140354078627584 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:16 DEBUG    ReqId 140354070234880 Cloudflare verify checkbox not found on the page.
2023-10-20 19:17:16 DEBUG    ReqId 140354070234880 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:16 DEBUG    ReqId 140354070234880 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:18 DEBUG    ReqId 140354078627584 Waiting for title (attempt 2): Just a moment...
2023-10-20 19:17:18 DEBUG    ReqId 140354061842176 Waiting for title (attempt 2): Just a moment...
2023-10-20 19:17:19 DEBUG    ReqId 140354070234880 Waiting for title (attempt 2): Just a moment...
2023-10-20 19:17:19 DEBUG    ReqId 140354078627584 Timeout waiting for selector
2023-10-20 19:17:19 DEBUG    ReqId 140354078627584 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:19 DEBUG    ReqId 140354061842176 Timeout waiting for selector
2023-10-20 19:17:19 DEBUG    ReqId 140354061842176 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:19 DEBUG    ReqId 140354078627584 Cloudflare verify checkbox not found on the page.
2023-10-20 19:17:19 DEBUG    ReqId 140354078627584 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:19 DEBUG    ReqId 140354078627584 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:19 DEBUG    ReqId 140354061842176 Cloudflare verify checkbox not found on the page.
2023-10-20 19:17:19 DEBUG    ReqId 140354061842176 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:19 DEBUG    ReqId 140354061842176 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:20 DEBUG    ReqId 140354070234880 Timeout waiting for selector
2023-10-20 19:17:20 DEBUG    ReqId 140354070234880 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:21 DEBUG    ReqId 140354078627584 Waiting for title (attempt 3): Just a moment...
2023-10-20 19:17:21 DEBUG    ReqId 140354061842176 Waiting for title (attempt 3): Just a moment...
2023-10-20 19:17:22 DEBUG    ReqId 140354078627584 Timeout waiting for selector
2023-10-20 19:17:22 DEBUG    ReqId 140354078627584 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:22 DEBUG    ReqId 140354078627584 Cloudflare verify checkbox not found on the page.
2023-10-20 19:17:22 DEBUG    ReqId 140354078627584 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:22 DEBUG    ReqId 140354078627584 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:22 DEBUG    ReqId 140354061842176 Timeout waiting for selector
2023-10-20 19:17:22 DEBUG    ReqId 140354061842176 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:24 DEBUG    ReqId 140354078627584 Waiting for title (attempt 4): Just a moment...
2023-10-20 19:17:25 DEBUG    ReqId 140354078627584 Timeout waiting for selector
2023-10-20 19:17:25 DEBUG    ReqId 140354078627584 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:26 DEBUG    ReqId 140354078627584 Cloudflare verify checkbox found and clicked!
2023-10-20 19:17:26 DEBUG    ReqId 140354078627584 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:26 DEBUG    ReqId 140354078627584 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for title (attempt 5): Just a moment...
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for title (attempt 5): DDoS-Guard
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): #cf-challenge-running
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): .ray_id
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): .attack-box
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): #cf-please-wait
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): #challenge-spinner
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): #trk_jschal_js
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): td.info #js_info
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for selector (attempt 5): div.vc div.text-box h2
2023-10-20 19:17:30 DEBUG    ReqId 140354078627584 Waiting for redirect
2023-10-20 19:17:30 DEBUG    ReqId 140354070234880 Cloudflare verify checkbox found and clicked!
2023-10-20 19:17:30 DEBUG    ReqId 140354070234880 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:30 DEBUG    ReqId 140354070234880 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:31 DEBUG    ReqId 140354078627584 Timeout waiting for redirect
2023-10-20 19:17:31 INFO     ReqId 140354078627584 Challenge solved!
2023-10-20 19:17:31 DEBUG    ReqId 140354176726784 Response => POST /v1 body: {'status': 'ok', 'message': 'Challenge solved!', 'solution': {'url': 'https://www.000webhost.com/cpanel-login', 'status': 200, 'cookies': [...], 'userAgent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36', 'headers': {}, 'response': '<html lang="en-us" ...</html>'}, 'startTimestamp': 1697829432147, 'endTimestamp': 1697829451903, 'version': '3.3.6'}
2023-10-20 19:17:31 INFO     ReqId 140354176726784 Response in 19.756 s
2023-10-20 19:17:31 INFO     ReqId 140354176726784 127.0.0.1 POST http://127.0.0.1:8191/v1 200 OK
2023-10-20 19:17:32 DEBUG    ReqId 140354070234880 Waiting for title (attempt 3): Just a moment...
2023-10-20 19:17:33 DEBUG    ReqId 140354061842176 Cloudflare verify checkbox found and clicked!
2023-10-20 19:17:33 DEBUG    ReqId 140354061842176 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:33 DEBUG    ReqId 140354061842176 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:34 DEBUG    ReqId 140354070234880 Timeout waiting for selector
2023-10-20 19:17:34 DEBUG    ReqId 140354070234880 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:35 DEBUG    ReqId 140354061842176 Waiting for title (attempt 4): Just a moment...
2023-10-20 19:17:36 DEBUG    ReqId 140354061842176 Timeout waiting for selector
2023-10-20 19:17:36 DEBUG    ReqId 140354061842176 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:44 DEBUG    ReqId 140354070234880 Cloudflare verify checkbox found and clicked!
2023-10-20 19:17:44 DEBUG    ReqId 140354070234880 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:44 DEBUG    ReqId 140354070234880 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:46 DEBUG    ReqId 140354070234880 Waiting for title (attempt 4): Just a moment...
2023-10-20 19:17:47 DEBUG    ReqId 140354061842176 Cloudflare verify checkbox found and clicked!
2023-10-20 19:17:47 DEBUG    ReqId 140354061842176 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:47 DEBUG    ReqId 140354061842176 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:17:47 DEBUG    ReqId 140354070234880 Timeout waiting for selector
2023-10-20 19:17:47 DEBUG    ReqId 140354070234880 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:49 DEBUG    ReqId 140354061842176 Waiting for title (attempt 5): Just a moment...
2023-10-20 19:17:50 DEBUG    ReqId 140354061842176 Timeout waiting for selector
2023-10-20 19:17:50 DEBUG    ReqId 140354061842176 Try to find the Cloudflare verify checkbox...
2023-10-20 19:17:58 DEBUG    ReqId 140354070234880 Cloudflare verify checkbox found and clicked!
2023-10-20 19:17:58 DEBUG    ReqId 140354070234880 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:17:58 DEBUG    ReqId 140354070234880 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:18:00 DEBUG    ReqId 140354070234880 Waiting for title (attempt 5): Just a moment...
2023-10-20 19:18:01 DEBUG    ReqId 140354061842176 Cloudflare verify checkbox found and clicked!
2023-10-20 19:18:01 DEBUG    ReqId 140354061842176 Try to find the Cloudflare 'Verify you are human' button...
2023-10-20 19:18:01 DEBUG    ReqId 140354061842176 The Cloudflare 'Verify you are human' button not found on the page.
2023-10-20 19:18:01 DEBUG    ReqId 140354070234880 Timeout waiting for selector
2023-10-20 19:18:01 DEBUG    ReqId 140354070234880 Try to find the Cloudflare verify checkbox...
2023-10-20 19:18:03 DEBUG    ReqId 140354061842176 Waiting for title (attempt 6): Just a moment...
2023-10-20 19:18:04 DEBUG    ReqId 140354061842176 Timeout waiting for selector
2023-10-20 19:18:04 DEBUG    ReqId 140354061842176 Try to find the Cloudflare verify checkbox...
2023-10-20 19:18:12 ERROR    ReqId 140354087020288 Error: Error solving the challenge. Timeout after 60.0 seconds.
2023-10-20 19:18:12 DEBUG    ReqId 140354087020288 Response => POST /v1 body: {'status': 'error', 'message': 'Error: Error solving the challenge. Timeout after 60.0 seconds.', 'startTimestamp': 1697829432148, 'endTimestamp': 1697829492293, 'version': '3.3.6'}
2023-10-20 19:18:12 INFO     ReqId 140354087020288 Response in 60.145 s
2023-10-20 19:18:12 INFO     ReqId 140354087020288 127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error
2023-10-20 19:18:12 ERROR    ReqId 140354095412992 Error: Error solving the challenge. Timeout after 60.0 seconds.
2023-10-20 19:18:12 DEBUG    ReqId 140354095412992 Response => POST /v1 body: {'status': 'error', 'message': 'Error: Error solving the challenge. Timeout after 60.0 seconds.', 'startTimestamp': 1697829432148, 'endTimestamp': 1697829492299, 'version': '3.3.6'}
2023-10-20 19:18:12 INFO     ReqId 140354095412992 Response in 60.151 s
2023-10-20 19:18:12 INFO     ReqId 140354095412992 127.0.0.1 POST http://127.0.0.1:8191/v1 500 Internal Server Error

Test App

# node test.js 
Session: 440eeafe-6f7d-11ee-b8c7-000c297f36bc
Session: 440f4fda-6f7d-11ee-bc2e-000c297f36bc
Session: 440ea710-6f7d-11ee-85b2-000c297f36bc
{
  status: 'ok',
  message: 'Challenge solved!',
  solution: {
    url: 'https://www.000webhost.com/cpanel-login',
    status: 200,
    cookies: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object]
    ],
    userAgent: 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
    headers: {},
    response: '<html ...</html>'
  },
  startTimestamp: 1697829432147,
  endTimestamp: 1697829451903,
  version: '3.3.6'
}
Site opening request failed
Site opening request failed

@NabiKAZ
Copy link
Contributor

NabiKAZ commented Oct 21, 2023

It seems that you are right, I will give more explanations to clarify the issue.
I did a lot of tests.

When two requests arrive at FlareSolverr at the same time, only the second one is processed.
This problem does not exist on Windows, but on Linux CentOS 7.9, where the source was directly executed with Python 3.11, and also on Docker, which I tested, the problem is seen.
It seems that the problem occurs only when the session is set. Maybe a variable is overridden.
Using a proxy or different URLs does not affect the problem.

There is no need for anything complicated for testing, and it is enough to enter each of these two pieces of code in two separate terminals and press Enter for both at the same time.
To retest, make sure the previous sessions are killed.

Code 1:

curl -L -X POST 'http://localhost:8191/v1' \
-H 'Content-Type: application/json' \
--data '{
  "cmd": "request.get",
  "url":"https://www.000webhost.com/cpanel-login",
  "session": "11111111",
  "maxTimeout": 60000
}'

Code 2:

curl -L -X POST 'http://localhost:8191/v1' \
-H 'Content-Type: application/json' \
--data '{
  "cmd": "request.get",
  "url":"https://www.000webhost.com/cpanel-login",
  "session": "22222222",
  "maxTimeout": 60000
}'

See Video:

putty_cqDKuHZBUq_2.mp4

@NextAlex
Copy link

NextAlex commented Jan 4, 2024

Hi guys.

Got into the same issue today.

Looks like there are actually two of them:

  1. session_id = session_id or str(uuid1())

    The session id is generated as uuid1() with no arguments and may generate the same value if called in concurrent threads at the same time. Reproduced with ease when 3 scrapers are running in parallel and use one instance of dockerized flaresolverr. I would recommend to change it to uuid4().

  2. The SessionsStorage class lacks thread safety. Adding wrapt.synchronized to all methods except __init__ fixed the issue completely in docker.

Don't know why second issue is not reproduced on Windows, maybe because of the threading implementation differences for the platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants