Hamid Jutt
02/11/2026, 12:41 PMAnswer Overflow
02/11/2026, 12:41 PMMatous
02/16/2026, 9:43 AM# part is ignored) the requests are processed as single unless you set a specific uniqueKey for each request.Hamid Jutt
02/17/2026, 7:43 AMMatous
02/17/2026, 12:10 PMstorage/request_queues/default (or name/id of your RequestQueue, if you don't use default), and count the number of requests there.
- If the number is correct, uniqueKey works well, and the issue is with the processing of the requests.
- Check maxRequestPerCrawl crawler option is either not set or higher than/equal to the number of requests you have.
Note that this kind of investigation is hard for me, you should either provide the code example or do it yourself...Matous
02/17/2026, 12:10 PMHamid Jutt
02/17/2026, 4:21 PMMatous
02/17/2026, 6:34 PMMatous
02/17/2026, 7:24 PMMath.random().toString(36).substring(7); should perform well enough for 200 IDs, but it is definitely possible you won't have unique IDs
- I am not 100% but I believe your test for ADDED/SKIPPED/REJECTED requests is incorrect:
- addRequests result returns
Typescript
{
addedRequests: {
requestId
uniqueKey
wasAlreadyHandled
wasAlreadyPresent
}[],
waitForAllRequestsToBeAdded: Promise
}
- unprocessedRequests doesn't exist there
- the correct way would be to use
Typescript
const { addedRequests } = await crawler.addRequests([...], { waitForAllRequestsToBeAdded: true }); // Waits until there are no unprocessedRequets ~ all are processed
const myRequest = processedRequests.find(({ uniqueKey } => uniqueKey === requestId); // Identifies the request you have added
const myRequestWasSkipped = myRequest.wasAlreadyHandled || myRequest.wasAlreadyPresent || false; // Check for both possibilities for skipping
- you might simplify it since you are adding a single request at the time const { addedRequests: [myRequest] } = await crawler.addRequests([...]);
- I don't see any Actor.init() in your code, which might also affect the request queue
- you run your crawler before you add any requests to it -> it will stop, so unless you run it again somewhere later, your requests won't be processed
Can you check these out and find out if any of that helps?Hamid Jutt
02/18/2026, 9:28 AMconsole.log(requestId, targetUrl, "Recived in ScrapeUrl for Playwright and adding it to Queue")
try {
const result = await crawler.addRequests([{
url: targetUrl,
uniqueKey: requestId, // Now guaranteed unique
userData: { requestId, formats, targetUrl }
}], { waitForAllRequestsToBeAdded: true });
// 2. Correctly check if it was skipped (Matous's fix)
const myRequest = result.addedRequests.find((req) => req.uniqueKey === requestId);
// 3. Check if it was skipped/ignored
if (myRequest.wasAlreadyPresent || myRequest.wasAlreadyHandled) {
console.error(`⚠️ [${requestId}] Crawlee ignored this because it's a duplicate ID!`);
}
} catch (err) {
return { url: targetUrl, success: false, error: err.message };
}
I see the logs for requestId, targetUrl, "Received in ScrapeUrl for Playwright and adding it to Queue. But I never received the error in the console. Means it is added to the queue.
I also test to log in preNavigationHooks
export const crawler = new PlaywrightCrawler({
keepAlive: true,
maxRequestRetries: 1,
maxSessionRotations: 1,
maxRequestsPerCrawl: 999999,
maxConcurrency: 12,
preNavigationHooks: [
async ({ request }) => {
const { requestId } = request.userData;
console.log(`🚀 [${requestId}] START PlaywrightCrawler for ${request.url}`);
}
],..
But not log it in console, which means the request does not reach the preNavigationHooks. It logs it [Example-ID] START PlaywrightCrawler for https://example.com for other requests, but not for 1-5 requests, which are skipped.Matous
02/18/2026, 10:24 AMstorage/request_queues/default) as I mentioned before.
Now, the problem is that the crawler is not processing them.
For this case, check the previous suggestions I gave:
- You run your crawler before you add any requests to it -> it will stop, so unless you run it again somewhere later, your requests won't be processed
- I would encourage you to check whether the crawler is running when you add your requests, and if not, just run it
- I don't see any Actor.init() in your code, which might also affect the request queueHamid Jutt
02/18/2026, 2:41 PMYou run your crawler before you add any requests to it -> it will stop, so unless you run it again somewhere later, your requests won't be processed but I am using keepAlive: true, so I think it will work, because it works for many, only some skipped 1-5.Hamid Jutt
02/18/2026, 4:06 PMconst config = new Configuration({
persistStorage: false
});
But because you told me to check storage/request_queues/default, I changed
const config = new Configuration({
persistStorage: true
});
And i run it, I added 20-30 requests via api. and see error
ERROR PlaywrightCrawler:AutoscaledPool: isTaskReadyFunction failed
ENOENT: no such file or directory, mkdir '/home/hamid/my-crawler/storage/request_queues/default/qbSdxrYxpXwh2WZ.json.lock'
Crawler Crash: [Error: ENOENT: no such file or directory, mkdir '/home/hamid/my-crawler/storage/request_queues/default/qbSdxrYxpXwh2WZ.json.lock'] {
errno: -2,
code: 'ENOENT',
syscall: 'mkdir',
path: '/home/hamid/my-crawler/storage/request_queues/default/qbSdxrYxpXwh2WZ.json.lock'
}
Than i check with few requests like 4 than it works.Matous
02/18/2026, 4:25 PMApifyBot
02/19/2026, 3:39 PMMatous
02/20/2026, 10:00 AMtrue I get both request processed, if it is false, they are not.
Typescript
// Crawlee - web scraping and browser automation library (Read more at https://crawlee.dev)
import { CheerioCrawler } from '@crawlee/cheerio';
// Apify SDK - toolkit for building Apify Actors (Read more at https://docs.apify.com/sdk/js/)
import { Actor } from 'apify';
const WAIT = true;
// The init() call configures the Actor to correctly work with the Apify-provided environment - mainly the storage infrastructure. It is necessary that every Actor performs an init() call.
await Actor.init();
const proxyConfiguration = await Actor.createProxyConfiguration({ checkAccess: true });
const crawler = new CheerioCrawler({
proxyConfiguration,
requestHandler: async ({ request, log }) => {
log.info(`Processing ${request.url}...`);
},
keepAlive: true,
});
const crawlerPromise = crawler.run();
await crawler.addRequests([
{
url: 'https://www.example.com',
},
]);
await crawler.addRequests([
{
url: 'https://www.apify.com',
},
]);
if (WAIT) {
await new Promise((resolve) => {
setTimeout(resolve, 5000);
});
}
crawler.stop();
await crawlerPromise;
// Gracefully exit the Actor process. It's recommended to quit all Actors with an exit()
await Actor.exit();Hamid Jutt
02/20/2026, 12:49 PMapp.get('/scrape/status', async (req, res) => {
try {
const playwrightQueueInstance = await crawler.getRequestQueue();
const info = await playwrightQueueInstance.getInfo();
const all_pending_Requests_in_db = await playwrightQueueInstance.client.listHead({ limit: 1000 });
const crawleeIds = all_pending_Requests_in_db.items.map(i => i.userData.requestId);
const statusReport = {
timestamp: new Date().toLocaleTimeString(),
local_trackers: {
total_ever_received: allRequests.size,
currently_waiting_for_n8n: requestsNotCompleted.size,
stuck_request_ids: Array.from(requestsNotCompletedYetWaitingOrStuck),
},
playwright_crawler_db: {
total_added: info.totalRequestCount,
waiting_in_line: info.pendingRequestCount,
finished_successfully: info.handledRequestCount,
isFinished: await playwrightQueueInstance.isFinished()
},
engine_realtime: {
active_browsers: crawler.autoscaledPool?.currentConcurrency || 0,
is_system_overloaded: crawler.autoscaledPool?.isOverloaded || false
},
bridge: {
ids_added_but_not_in_db: Array.from(requestsNotCompleted).filter(id => !crawleeIds.includes(id)),
}
};
res.json(statusReport);
} catch (err) {
res.status(500).json({ error: "Failed to fetch status", details: err.message });
}
});
app.post('/scrape/status/id', async(req, res)=>{
const { id } = req.body;
try{
const playwrightQueueInstance = await crawler.getRequestQueue();
const data = await playwrightQueueInstance.getRequest(id);
res.json(data)
}catch (err) {
res.status(500).json({ error: err.message });
}
})Hamid Jutt
02/20/2026, 12:49 PM{
"timestamp": "5:31:09 PM",
"local_trackers": {
"total_ever_received": 140,
"currently_waiting_for_n8n": 1,
"stuck_request_ids": [
"1771590123519-g6pzw"
]
},
"playwright_crawler_db": {
"total_added": 140,
"waiting_in_line": 0,
"finished_successfully": 140,
"isFinished": true
},
"engine_realtime": {
"active_browsers": 0,
"is_system_overloaded": false
},
"bridge": {
"ids_added_but_not_in_db": [
"1771590123519-g6pzw"
]
}
}
You can see the total received (from api) 140, and in the queue it is also 140 "total_added": 140, means all
added, and
"finished_successfully": 140,
"isFinished": true
But there are 1 request that never started and never returned, see stuck_request_ids and ids_added_but_not_in_db. this the the request.Hamid Jutt
02/20/2026, 12:51 PM[
{
"id": "7b1axeNlZsOzMn7",
"url": "https://carbonrepro.com/digital-marketing/seo-services/",
"uniqueKey": "1771590123519-g6pzw",
"method": "GET",
"noRetry": false,
"retryCount": 0,
"errorMessages": [],
"headers": {},
"userData": {
"requestId": "1771590123519-g6pzw",
"formats": [
"emails"
],
"targetUrl": "https://carbonrepro.com/digital-marketing/seo-services/",
"__crawlee": {
"state": 3
}
},
"handledAt": "2026-02-20T12:22:26.437Z"
}
]Hamid Jutt
02/20/2026, 12:53 PMMatous
02/21/2026, 9:23 AMstuck_request_ids and ids_added_but_not_in_db since I don't know where they come from (what are requestsNotCompletedYetWaitingOrStuck and requestsNotCompleted?)
But In the final request you get in the end has handledAt field, so I would think, the request was already handled.Hamid Jutt
02/21/2026, 9:58 AMMatous
02/21/2026, 10:30 AMHamid Jutt
02/22/2026, 8:15 AMHamid Jutt
02/23/2026, 12:17 PMMatous
02/26/2026, 10:16 AMAnswer Overflow
02/26/2026, 10:17 AMHamid Jutt
02/26/2026, 12:16 PM