Python kernel crashing with 502 Bad Gateway in Jupyter Docker(only on one particular VM) – R/JULIA kernels work fine

Hi all,

I’m an SRE working in a data company and I’ve been stuck on a very strange issue for days.

When I click Python kernel:

-> I get “502 Bad Gateway”
→ container restarts automatically (restart policy is enabled)
→ logs show container exit and restart loop

But the same setup is working fine in all the other vms. Only this particular vm is having this issue. Tried restarting the vm and everything but doesnt seem to work. Also the particular issue arises when clicked only on python kernel. other R, JULIA kernels work fine.

Feels like something VM-level (cgroups / memory / kernel / docker runtime?) but I can’t pinpoint it.

We are running Jupyter using Docker:

image:
jupyter/datascience-notebook:x86_64-python-3.11.6

docker-compose:

version: "3.9"

services:
notebook:
image: jupyter/datascience-notebook:x86_64-python-3.11.6
container_name: jupyter-notebook

ports:
- "4444:8888"

volumes:
- ./:/home/jovyan/work

environment:
- JUPYTER_TOKEN=****

restart: unless-stopped