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

[Bug]: generate defunct headless_shell #34230

Closed
markruler opened this issue Jan 7, 2025 · 3 comments
Closed

[Bug]: generate defunct headless_shell #34230

markruler opened this issue Jan 7, 2025 · 3 comments

Comments

@markruler
Copy link

Version

1.49.0

Steps to reproduce

  1. Clone my repo at https://github.com/markruler/htmltopdf
  2. make docker-build
  3. make docker-run
  4. curl "http://localhost:5000/pdf/url?url=https://www.google.com"

Expected behavior

I expected that no zombie processes would remain.

Actual behavior

Below is a video of testing after creating a new Ubuntu 24.04.1 instance on AWS EC2. This issue can always be reproduced.

Screencast.from.2025.01.07.15.18.47.webm

Additional context

There is no issue when running without Docker.

python -m venv .venv
source .venv/bin/activate
pip install --no-cache-dir --upgrade -r requirements.txt
playwright install --with-deps chromium
nohup .venv/bin/uvicorn htmltopdf:app --host=0.0.0.0 --port=5000 > /dev/null 2>&1 &

Environment

It does not seem to be affected by the system. The issue is reproducible across multiple versions, including the latest kernel version.

System:
  OS: Ubuntu 24.04.1 (6.8.0-1018-aws) (Docker 27.4.1)
    + Ubuntu 22.04.5 (5.15.0-125-generic, Docker 27.4.1)
    + CentOS 7 (3.10.0-1160.119.1.el7.x86_64, Docker 26.1.4)
  CPU: x86_64
Dependency:
  Docker -> FastAPI -> Playwright
@Skn0tt
Copy link
Member

Skn0tt commented Jan 7, 2025

Hi! The issue tracker is reserved for bug reports and feature requests. For anything else, such as questions or getting help, please see:

If you believe there's a bug within Playwright, please provide a more minimal reproduction case. Try removing the server aspects from this, and reproduce it with a plain script that doesn't use FastAPI.

@mxschmitt
Copy link
Member

mxschmitt commented Jan 7, 2025

Make sure to use an init manager when using Docker, see our docs here. Otherwise it ends up in defunct processes. Thats a known issue Docker has. We should probably move it from ci.md to docker.md to make it easier to spot.

So you put init: true in your docker-compose.yml and then it should work.

@markruler
Copy link
Author

Make sure to use an init manager when using Docker, see our docs here. Otherwise it ends up in defunct processes. Thats a known issue Docker has. We should probably move it from ci.md to docker.md to make it easier to spot.

So you put init: true in your docker-compose.yml and then it should work.

This works for me, thanks!

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

3 participants