Why Does Passenger Keep Passenger-Error-*. Html Files in /Tmp?

A disk on one of our servers was filling up. Analysis showed that most of the space was wasted in /tmp.

The culprit was the 25,000+ files there that were taking up more than 3 gigs, all of them named after the pattern passenger-error-xxxxxx.html. A quick inspection showed that this was the standard error page Passenger serves when it cannot start an application.

From the message in one of those files, Passenger could not start the application because mysql2 gem was missing and it couldn't connect to the database.

From a rough estimate, it seems as if Passenger kept these files at least for each request which was due to health checks from ELB (request every 30 seconds = 2880reqs/day, Gemfile was fixed after 5 days which should be less than 15,000reqs).

Is it documented anywhere that Passenger keeps these HTML files in /tmp?

Why does it do that? Is something wrong with our config?

2 Answers

Passenger author here. Passenger creates such a file every time it fails to spawn a process, for the purpose of allowing administrators to diagnose the problem. Passenger writes an entry to the log file saying something like "Passenger failed to spawn a process, look in /tmp/passenger-error-xxxx.html for details".

If you have 25000+ files, then it just means that Passenger failed to spawn your app 25000+ times. You should definitely go investigate why Passenger failed to spawn your app so often.

5

If you need passenger and everything works fine with your app, you can delete old files by creating a cronjob with

crontab -e

and add something like

# m h  dom mon dow   command
23 3 * * * bash find /tmp/passenger-error-* -type f -mtime +1 -exec rm {} \;  > /dev/null 2>&1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest