Rogue_Ram
Rogue_Ram
RRailway
Created by Rogue_Ram on 5/14/2023 in #✋|help
Issues with Puppeteer
I'm using a package that internally uses puppeteer to convert markdown to a pdf, ive tried everything i can think of but i end up getting this error:
Error: Failed to launch the browser process!
[0514/033840.383516:ERROR:zygote_host_impl_linux.cc(100)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
TROUBLESHOOTING: https://pptr.dev/troubleshooting
at Interface.onClose (/app/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262:24)
at Interface.emit (node:events:525:35)
at Interface.close (node:readline:590:8)
at Socket.onend (node:readline:280:10)
at Socket.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: Failed to launch the browser process!
[0514/033840.383516:ERROR:zygote_host_impl_linux.cc(100)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
TROUBLESHOOTING: https://pptr.dev/troubleshooting
at Interface.onClose (/app/node_modules/@puppeteer/browsers/lib/cjs/launch.js:262:24)
at Interface.emit (node:events:525:35)
at Interface.close (node:readline:590:8)
at Socket.onend (node:readline:280:10)
at Socket.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Which means the project is being ran as root, but puppeteer doesn't support that. I've also tried specifying in the launch options --no-sandbox:
const pdf = await mdToPdf({
content: markdownText,
pdf_options: {
margin: {
top: "0px"
}
},
launch_options: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
executablePath: 'chromium-browser'
}
}, { as_buffer: true });
const pdf = await mdToPdf({
content: markdownText,
pdf_options: {
margin: {
top: "0px"
}
},
launch_options: {
args: ['--no-sandbox', '--disable-setuid-sandbox'],
executablePath: 'chromium-browser'
}
}, { as_buffer: true });
Since its working locally im pretty sure the only issue is that the project is ran as root, and i was wondering if it was possible to fix this error? I can't seem to find a good way to convert markdown to a PDF without puppeteer, most packages on npm use it internally.
25 replies
RRailway
Created by Rogue_Ram on 5/13/2023 in #✋|help
Builds are failing for no reason
16 replies
RRailway
Created by Rogue_Ram on 5/12/2023 in #✋|help
Issue with packages/deploying
I can build and start the project fine locally, however when trying to deploy on railway I run into a error. I know that I am using a deprecated package however a package I'm using requires it and as I said it works locally. Here is the error
#12 19.29 npm ERR! code 1
#12 19.29 npm ERR! path /app/node_modules/phantomjs-prebuilt

#12 19.29 npm ERR! command failed
#12 19.29 npm ERR! command sh -c -- node install.js
#12 19.29 npm ERR! PhantomJS not found on PATH
#12 19.29 npm ERR! Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! Receiving...
#12 19.29 npm ERR!
#12 19.29 npm ERR! Received 22866K total.
#12 19.29 npm ERR! Extracting tar contents (via spawned process)
#12 19.29 npm ERR! Error extracting archive
#12 19.29 npm ERR! Phantom installation failed Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! tar (child): bzip2: Cannot exec: No such file or directory
#12 19.29 npm ERR! tar (child): Error is not recoverable: exiting now
#12 19.29 npm ERR! tar: Child returned status 2
#12 19.29 npm ERR! tar: Error is not recoverable: exiting now
#12 19.29 npm ERR!
#12 19.29 npm ERR! at ChildProcess.exithandler (node:child_process:402:12)
#12 19.29 npm ERR! at ChildProcess.emit (node:events:513:28)
#12 19.29 npm ERR! at maybeClose (node:internal/child_process:1100:16)
#12 19.29 npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
#12 19.29 npm ERR! code: 2,

#12 19.29 npm ERR! killed: false,
#12 19.29 npm ERR! signal: null,
#12 19.29 npm ERR! cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2'
#12 19.29 npm ERR! } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! tar (child): bzip2: Cannot exec: No such file or directory
#12 19.29 npm ERR! tar (child): Error is not recoverable: exiting now
#12 19.29 npm ERR! tar: Child returned status 2
#12 19.29 npm ERR! tar: Error is not recoverable: exiting now
#12 19.29 npm ERR!
#12 19.29 npm ERR! at ChildProcess.exithandler (node:child_process:402:12)
#12 19.29 npm ERR! at ChildProcess.emit (node:events:513:28)
#12 19.29 npm ERR! at maybeClose (node:internal/child_process:1100:16)
#12 19.29 npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
#12 19.29
#12 19.29 npm ERR! A complete log of this run can be found in:
#12 19.29 npm ERR! /root/.npm/_logs/2023-05-12T02_32_42_668Z-debug-0.log
#12 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
#12 19.29 npm ERR! code 1
#12 19.29 npm ERR! path /app/node_modules/phantomjs-prebuilt

#12 19.29 npm ERR! command failed
#12 19.29 npm ERR! command sh -c -- node install.js
#12 19.29 npm ERR! PhantomJS not found on PATH
#12 19.29 npm ERR! Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! Saving to /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! Receiving...
#12 19.29 npm ERR!
#12 19.29 npm ERR! Received 22866K total.
#12 19.29 npm ERR! Extracting tar contents (via spawned process)
#12 19.29 npm ERR! Error extracting archive
#12 19.29 npm ERR! Phantom installation failed Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! tar (child): bzip2: Cannot exec: No such file or directory
#12 19.29 npm ERR! tar (child): Error is not recoverable: exiting now
#12 19.29 npm ERR! tar: Child returned status 2
#12 19.29 npm ERR! tar: Error is not recoverable: exiting now
#12 19.29 npm ERR!
#12 19.29 npm ERR! at ChildProcess.exithandler (node:child_process:402:12)
#12 19.29 npm ERR! at ChildProcess.emit (node:events:513:28)
#12 19.29 npm ERR! at maybeClose (node:internal/child_process:1100:16)
#12 19.29 npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
#12 19.29 npm ERR! code: 2,

#12 19.29 npm ERR! killed: false,
#12 19.29 npm ERR! signal: null,
#12 19.29 npm ERR! cmd: 'tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2'
#12 19.29 npm ERR! } Error: Command failed: tar jxf /tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2
#12 19.29 npm ERR! tar (child): bzip2: Cannot exec: No such file or directory
#12 19.29 npm ERR! tar (child): Error is not recoverable: exiting now
#12 19.29 npm ERR! tar: Child returned status 2
#12 19.29 npm ERR! tar: Error is not recoverable: exiting now
#12 19.29 npm ERR!
#12 19.29 npm ERR! at ChildProcess.exithandler (node:child_process:402:12)
#12 19.29 npm ERR! at ChildProcess.emit (node:events:513:28)
#12 19.29 npm ERR! at maybeClose (node:internal/child_process:1100:16)
#12 19.29 npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
#12 19.29
#12 19.29 npm ERR! A complete log of this run can be found in:
#12 19.29 npm ERR! /root/.npm/_logs/2023-05-12T02_32_42_668Z-debug-0.log
#12 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
project id: 6dd7933f-9582-4303-b591-7060ba6cf2f3
7 replies
RRailway
Created by Rogue_Ram on 3/9/2023 in #✋|help
Can't install dependencies as needed
I need to install dependencies with --legacy-peer-deps but cannot get anything working in railway to do that, I've tried using docs and making a nix.yml file etc.
6 replies
RRailway
Created by Rogue_Ram on 1/5/2023 in #✋|help
Deployment Failed during build process
I see the error 'Deployment Failed during build process' with no logs whatsoever, the project starts fine locally. It is a express server (node.js). Anyone know what the issue is?
40 replies