Report this

What is the reason for this report?

App platform worker hangs, sometimes giving exit code 12

Posted on March 17, 2025

We have a Laravel queue worker that is running fine most of the time, however sometimes it hangs. It doesn’t pick up new jobs, and it’s not responsive at all also not possible to login via Console to have a look at what’s happening. The CPU and Memory insights are low, on usual levels. Also it can’t really be something in the queue jobs, it always seems to finish the queue job at hand but simply doesn’t pick up a new one.

We might have to rework our application architecture to accommodate this, but first this question:

In the crash logs (via doctl apps logs <ID> --type=run-restarted) we sometimes do see container exited with exit code 12. I searched but can’t figure out what this exit code 12 means.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi Jan,

looking at the source code of the Laravel Worker here: https://github.com/laravel/framework/blob/12.x/src/Illuminate/Queue/Worker.php#L308 it returns the constant EXIT_MEMORY_LIMIT (with a value of 12) it the worker has exceeded the memory limit.

When running the php artisan queue:work command you can specify a memory limit with the --memory parameter:

--memory[=MEMORY]      The memory limit in megabytes [default: "128"]

Try setting this to a higher value, like 256.

Hope this helps.

Daniel, Founder of Deckrun

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.