Question

App platform worker hangs, sometimes giving exit code 12

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.


Submit an answer


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!

Sign In or Sign Up to Answer

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

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

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.