[BUG] EROFS: read-only file system, mkdir '/opt/fonts/.fonts'
See original GitHub issueEnvironment
chrome-aws-lambda
Version: 5.5.0puppeteer
/puppeteer-core
Version: 5.5.0- OS: Linux
- Node.js Version: 12.x
- Lambda / GCF Runtime:
nodejs12.x
Expected Behavior
Using font
should load the font
Current Behavior
AWS Lambda throws an error
"EROFS: read-only file system, mkdir '/opt/fonts/.fonts'"
Steps to Reproduce
const chromium = require('chrome-aws-lambda');
exports.handler = async (event, context, callback) => {
let result = null;
let browser = null;
try {
browser = await chromium.puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath,
headless: chromium.headless,
ignoreHTTPSErrors: true,
});
await chromium.font('./fonts/Arial.ttf'); // Or any valid URL with a font in it
let page = await browser.newPage();
await page.goto(event.url || 'https://example.com');
result = await page.title();
} catch (error) {
return callback(error);
} finally {
if (browser !== null) {
await browser.close();
}
}
return callback(null, result);
};
Possible Solution
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
NPM Error : Error: EROFS: read-only file system, mkdir '/npm'
The error means that you have no permission to install anything with npm at the path /npm . To verify this run npm...
Read more >erofs: read-only file system, mkdir '/var/task/tmp' aws - You.com
The error seems self-explanatory: Error: EROFS: read-only file system, open '/var/task/assets/docs.zip'. /var/task is where your Lambda ... Favicon for ...
Read more >How to fix "sudo: unable to open ... Read-only file system"?
Check if you have any faulty hardware.I got this error due to a hardisk loosening. Ran mount -o remount,rw / and it worked...
Read more >How Do I Fix the "Read-only file system" Error When I Delete a ...
When you delete or modify a file on a Linux ECS, the message Read-only file system is displayed.The possible causes are as follows:The...
Read more >"Read-only file system" when I try to touch in Mac OS Catalina
Copied directly from Apple KB - About the read-only system volume in macOS Catalina*. TL:DR With macOS Catalina, you can no longer store ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@QAnders Apologies for only now getting to this. A few pointers:
$HOME/.fonts/
(as it is usually in any other POSIX system).$HOME
is not set, and because it needs to be writable, it’s set to/tmp
by this package.font()
with absolute paths (I will add this note to the README)./tmp/aws/.fonts
and/tmp/.fonts
./opt/.fonts
in the fontconfig, which will make provisioning fonts via Layers easier.