Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python script run in docker with error:ERROR:headless_shell.cc(434)] Abnormal renderer termination. #83

Open
taroyutao opened this issue Oct 26, 2022 · 0 comments

Comments

@taroyutao
Copy link

DockerFile:
`
FROM python:3.7
EXPOSE 9567
WORKDIR /app
COPY . /app

RUN echo "Acquire::Check-Valid-Until "false";\nAcquire::Check-Date "false";" | cat > /etc/apt/apt.conf.d/10no--check-valid-until
RUN sed -i 's|security.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list
RUN sed -i 's#http://deb.debian.org#https://mirrors.163.com#g' /etc/apt/sources.list

RUN apt-get clean
RUN apt-get update -y && apt-get install -y icc-profiles-free
RUN apt-get update -y && apt-get install -y chromium

RUN echo 'export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --no-sandbox --disable-gpu"' >> /etc/chromium.d/default-flags

RUN echo " \n =============HTML2IMAGE============= \n Welcome to the html2image CLI container ! \n Type html2image -h for help :)" >> /etc/motd
RUN echo "clear" >> /root/.bashrc
RUN echo "cat /etc/motd" >> /root/.bashrc

RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install -r requirements.txt
`

requirements.txt
`
Pillow

pytest

html2image
`

python script

`
from html2image import Html2Image
hti = Html2Image(custom_flags=['--no-sandbox','--disable-gpu', '--disable-software-rasterizer'])
hti.screenshot(url='http://www.python.org', save_as='python_org.png', size = (1500, 13000))

`

error info:

image

[1026/042946.265913:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1026/042946.266046:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[1026/042946.268083:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[1026/042946.271534:ERROR:gpu_init.cc(521)] Passthrough is not supported, GL is disabled, ANGLE is
[1026/043157.712559:ERROR:headless_shell.cc(434)] Abnormal renderer termination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant