Paid affiliate advertisement

$100 to solve WSOD problem when my custom module is on production server

MissyM - June 28, 2008 - 23:42

( Originally posted here: http://drupal.org/node/276000)

Hi -

Thank you for reading this. I have over a million hours into this problem already. I would worship the ground you walk on if you can help me solve this problem. I am adding to that a $100 bill that is very near and dear to my heart for either the genius who solves this or for the charity of his choice.

I developed a module on a test server with php 5.1.4 and mysql 4.1.20. It worked great. I found a more reliable host and installed it there and now I get the White Screen of Death whenever I hit submit. When I log in, when I do a search, when I confirm my module choices - WSOD. If I go to the URL in the nav bar and hit enter, it loads. The new server is on php 5.2.5 and mysql 5.0.51a.

Here is what I've been able to ascertain: I have memory_limit at 128M, max execution time at 30, maximum packet size at 16M. The upgrade to mysql 5 seems to be producing some errors but I can deal with them because at least I know what they are.

I have no clue what CGI does or if it relates to the submit function but the old server has CGI/FastCGI and the new one just has CGI.

I did have my theme and module named the same but I reworked it and now they are different.

There is nothing in my error log. Although I don't know what a lot of the functions below do, I'm trying to make my new server configured like my old one. My php.ini looks like this:

memory_limit = 128M

register_globals 0
session.auto_start 0
mbstring.http_input pass
mbstring.http_output pass
mbstring.encoding_translation 0

error_reporting =6143
display_errors = On
post_max_size = 16M
upload_max_filesize = 10M
log_errors = On
magic_quotes_gpc = Off
max_execution_time = 30
max_input_time = -1
output_buffering = 0
register_argc_argv=Off
register_long_arrays=Off
track_errors = On
session.bug_compat_42 = Off
session.gc_divisor = 1000
session.hash_bits_per_character = 5

When I turn off my custom function, everything seems to work. When I reduce my custom function down to just the following:

<?php
// $Id: mymod.module,v 1.0 1/12/08

/** Settings form
* This module has no administrative settings
***
* Implementation of menus
*/

function mymod_menu($may_cache) {
$items = array ();
$items[] = array ('title' => t('Support Home'), 'path' => 'support', 'callback' => 'mymod_support', 'access' => TRUE);
return $items;
}

Boom - I hit a white wall with every submit. I reduce it even more to this:

<?php


}

And still the same results. I have turned off every module except for the required core modules. I hit submit to turn confirm the module choices - WSOD! (unless my mod is off)

I'm ready to commit hari kari. Please save me from this awful fate and, if you have any vague idea, share it with me!

Thanks --

Missy.

Do you have any whitespace

gh0st25 - June 29, 2008 - 00:16

Do you have any whitespace at the end of your custom functions in the file/.inc? Remove them.

==============
delaware web design
delaware website design

Thank you for this good

MissyM - June 29, 2008 - 00:21

Thank you for this good idea. I don't have any .inc files. I took my two module files ( .info and .module) and removed any trailing white spaces to no avail.

So it's when you submit the

dman - June 29, 2008 - 00:46

So it's when you submit the admin-modules page with your mod on?
At that point, the data from the info file is used,
it goes looking for an (optional) module.install file
It runs a module_install() func if available
It asks module_menu() what menu items need to be cached. It may at that point check that the func exists.

Um.
It may be a silly question, but are your file and module names consistant?
modules/mymodule/mymodule.info
mentions 'mymodule' and mymodule.module contains mymodule_hooks()?
No typos?

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

Ever since I spent 13 hours

MissyM - June 29, 2008 - 01:06

Ever since I spent 13 hours to find a high bit character in column 138 in my Pascal days, I realized that there is nothing too obvious to double check.

The error occurs everywhere you hit submit. Early in the problem (before the search module was turned off), hitting submit to execute a search created this problem. Edit a node, save, this problem happens. Update any of the admin items, problemo. Regarding the names, everything was consistent before I reduced the module down to nothing to try to eliminate possible problems.

Caches have been deleted. Tables have been repaired. I have no problem on my test server with One Web Hosting. The issue was there with Drupal Value Hosting and the elusive Amit has gone completely AWOL and now I'm completely under the gun. I quit DVH and I am trying again at Ace-host.net. I've never received better customer service but they have been unable to find any issue on their end.

High-character bit is

dman - June 29, 2008 - 01:13

High-character bit is certainly one of my guesses - so I'd throw out that empty file you have and make a new one. Paste the text back in after passing it through a brain-dead editor. Just to be paranoid.

Occuring EVERY submit is most peculiar.
Wouldn't this imply that it's not the module at all, because you haven't been able to enable it? If you remove the module altogether, then you can submit buttons elsewhere?
Because if it never gets enabled, it can't affect the drupal behaviour, surely.

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

I think it happened on the

MissyM - June 29, 2008 - 06:00

I think it happened on the submit because maybe it was looking for a hook inside the module? That's my guess.

I did have my theme and

dman - June 29, 2008 - 00:54

I did have my theme and module named the same but I reworked it and now they are different.

I didn't see that first reading. That's a real killer - I got Apache core crashes last time I tried that.

So, be sure to empty your cache. Just to be sure

TRUNCATE cache;
TRUNCATE cache_menu;
TRUNCATE cache_content;
TRUNCATE cache_filter;

Sometimes problems just go away then.

If you are trying to put your menu callback back in, Do include a 'type' value this time.

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

Any chance you have multiple

dman - June 29, 2008 - 00:59

Any chance you have multiple copies of the module nearby?
copy_of_mymodule? mymodule.bak?
They need to be removed from all module directories, or they get found due to the recursive dir scanning. Sometimes you find yourself repeatatively editing a module file and seeing no change because the system had chosen to use another module file it found with the same name.

Go into your database and the 'system' table.
Look for the entry for your module name and delete it manually. It's safe to do so.
If there is a leftover from previous renaming efforts, definitely delete them too.

Swap your them back to default while troubleshooting this, just to be sure.

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

This is done and still no

MissyM - June 29, 2008 - 03:36

This is done and still no change. I'm onto your other suggestions. Thanks for your ideas. I'm trying to figure out Fiddler and so far the WSOD has Cache: Pragma: no-cache, then the reload which works doesn't have a cache entry. Also the WSOD has entity application/x-www-form-urlencoded whereas the one that eventually loads doesn't have an entity entry.

I don't know what that means but I'm researching it.

Can you check your APache log file?

ghankstef - June 29, 2008 - 02:06

this works if you can Run it right after the error occurs:

tail error_log;

This assumes SSH access if not there may be a Web interface to your logs.

Also your module calls this function:

mymod_support - what's in there?

If you use cPanel, go to it

archard - June 29, 2008 - 02:24

If you use cPanel, go to it and then go to File Manager. From there browse to your file and open it in cPanel's editor. I had a problem very similar to this before, and it turns out that cPanel for whatever reason was adding some nonsense characters/whitespace at the top of my php files. Make sure everything looks right in that editor. WSOD problems are almost always caused either by memory exhaustion or whitespace.

Gotta be whitespace. I've

gh0st25 - June 29, 2008 - 04:47

Gotta be whitespace. I've seen this before.

==============
delaware web design
delaware website design

I have been hot on the trail

MissyM - June 29, 2008 - 05:40

I have been hot on the trail of white space but I haven't figured it out yet. Could someone post explicitly where white space is allowed and where it is not? I use a lot of white space to separate my functions and that used to be fine. Thanks!

HOLY COW! It works!

MissyM - June 29, 2008 - 05:58

This was the longest day of my life. It was only made better by a honking big burrito, a twelve pack of coke, a bag of oreo cookies and friends like y'all. A week like that and I'd weigh 1200 pounds! Anyway, there were multiple problems and multiple solutions so I'll list them out:

Prior to posting, I did these things:

1. Memory needed to be changed in php.ini to at least 32M
2. I used the same theme and module names and so I separated them

After posting this bounty, I found the following:

1. My system databases were very messy. I had many experimental modules that still had tables and data in the system and variable files. I cleaned those up.
2. My .../sites/all/modules and ../modules directories had duplicated files and a bunch of unused modules. I deleted everything that I don't need.
3. My module file had ONE SPACE right before <?php and no one knows how it got there.

Thanks everyone so much for your thoughtful contributions and this awesome thread. Now, where to send that $100? dman, gh0st25 and archard all contributed to the solution. Please post if you would each like a third or if you want me to contribute it to Drupal.org or your favorite charity.

Thanks -- y'all are true Drupal Heros!! Hey, we should start a forum or something for that. Anyway, I couldn't have done it without you!!

Missy.

Tecccccccccccchnically first

gh0st25 - June 29, 2008 - 06:03

Tecccccccccccchnically first post... but I don't mind.

==============
delaware web design
delaware website design

So are ya saying that you

MissyM - June 29, 2008 - 21:07

So are ya saying that you want me to donate it to the cause or you want me to send you your share?

Donate it.. next time I'll

gh0st25 - June 29, 2008 - 21:07

Donate it.. next time I'll take the bounty head on lol.

==============
delaware web design
delaware website design

I could really use an extra 30 bucks :)

archard - June 29, 2008 - 07:20

richard@gametabs.net is the paypal address

I just Paypal'd you --

MissyM - June 29, 2008 - 20:58

I just Paypal'd you -- thanks for the help!

Here is a tip

mcneelycorp - June 29, 2008 - 08:54

If you would have found your whitespace first, you could have cleaned up your system table pretty quickly.

=================

Here is a tip and example of why to clean your systems table.

Most of the time I make a live site and dev site for clients. I do this using subdirectories, similar to a multisite set. In sites/ directory most of us have "all" or sites/all. In my setups I do
sites/all
sites/default (reserve this for local developing)
sites/www.sitename.com
sites/dev.sitename.com

I then change the settings.php as needed and move all files from sites/all/themes and sites/all/modules to the dev and live site. By doing this we will now need to change the system table. You could do this by a an UPDATE query or just login to each multisite and submit the admin/build/modules AND admin/build themes pages.

Drupal will automatically update the system table for you. I normally rid the sites/all directory to eliminate and confusion.

======================

Glad you found your problem(s).

===
Elvis McNeely
Drupal services: http://www.elvisblogs.org/drupal

That's a really good idea,

MissyM - June 29, 2008 - 21:05

That's a really good idea, Elvis. Thanks for the tip!

the whitespace at the top

dman - June 29, 2008 - 09:42

the whitespace at the top issue could have been identified by throwing out the problem file and starting fresh

I normally wouldn't say no to a bit of a paypal, but seeing as it certainly was a community effort I say put my share towards the Drupal assoc. :-)

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

It is done! $35 sent to the

MissyM - June 29, 2008 - 21:01

It is done! $35 sent to the Drupal Association with a special note saying that it was in honor of your awesome troubleshooting help. You are truly D Man!

Uhhh - not in this case~

MissyM - June 29, 2008 - 21:04

I wrote the problem file so chucking it wasn't an option.

To answer the question about

cog.rusty - June 29, 2008 - 07:25

To answer the question about whitespace, no printable characters must exist outside of php tags, because they cause output and headers are sent unexpectedly.

Whitespace is the most usual case, just because you don't see it. There is no problem adding whitespace inside php tags.

Template files (.tpl.php) are an exception, because they are meant for output.

The problem of non-printable characters is probably a little different.

Ah ha! Thank you!

MissyM - June 29, 2008 - 21:02

Ah ha! Thank you!

 
 

Drupal is a registered trademark of Dries Buytaert.