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.

failed to create directory via template ‘/tmp/chrome.XXXXXXX’: No space left on device

See original GitHub issue

Deployed, everything worked – but after some time I am seeing this:

@serverless-chrome/lambda: Error trying to spawn chrome: { Error: Command failed: mktemp -d -t chrome.XXXXXXX
mktemp: failed to create directory via template ‘/tmp/chrome.XXXXXXX’: No space left on device

at checkExecSyncError (child_process.js:481:13)
at Object.execSync (child_process.js:521:13)
at makeTempDir (/var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:39:24)
at Launcher.prepare (/var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:108:52)
at /var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:246:16
at throw (native)
at step (/var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:69:193)
at /var/task/node_modules/@serverless-chrome/lambda/dist/bundle.cjs.js:69:404
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
error: null,
cmd: 'mktemp -d -t chrome.XXXXXXX',
file: '/bin/sh',
args: [ '/bin/sh', '-c', 'mktemp -d -t chrome.XXXXXXX' ],
options: 
{ shell: true,
file: '/bin/sh',
args: [ '/bin/sh', '-c', 'mktemp -d -t chrome.XXXXXXX' ],

Looks like some cleanup is not happening?

(The lambda is kept warm by frequent usage)

"@serverless-chrome/lambda@1.0.0-53":
  version "1.0.0-53"

EDIT: Hmm, I do see there is code that should perform that cleanup, but I guess something prevents it from being reached.

Random idea: rm -rf /tmp/chrome.??????? on startup? (instead of at the end of the lambda invocation)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

5reactions
2803mediacommented, Dec 19, 2018

Thanks @emilburzo for this info, Yesterday I added this to my function, I hope it will temporary solve this problem:

'use strict';
const puppeteer = require('puppeteer');

const exec = require('child_process').exec;

module.exports.index = async (event, context) => {
  
  exec('rm -r /tmp/core.* || true', function(err,stdout,stderr){     
   if(err)
   console.log('Directory Empty', err);
   else
   console.log("Files Deleted");
  });
  
  // some code

}
0reactions
CarolynWebstercommented, Oct 8, 2019

I ran into this issue as well after months of use. The above code from 2803media worked locally - so I will try it deployed and hopefully it will keep this issue at bay.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mktemp: failed to create file via template '/tmp ... - LinuXamination
mktemp: failed to create file via template '/tmp/tmp.XXXXXXXXXX': No space left on device. Not able to create new files, Not able to restart ......
Read more >
mkdir throws No space left on device , while creating a large ...
Sometimes that can be caused by the b-tree used by ext4 as directory index hitting its height limit. If you get the No...
Read more >
message: unknown error: cannot create default profile directory ...
I am using selenium with python, and I'm trying to use some arguments for starting the chromedriver. from selenium import webdriver from selenium.webdriver....
Read more >
install_youtubeadblock_net_sfx.exe - Hybrid Analysis
Overview Sample unavailable. Downloads ... Creates a writable file in a temporary directory ... Opens the Kernel Security Device Driver (KsecDD) of Windows....
Read more >
Trojan.Win32.IEDummy_81f852054d - Lavasoft - Adaware
The Trojan creates and/or writes to the following file(s):. %Documents and Settings%\%current user%\Local Settings\Temp\CR_B4D70.tmp\CHROME.
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