The MU forums have moved to WordPress.org

WP-Activate showing 200 (OK) but getting whitescreen (18 posts)

  1. richs0914
    Member
    Posted 14 years ago #

    I recently transferred my Wordpress MU install from VPS to Amazon EC2.

    Everything is working fine, except wp-activate is not working.

    If a user signs up for a blog, they go through the signup process and get an email telling them to click a link to activate their account (all of that works fine until they click the link)

    Once they click the link it takes them to a white screen.

    I checked my error logs and there is nothing to be found that has to do with wp-activate.

    When I check my access log, it shows me that someone clicked on the link and it gave a 200 (OK) signal, meaning everything was fine.

    But it isn't. In the wp-signup's table it shows that the registration has never been activated, and the user's blog still doesn't exist.

    I have since double and triple checked my wildcard domain, and everything looks okay in my Apache Virtual Hosts settings and on my DNS provider's side. All of my previous user's blogs (before the move, when activation was working fine) like

    http://union.sportsblognet.com.

    I have stripped out all of my plugins and reverted to a default theme, even installed all fresh WPMU 2.7.1 files. I also set the permissions on all directories and files to 777 (temporarily) just to see if that would get it to work. But no luck.

    http://sportsblognet.com/wp-activate.php?key=5615e24e0142eb96

    I have no idea what to try next.

  2. cafespain
    Member
    Posted 14 years ago #

    Go into your wp-config.php and switch on debugging to check if any informative errors are being produced.

  3. richs0914
    Member
    Posted 14 years ago #

    Turned on debugging in wp-config.php and got...

    Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /vol/public_html/sportsblognet.com/public/wp-settings.php on line 473
    
    Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /vol/public_html/sportsblognet.com/public/wp-settings.php on line 480
    
    Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /vol/public_html/sportsblognet.com/public/wp-settings.php on line 487
    
    Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /vol/public_html/sportsblognet.com/public/wp-settings.php on line 494
    
    Notice: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' in /vol/public_html/sportsblognet.com/public/wp-settings.php on line 501

    when I click on this link to activate

    http://sportsblognet.com/wp-activate.php?key=5615e24e0142eb96

    That was it, and I don't really know what to make of that.

  4. wpmuguru
    Member
    Posted 14 years ago #

    What plugins are you running?

  5. richs0914
    Member
    Posted 14 years ago #

    well...i was running

    akismet
    insights
    domain-mapping
    feedwordpress
    cforms
    wpmu-feed
    new-blog-setup
    buddypress

    but they have all been removed, as that was the first thing I thought would be the case

  6. cafespain
    Member
    Posted 14 years ago #

    Right, so you are getting at least as far as line 501 in wp-settings.php which means you have already loaded the plugins in the mu-plugins directory. The next big steps are loading pluggable.php and going through and loading the normal plugins.

    Then it connects to the database.

    At this point (if it were me) I would start putting some debug echo statements in at certain points (after key file loads) to see how far the script gets before it blanks out on you.

  7. cafespain
    Member
    Posted 14 years ago #

    Here's one for you - try switching of gzipping and see if that does anything.

  8. richs0914
    Member
    Posted 14 years ago #

    try switching of gzipping and see if that does anything

    I had gzip off to begin with, so that's probably not the case...

    At this point (if it were me) I would start putting some debug echo statements in at certain points (after key file loads) to see how far the script gets before it blanks out on you

    Do you mean place <?php echo 'made it past wp-settings'; ?>
    at the bottom of wp-settings.php, and then something similar at the bottom of pluggable.php. If so, what other files should I do that to?

    One more thing the I realized, is that I am not able to create a new blog under my own user. Meaning that if i go to signup and I'm already logged in, it says that I can have another blog without having to go through the whole email signup process again. When I click to create a blog it acts like its working and then hangs, with the page incomplete.

    One other thing, I know its not my Apache set-up wildcard domain settings or permissions, because I took out everything and decided to see if a fresh install, with a new database would work at activating, and it worked fine.

    My database is the only variable (I think).

  9. andrea_r
    Moderator
    Posted 14 years ago #

    What about when you create a blog from the backend?

    "I checked my error logs and there is nothing to be found that has to do with wp-activate."

    Sometimes things aren't obvious. :)

    Try it again so you get an error, check the log again, and see if it added a line. If so, put the line here.

    If not, ugh.

  10. richs0914
    Member
    Posted 14 years ago #

    What about when you create a blog from the backend?

    It hangs and I get a whitescreen

    There were no errors either.

    At this point (if it were me) I would start putting some debug echo statements in at certain points (after key file loads) to see how far the script gets before it blanks out on you.

    So I followed cafespain's advice, and I took to creating a blog from the backend. That got me a starting point of wpmu-edit.php and the 'addblog' action.

    http://sportsblognet.com/wp-admin/wpmu-edit.php?action=addblog

    So I placed some echo statements in the 'addblog' action of wpmu-edit.php and tried to add a blog in the backend. The script stopped at

    $id = wpmu_create_blog($newdomain, $path, $title, $user_id , array( "public" => 1 ), $current_site->id);

    So I followed 'wpmu_create_blog' into wpmu-functions.php and placed some more echo statements in it and found that the script stopped at

    if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
    		return new WP_Error('insert_blog', __('Could not create blog.'));
    	switch_to_blog($blog_id);

    And never gets beyond that point.

    Here's the full function:

    function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
    
    	$domain = preg_replace( "/\s+/", '', sanitize_user( $domain, true ) );
    	if( constant( 'VHOST' ) == 'yes' )
    		$domain = str_replace( '@', '', $domain );
    	$title = strip_tags( $title );
    	$user_id = (int) $user_id;
    
    	if( empty($path) )
    		$path = '/';
    
    	// Check if the domain has been used already. We should return an error message.
    	if ( domain_exists($domain, $path, $site_id) )
    		return new WP_Error('blog_taken', __('Blog already exists.'));
    
    	if ( !defined("WP_INSTALLING") )
    		define( "WP_INSTALLING", true );
    
    	if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
    		return new WP_Error('insert_blog', __('Could not create blog.'));
    
    	switch_to_blog($blog_id);
    
    	install_blog($blog_id, $title);
    
    	install_blog_defaults($blog_id, $user_id);
    
    	add_user_to_blog($blog_id, $user_id, 'administrator');
    
    	if ( is_array($meta) ) foreach ($meta as $key => $value) {
    		if( $key == 'public' || $key == 'archived' || $key == 'mature' || $key == 'spam' || $key == 'deleted' || $key == 'lang_id' ) {
    			update_blog_status( $blog_id, $key, $value );
    		} else {
    			update_option( $key, $value );
    		}
    	}
    
    	add_option( 'WPLANG', get_site_option( 'WPLANG' ) );
    
    	update_option( 'blog_public', $meta['public'] );
    
    	if(get_usermeta( $user_id, 'primary_blog' ) == 1 )
    		update_usermeta( $user_id, 'primary_blog', $blog_id );
    
    	restore_current_blog();
    
    	do_action( 'wpmu_new_blog', $blog_id, $user_id );
    
    	return $blog_id;
    }
  11. richs0914
    Member
    Posted 14 years ago #

    bump...

  12. richs0914
    Member
    Posted 14 years ago #

    Any advice as to what could be causing the stall at

    if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
    		return new WP_Error('insert_blog', __('Could not create blog.'));

    I'm really at a loss right now. I even took a working fresh MU database that was able to create new blogs, and dumped in the necessary tables from my database

    wp_blogs, wp_blog_versions, wp_registration_log, wp_signups, wp_site, wp_sitecategories, wp_sitemeta, wp_usermeta, and wp_users

    plus the wp_1_options table

    and got the site running, but when I went to create a blog, it hung like before. When I take out that info, the create a blog part works fine.

  13. andrea_r
    Moderator
    Posted 14 years ago #

    Does the database user have ALL permissions on the database?

  14. richs0914
    Member
    Posted 14 years ago #

    Yes, the database user has "ALL PRIVILEGES" except for grant

  15. andrea_r
    Moderator
    Posted 14 years ago #

    there's definitely something going on permission-wise blocking this. I can't really say without being in there and looking.

    (no that's not an offer, sorry :D )

    I'd get with the Amazon EC2 people and start asking them why you can;t create new tables.

  16. richs0914
    Member
    Posted 14 years ago #

    I CAN create new tables, just not the tables for the new blogs.

    I uploaded and activated GD Stars Plugin (which I knew created tables in the database to work) and it installed the tables necessary, without any problems.

    I also tested creating a new blog with the Root user in mysql (setting wp-config to use "root" temporarily) and no luck.

    Something's causing the wpmu_create_blog function to hang, but I just don't know what.

    I don't think it's permissions of the database user, otherwise the plugin install would've hung or died too.

  17. andrea_r
    Moderator
    Posted 14 years ago #

    Considering it worked on the VPS, and it doesn't on Amazon's ec2....

    find out what's different between them.

  18. richs0914
    Member
    Posted 14 years ago #

    I ended up fixing my problem...

    In short, I had numerous rows from old plugins in my wp_1_options table, totaling 20.1 MB. I sorted through and kept the default options and the ones that I wanted to keep and shrunk it down to 0.7 MB. It now works like a charm and responds a lot faster.

    I don't quite know why it worked on Slicehost and was stalling on Ec2 (although, maybe I allowed the script to run longer on Slicehost, so it ended up eventually working, instead of giving up).

    If anyone wants more detailed info, let me know, and I'll post it.

    But I wanted to say thank you to andrea_r and cafespain, who guided me in the right direction and basically taught me how to track down the source of some problems.

About this Topic

  • Started 14 years ago by richs0914
  • Latest reply from richs0914