question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can i disable puppeteer dev profile.

See original GitHub issue

Environment: Puppeteer version: 0.11.0 Platform / OS version: AWS Lambda Node.js version: 6.10

Puppeteer Arguments

puppeteer.launch({
  args: ['--disable-gpu', '--no-sandbox', '--single-process', 
             '--disable-web-security', '--disable-dev-profile']
});

Hello,

We are using puppeteer on AWS Lambda. It handles over 10 million requests every month.

When we were trying to handle concurrent requests, puppeteer returned this error:

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1383):
Error: ENOSPC: no space left on device, mkdtemp '/tmp/puppeteer_dev_profile-XXXXXX'

I tried to disable dev profile with the --disable-dev-profile argument. But it doesn’t work.

How can I do it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

32reactions
pixelportcommented, Feb 22, 2018

@jborden13

Here is my solution. The advantage of this is that you can run multiple puperteer instances in parallel. Because only the puppeteer_dev_profile of the current instance is deleted after the browser is closed.

let fs = require('fs-extra');
const puppeteer = require('puppeteer');

let browser = await puppeteer.launch();
let chromeTmpDataDir = null;

// find chrome user data dir (puppeteer_dev_profile-XXXXX) to delete it after it had been used
let chromeSpawnArgs = browser.process().spawnargs;
for (let i = 0; i < chromeSpawnArgs.length; i++) {
    if (chromeSpawnArgs[i].indexOf("--user-data-dir=") === 0) {
        chromeTmpDataDir = chromeSpawnArgs[i].replace("--user-data-dir=", "");
    }
}

// ...

browser.close();

if (chromeTmpDataDir !== null) {
    fs.removeSync(chromeTmpDataDir);
}

process.exit(0);
2reactions
jborden13commented, Jan 23, 2018

@bahattincinic can you share your code that you used to clear the /tmp folder? I’ve tried it a million different ways and still am constantly running into:

Error: ENOSPC: no space left on device, mkdtemp ‘/tmp/puppeteer_dev_profile-XXXXXX’

Read more comments on GitHub >

github_iconTop Results From Across the Web

set browser profile settings via puppeteer - node.js
1 Answer 1 · either by using the executablePath and userDataDir options on puppeteer.launch ; · or applying the --user-data-dir= chrome launch ...
Read more >
Puppeteer | Puppeteer
Puppeteer is a Node.js library which provides a high-level API to control Chrome/Chromium over the DevTools Protocol. Puppeteer runs in headless mode by ......
Read more >
Puppeteer documentation - DevDocs
Puppeteer communicates with the browser using DevTools Protocol. ... Pass 0 to disable timeout. dumpio <boolean> Whether to pipe the browser process stdout ......
Read more >
Chromium Docs - User Data Directory
The user data directory contains profile data such as history, bookmarks, ... [Chrome Dev] ~/.config/google-chrome-unstable; [Chromium] ~/.config/chromium.
Read more >
Web Scraping with a Headless Browser: A Puppeteer Tutorial
In this article, Toptal Freelance JavaScript Developer Nick Chikovani shows how easy it is to ... Puppeteer creates a temporary directory for its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found