Yesterday, I had a heart attack. Well, sort of. All of a sudden, without having done anything in particular, Firefox gave me a completely white screen, and Internet Explorer came up with a screen saying that I had a "HTTP 500 - Internal server error". Yikes.

I did some searching here, but nothing much of information (at least not of the usable and understandable kind) showed up.

I desperately attempted some random things to get rid of it. I cleared my cache files, I temporarily renamed my .htaccess file, I got rid of a block which was getting cumbersomely difficult to maintain, but nothing happened. I even resorted to "pushing harder" on my mouse buttons :-) But to no avail, the white screen persisted.

I put a "Hello world" php script on my site, next to Drupal's index.php, and it ran without a problem, but Drupal itself remained invisible. ?q=user didn't work, the admin section was unavailable, nothing nothing nothing, only a big ugly white screen.

And then, as suddenly as it disappeared, whoosh, after about an hour or so, there it was again, my site was back...

My question: would you reckon that I did something wrong? Or would you say that these http 500 errors are solely due to some mysterious thingy somewhere in the depths of Apache? If it's Apache, it's bad, but it's not my concern. If it's me who did something wrong, I would like to have some idea. What causes these HTTP 500-errors? And is there something I (being the site admin, but not the server admin) can do, or not do?

Any input is welcome, because I really abhor white screens...

Comments

The common webserver Apache has file error_log in log directory, in this file you will find the reason of this error.

--
lawyer

I have no access to that error_log file. I am the site admin, not the server admin. My site runs on some central department's server, out of my hands. I could try to get in touch with these people, but in everyday practice, I have nothing to do with them. They just provide the hardware, and they run the server software. The sites, on the other hand, are administered by local people, like me.

Is there something which I, as site admin, can do to avoid HTTP 500 errors, or is that something with which I have nothing to do, something which is entirely in the hands of the "server people"? In other words: can HTTP 500-errors be caused by my site, or are they only caused by server stuff?

I have no access to that error_log file. I am the site admin, not the server admin.

And what you have is a server administration problem. It could be something as simple as an out-of-memory condition, and that's why you need the server administrators to look at the logfile.

My question was actually based on one "fear": can I, as the site admin (but not the server admin) cause an http 500 error (assuming that my code is nothing special, just everyday stuff), or can I, in the case when something like that occurs, remain at ease and leave it to the server people to sort things out? As a "site person", having nothing to do with the server whatsoever, should I worry when a 500 error occurs, or shouldn't I? I trust that the server people do look at their logs regularly, but should I, being 1 of the maybe 2000 site admins in my organisation, inform them that "something special happened"? Sorry for going on about this, but I feel a bit uncomfortable with the whole thing, so I'm trying to get an idea of my own (possible) responsibility.

you can cause a 500 error. eg exceeding memory limits, changing file permissions, .htaccess screwups etc

500 errors are internal to the webserver and have no meaning to the visitor other that "site is broken". So the actual error doesn't get given to the visitor as it is out of their control - it is intended only for the server/site admins. On the other hand, 4xx error messages are for the benefit of the visitor/browser - eg "you asked for something that doesn't exist" or "I'm sorry Dave I can't let you do that" etc.

The people in charge of your server should really give you access to the servers error logs (for just your site). Otherwise you'll have to ask them for the actual error message each time - which is slow and painful for all involved.

--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal

500 error means something went wrong - it could be caused by an infinite number of things, and yes, some of those things may be things you've done, depending on how much permission to shoot yourself in the foot your sysadmin has given you.
You can even (if you try) 500 error by entering bad PHP code into a node. (or, as you hint, a block)

Now, the message you are seeing is generic. Intentionally. But there is much more detailed info about what really went wrong in your Apache logs.
This is deliberate, as many of the error messages may contain sensitive information, including filepaths, SQL and passwords, that common users have no business seeing. Plus one of the most common cause of a 500 error is a deliberate hack attempt, where someone is attempting to exploit the system by providing unexpected input. The last thing you want to do is tell them exactly what they got wrong :-)

I'm not saying that your 500s were anything to do with a hack ... just that that's a common scenario, and why your error message is obtuse.

Now, there are (at least) three levels of authority on your setup by the sounds. You say you are a site admin, but not server admin. That's common enough, specially on most commercial hosts (although you sound like you are in-house at least).
The thing is, the server admin has to grant you the ability to view your own error logs. This is a pretty basic and reasonable request. And it's the only thing that will tell you what went wrong from your current state of confusion. You can on dev sites configure PHP to send the full error to the browser, but that's really not a good idea - for the above reasons.
Even then, the answer/fix may take some debugging, but you can't progress without either logs or the ability to replicate the situation.

So the 500 you encountered may or may not be your fault, and may or may not be fixable.
However the troubleshooting steps you did were all quite sensible, and certainly a good start. We can't guess what really happened tho.

Could have been a combination of bad code in a block (which can be fatal) and caching refreshing eventually after you removed it. That's a pure speculation tho.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/