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
Comments
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 You will get output like this after each call to
Now you need to send the |
I'm quite sure I did send the session ID. Have you actually tried to
reproduce the behaviour I described?
…On Tue, Oct 17, 2023, 19:01 Nabi KaramAliZadeh ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#896 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABLHZEB5YLGUHUF33FYOHULX722WFAVCNFSM6AAAAAA4RS76M6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRWHAZDCMZWGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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. 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 meimport 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
LOG Test App:Click me
|
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:
Flaresolverr
Test App
|
It seems that you are right, I will give more explanations to clarify the issue. When two requests arrive at FlareSolverr at the same time, only the second one is processed. 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. Code 1:
Code 2:
See Video: putty_cqDKuHZBUq_2.mp4 |
Hi guys. Got into the same issue today. Looks like there are actually two of them:
Don't know why second issue is not reproduced on Windows, maybe because of the threading implementation differences for the platform. |
Have you checked our README?
Have you followed our Troubleshooting?
Is there already an issue for your problem?
Have you checked the discussions?
Environment
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
Screenshots
No response
The text was updated successfully, but these errors were encountered: