Paul
Paul
RRailway
Created by Paul on 2/20/2024 in #✋|help
Forest Admin connection with PostgresSQL failed
I've a postgres db hosted on railway. I'm trying to access the data from my admin panel ( forestadmin ) and it refuses to access the database. The credentials are the same between the two. Do you have any idea why I cannot access the database? project-id: 245b1448-066b-4ded-9cac-b414f50b53fc
3 replies
RRailway
Created by Paul on 1/17/2024 in #✋|help
puppeteer: Failed to launch the browser process!
Hi, i am using puppeteer to create PDF from HTML. The goal is to generate invoices & quotes from an html page. The API works fine, but every time i'm trying to create a PDF i encounter the following error:
[Nest] 19 - 01/17/2024, 2:55:55 PM ERROR [ExceptionsHandler] Failed to launch the browser process!

/home/node/.cache/puppeteer/chrome/linux-119.0.6045.105/chrome-linux64/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at Interface.onClose (/usr/src/app/node_modules/@puppeteer/browsers/lib/cjs/launch.js:277:24)
at Interface.emit (node:events:529:35)
at Interface.emit (node:domain:489:12)
at Interface.close (node:internal/readline/interface:534:10)
at Socket.onend (node:internal/readline/interface:260:10)
at Socket.emit (node:events:529:35)
at Socket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1400:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[Nest] 19 - 01/17/2024, 2:55:55 PM ERROR [ExceptionsHandler] Failed to launch the browser process!

/home/node/.cache/puppeteer/chrome/linux-119.0.6045.105/chrome-linux64/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at Interface.onClose (/usr/src/app/node_modules/@puppeteer/browsers/lib/cjs/launch.js:277:24)
at Interface.emit (node:events:529:35)
at Interface.emit (node:domain:489:12)
at Interface.close (node:internal/readline/interface:534:10)
at Socket.onend (node:internal/readline/interface:260:10)
at Socket.emit (node:events:529:35)
at Socket.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1400:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
And the only related code in my project is
import * as puppeteer from 'puppeteer';

const defaultOptions = {
format: 'A4',
printBackground: true,
} as puppeteer.PDFOptions;

export class PDFService {
constructor() {}

async pageToBuffer(path: string, options = defaultOptions) {
const browser = await puppeteer.launch({
headless: 'new',
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
],
});

const page = await browser.newPage();
await page.goto(`${process.env.API_URL}/${path}`, {
waitUntil: 'networkidle0',
});
const pdf = await page.pdf(options);
await browser.close();
return pdf;
}
}
import * as puppeteer from 'puppeteer';

const defaultOptions = {
format: 'A4',
printBackground: true,
} as puppeteer.PDFOptions;

export class PDFService {
constructor() {}

async pageToBuffer(path: string, options = defaultOptions) {
const browser = await puppeteer.launch({
headless: 'new',
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
],
});

const page = await browser.newPage();
await page.goto(`${process.env.API_URL}/${path}`, {
waitUntil: 'networkidle0',
});
const pdf = await page.pdf(options);
await browser.close();
return pdf;
}
}
I'm using Nest.js. Thanks in advance project id: 245b1448-066b-4ded-9cac-b414f50b53fc
10 replies