RuntimeError: can't start new thread

I run ERPNext in docker, using the custom setup.

I built a docker image on one machine, containing frappe, ERPNext, notforprofit and payments apps.

This runs fine on that machine.

I saved the docker image using docker save, and transferred it to a different machine.

I started the same containers on the new machine. All the queue containers and websocket kept failing with RuntimeError: can't start new thread.

Anyone know what might be causing this?

This could be because of 2 reason
1 : your stack memory is full for that process/thread (high this should be the case if u are using any library which create pseudo thread)
2 : you may have reached to the OS level thread limit