The MU forums have moved to WordPress.org

Error when creating a blog (19 posts)

  1. Rubyducky
    Member
    Posted 16 years ago #

    Hello!
    When I create a blog in the admin panel, I get this error yet the blog is still created. Any idea what's going on/how I can fix it? It looks like the blog is still created but I'd still like to get this error fixed. Thanks!

    The Error is below:

    *WordPress database error:* [Table 'wpjb.wp_3_options' doesn't exist]
    |SELECT option_value FROM wp_3_options WHERE option_name = 'blogname' LIMIT 1|

    *WordPress database error:* [Table 'wpjb.wp_3_options' doesn't exist]
    |SELECT option_value FROM wp_3_options WHERE option_name = 'siteurl' LIMIT 1|

    *WordPress database error:* [Table 'wpjb.wp_3_options' doesn't exist]
    |SELECT option_value FROM wp_3_options WHERE option_name = 'post_count' LIMIT 1|

    *Warning*: Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/wp-includes/wp-db.php:111) in */opt/lampp/htdocs/wp-includes/pluggable.php* on line *281

  2. PleaseHelp
    Member
    Posted 16 years ago #

    same error here

  3. twinkel
    Member
    Posted 16 years ago #

    I have also the same problem (I've tried the stable release WordPress Mu 1.0 but also the unstable dev version) and in both situations I have this problem.

    It would be nice if someone could help us :)

    Kind regards,

    Twinkel

  4. drmike
    Member
    Posted 16 years ago #

    Might help us help you if you checked to see if the databse tables are there.

  5. justkristin
    Member
    Posted 16 years ago #

    I have this problem and the tables do indeed exist. It is almost as though the script is checking for the successful table creation before the tables are created. Could this be possible?

  6. athesudden
    Member
    Posted 16 years ago #

    For reference, I am using downloaded wordpress-mu-1.0.tar.gz this morning from the download page.

    I installed wpmu and received no error messages. Tables wp_1_* appeared in the database and everything was hunky-dory.

    After receiving my admin password, I logged in and sought to create another blog for myself (admin) via the admin panel (Site Admin -> Blogs -> Add Blog). Upon entering valid info and puching the Add Blog button I get:

    WordPress database error: [Table 'wpmu.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'blogname' LIMIT 1
    WordPress database error: [Table 'wpmu.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'siteurl' LIMIT 1
    WordPress database error: [Table 'wpmu.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'post_count' LIMIT 1

    I looked in the database and the table wpmu.wp_2_options is there, and the blog has been created.

    I debugged for a while and verified that the error messages being printed prior to the creation of the blog tables (i.e. wpmu.wp_2_*), just as justkristin suspected...

  7. athesudden
    Member
    Posted 16 years ago #

    This can be verified by placing some echos in the query function in file wp-includes/wp-db.php:

    $this->result = @mysql_query($query, $dbh);
    # echo "in query: query = $query<br>";
    # echo "in query: dbh = $dbh<br>";
    # echo "in query: this->result = $this->result<br>";
    ++$this->num_queries;
    if (SAVEQUERIES)
    $this->queries[] = array( $query, $this->timer_stop() );
    // If there is an error then take note of it..
    if( $dbh ) {
    if ( mysql_error( $dbh ) ) {
    echo "in query: there was a mysql_error...<br>";
    $this->print_error( mysql_error( $dbh ));
    return false;
    }
    }

    (uncomment the lines to test)

    What I found upon doing (besides lengthy output) so is exactly as I described earlier: The error messages are printed prior to the CREATE TABLE queries for the blog tables.

  8. athesudden
    Member
    Posted 16 years ago #

    So why is this happening? The blog is created, but the cost is some ugly error messages. What gives?

    Refer to wp-includes/wpmu-functions.php

    The lines that are directly responsible for generating the error messages are in funtion get_blog_details:


    $details->blogname = get_blog_option($id, 'blogname');
    $details->siteurl = get_blog_option($id, 'siteurl');
    $details->post_count = get_blog_option($id, 'post_count');

    Notice that two lines up in the same function we should be silencing the errors:


    $wpdb->hide_errors();

    Look what lies between these two code excerpts. Another line:


    switch_to_blog($id);

    This fucntion is the culprit. The errrors are switched back on when the following conditional in function switch_to_blog is met:


    if( is_object( $wp_roles ) ) {
    $wpdb->hide_errors();
    $wp_roles->_init();
    $wpdb->show_errors();
    }

    This is as far as I got today. I am not going to present a solution b/c the first one I have in mind seems hasty, which is:

    in function get_blog_details:

    switch:

    $wpdb->hide_errors();
    switch_to_blog($id);

    to

    switch_to_blog($id);
    $wpdb->hide_errors();

    I have to go home now. Note that I haven't looked at the lastest nightly build nor have I posted this to trac. I just wanted to share my findings. I will elaborate if I find out more. Please do the same.

  9. andrea_r
    Moderator
    Posted 16 years ago #

    It's doing the same for me - everything is fine, but when I create a blog in the backend, there's the error messages, and yes it gets created.

  10. athesudden
    Member
    Posted 16 years ago #

    An important side-note: Users who create blogs *do not* see an error message. Upon activation, their blog is created as they (and I) would expect it to be...

    justkristin, andrea_r, is this the case for you as well?

    Please advise.

  11. elTio
    Member
    Posted 16 years ago #

    The sql error on manual blog creation has been fixed in trac.
    See http://trac.mu.wordpress.org/browser/trunk/wp-includes/wpmu-functions.php
    to update that file.
    DONT LEFT BLANKS at the end of the file cause u get "headers errors"

  12. Rhand
    Member
    Posted 16 years ago #

    I have almost the same errors. I have one extra though. Moreover, my blog is not created!

    WordPress database error: [Table 'wpmu.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'blogname' LIMIT 1
    WordPress database error: [Table 'wpmu.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'siteurl' LIMIT 1
    WordPress database error: [Table 'wpmu.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'post_count' LIMIT 1
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/../htdocs/weblogs/wp-includes/wp-db.php:111) in /var/www/../htdocs/weblogs/wp-includes/pluggable.php on line 281

    I did find wp_2_options in Mysql..

    Then I updated wpmu-functions it created the blog without errors, but weblogs/johndoe was not created! How come?

  13. demonicume
    Member
    Posted 15 years ago #

    did this change make it into the upgrade? I just saw the same error.

  14. banjolawyer
    Member
    Posted 15 years ago #

    same error here with new install of 1.2.1

  15. victorcastelan
    Member
    Posted 15 years ago #

    I have running MU 1.1.1 and I had the same error, but I replaced the file http://trac.mu.wordpress.org/browser/trunk/wp-includes/wpmu-functions.php
    and this error no longer exists.

    Download this file, and the error will disapear.

    Thi file is wpmu-functions.php and it resides in wp-includes directory

  16. ltkeng
    Member
    Posted 15 years ago #

    How do I download the file? My browser sees it as an HTM file and when I try to save the file, I get an HTML file with all the HTML coding, not the PHP file.

  17. drmike
    Member
    Posted 15 years ago #

    Take a look at the file source. Should be under your browsers View menu.

  18. ellycramer
    Member
    Posted 15 years ago #

    ltkeng, look at the bottom of the page for "Download in other formats" and choose "plain text" and it should download as a clean php file. It took me a bit to notice this link.

    I'm hoping this file will fix this problem since I can't upgrade to 1.2.1 on production until I get it resolved.

    Thanks in advance!

  19. ellycramer
    Member
    Posted 15 years ago #

    Follow up message - the version of wpmu-functions.php in Trac as of today (5/23/07) worked like a charm. THANK YOU!!

About this Topic

  • Started 16 years ago by Rubyducky
  • Latest reply from ellycramer