[Bug]: Error: Failed to launch the browser process! TROUBLESHOOTING
Closed this issue · 7 comments
What happened?
I try to install inside server but have this problem
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: AlmaLinux
Description: AlmaLinux release 8.10 (Cerulean Leopard)
Release: 8.10
Codename: CeruleanLeopard
How to reproduce the bug
AFter install npm i puppeteer , try to generate pdf but this error comes in .
Package Version
1.5
PHP Version
8.2
Laravel Version
11
Which operating systems does with happen with?
No response
Notes
I know this is puppeteer error . but I dont know how to setup this on my Almalinux server ,
any change anyone has solve this problem ?
After installing in server got this error
Error Output:
Error: Failed to launch the browser process!
chrome_crashpad_handler: --database is required
Try 'chrome_crashpad_handler --help' for more information.
[10515:10515:0906/115020.156361:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)
I am experiencing the same issue. It works perfectly on my local environment, but when deployed to the server, the error occurs. I need to resolve this as soon as possible. Any suggestions or workarounds would be greatly appreciated.
I am experiencing the same issue. It works perfectly on my local environment, but when deployed to the server, the error occurs. I need to resolve this as soon as possible. Any suggestions or workarounds would be greatly appreciated.
mind to share your server specs ? what os you use etc.
I think in ubuntu os should be no hassle to setup .
I'm using ECS (Elastic Container Service) in my environment, so it's running on containers, not directly on Ubuntu. Also, I'll attach the Dockerfile for reference.
FROM php:8.3-fpm-alpine
SHELL ["/bin/ash", "-oeux", "pipefail", "-c"]
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /composer
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD 1
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
WORKDIR /var/www/app
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer
RUN apk update && \
apk add --update --no-cache --virtual=.build-deps \
autoconf \
gcc \
g++ \
make \
tzdata && \
apk add --update --no-cache \
icu-dev \
libzip-dev \
oniguruma-dev \
mysql-client && \
cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime && \
echo Asia/Tokyo > /etc/timezone && \
apk del .build-deps && \
docker-php-ext-install exif intl pdo_mysql mbstring zip bcmath opcache && \
composer config -g process-timeout 3600 && \
composer config -g repos.packagist composer https://packagist.org
# Install Puppeteer
RUN apk add --no-cache \
chromium \
nss \
freetype \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
npm \
yarn
COPY ./src /var/www/app
# Laravel deploy-ing
RUN composer install --optimize-autoloader --ignore-platform-reqs --no-dev && \
php artisan view:clear && \
php artisan config:clear && \
php artisan route:cache && \
chmod -R 777 storage && \
yarn install
# Config
COPY ./php.ini /usr/local/etc/php
COPY ./crontab /var/spool/cron/crontabs/root
COPY ./start.sh /start.sh
VOLUME /var/www/app
CMD ["sh", "/start.sh"]
After installing in server got this error
Error Output:
Error: Failed to launch the browser process! chrome_crashpad_handler: --database is required Try 'chrome_crashpad_handler --help' for more information. [10515:10515:0906/115020.156361:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)
I am able to solve this issue by adding
->withBrowsershot(function (Browsershot $broadcast) { $broadcast->setEnvironmentOptions([ 'CHROME_CONFIG_HOME' => storage_path('app/chrome/.config'), ]); })
After installing in server got this error
Error Output:
Error: Failed to launch the browser process! chrome_crashpad_handler: --database is required Try 'chrome_crashpad_handler --help' for more information. [10515:10515:0906/115020.156361:ERROR:socket.cc(120)] recvmsg: Connection reset by peer (104)
I am able to solve this issue by adding
->withBrowsershot(function (Browsershot $broadcast) { $broadcast->setEnvironmentOptions([ 'CHROME_CONFIG_HOME' => storage_path('app/chrome/.config'), ]); })
what did you put inside file .config ?
you create those file manually right ?