Processing-java hanging in headless VM

Hello there!

I’m running Processing in a fairly esoteric environment, and trying to figure out why it isn’t running.

For context; I’ve got a simple Processing program (though this is reproducible even with a blank/minimal sketchbook) that just writes an image out to a file. It works when I run it locally, it works when I run it in a Docker environment (headless, roughly following these instructions), but it doesn’t work in a small headless VM that closely resembles the Docker container.

The VM environment is just a minimal Linux kernel with all the same libraries installed as the (functional) Docker container. I assume I’m breaking some invariant about Processing’s expected runtime, but I don’t know where to begin debugging because processing-java doesn’t crash, it just hangs indefinitely. No print statements from my sketchbook are executed or anything.

The invocation is:

xvfb-run /processing/processing-4.1.2/processing-java --sketch=/path/to/sketch --run <some args>

And this runs fine on my laptop and in the Docker container. Any ideas?

Thanks in advance!

An update: Could it be that processing-java is expecting to have internet access? The VM in question does not have a path to the internet.

Another update: I ran strace to check for network traffic with:

strace -f -e trace=network -s 10000 ./processing-java --sketch=/path/to/sketch --run > strace.log 2>&1

And there’s a ton of network stuff going on. Is there anyway to run Processing in an environment with no network?

hi,

i guess the problem is headless rather than lack of network, even by default (no size() set) processing set a graphic window.
on headless linux you can add a fake screen like xvfb ( i think i used this one years ago with same problem)

I was experiencing this issue even with Xvfb, and it worked fine in the Docker container (with Xvfb). The issue went away when I added a network interface to the VM. Not sure why that made a difference, but it no longer hangs, so I’m happy!

Processing’s IDE (PDE) requires a local network in order to communicate w/ a sketch app.