Errors in Apache Log

Home Forums Community Errors in Apache Log

This topic contains 11 replies, has 2 voices, and was last updated by  2KDesign 3 weeks, 1 day ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #31629

    rohitmagnlik
    Newbie

    Hi,

    I am getting following error in error in apache error log. MyCred Leaderboard is not coming in sidebar. How to resolve these errors?

    
    [Thu Dec 08 04:38:19.819490 2016] [proxy_fcgi:error] [pid 3366:tid 140263523460864] [client 127.0.0.1:47408] AH01071: Got error 'PHP message: WordPress database error Table 'wordpress.wp_myCRED_log' doesn't exist for query SELECT id FROM wp_myCRED_log WHERE ref = 'site_visit' AND ref_id = 20161208 AND user_id = 1 AND data = '' AND ctype = 'mycred_default'; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), get_header, locate_template, load_template, require_once('/themes/eduma/header.php'), wp_head, do_action('wp_head'), myCRED_Hook_Site_Visits->site_visit, myCRED_Settings->has_entry\nPHP message: WordPress database error Table 'wordpress.wp_myCRED_log' doesn't exist for query SHOW FULL COLUMNS FROM <code>wp_myCRED_log</code> made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), get_header, locate_template, load_template, require_once('/themes/eduma/header.php'), wp_head, do_action('wp_head'), myCRED_Hook_Site_Visits->site_visit, myCRED_Settings->add_creds, myCRED_Settings->add_to_log\nPHP message: WordPress database error Table 'wordpress.wp_myCRED_log' doesn't exist for query \n\t\t\tSELECT SUM( creds ) \n\t\t\tFROM wp_myCRED_log \n\t\t\tWHERE user_id = 1\n\t\t\t\tAND ( ( creds > 0 ) OR ( creds < 0 AND ref = 'manual' ) )\n\t\t\t\tAND ctype = 'mycred_default'; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), get_header, locate_template, load_template, require_once('/themes/eduma/header.php'), wp_head, do_action('wp_head'), myCRED_Hook_Site_Visits->site_visit, myCRED_Settings->add_creds, myCRED_Settings->update_users_balance, mycred_query_users_total\nPHP message: WordPress database error Table 'wordpress.wp_myCRED_log' doesn't exist for query SELECT COUNT(*) FROM wp_myCRED_log WHERE ctype = 'mycred_default' AND ref = 'site_visit' AND user_id = 1; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), get_header, locate_template, load_template, require_once('/themes/eduma/header.php'), wp_head, do_action('wp_head'), myCRED_Hook_Site_Visits->site_visit, myCRED_Settings->add_creds, apply_filters('mycred_add_finished'), myCRED_Badge_Module->add_finished, mycred_badge_level_reached\nPHP message: WordPress database error Unknown column 'l.user_id' in 'on clause' for query \n\t\t\t\t\tSELECT DISTINCT u.ID, um.meta_value AS cred \n\t\t\t\t\tFROM wp_users u \n\t\t\t\t\tINNER JOIN wp_usermeta um ON ( u.ID = um.user_id ) \n\t\t\t\t\tLEFT JOIN wp_usermeta cap ON ( l.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' ) \n\t\t\t\t\tWHERE um.meta_key = 'mycred_default' \n\t\t\t\t\tAND um.meta_value != 0 \n\t\t\t\t\tORDER BY um.meta_value+0 DESC, um.user_id ASC\n\t\t\t\t\tLIMIT 0,8; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), do_action('thim_wrapper_loop_end'), thim_wrapper_loop_end, get_sidebar, locate_template, load_template, require_once('/themes/eduma/sidebar.php'), dynamic_sidebar, WP_Widget->display_callback, myCRED_Widget_Leaderboard->widget, mycred_render_shortcode_leaderboard\n'
    [Thu Dec 08 04:38:23.782900 2016] [proxy_fcgi:error] [pid 3366:tid 140263540246272] [client 127.0.0.1:47408] AH01071: Got error 'PHP message: WordPress database error Unknown column 'l.user_id' in 'on clause' for query \n\t\t\t\t\tSELECT DISTINCT u.ID, um.meta_value AS cred \n\t\t\t\t\tFROM wp_users u \n\t\t\t\t\tINNER JOIN wp_usermeta um ON ( u.ID = um.user_id ) \n\t\t\t\t\tLEFT JOIN wp_usermeta cap ON ( l.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' ) \n\t\t\t\t\tWHERE um.meta_key = 'mycred_default' \n\t\t\t\t\tAND um.meta_value != 0 \n\t\t\t\t\tORDER BY um.meta_value+0 DESC, um.user_id ASC\n\t\t\t\t\tLIMIT 0,8; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), do_action('thim_wrapper_loop_end'), thim_wrapper_loop_end, get_sidebar, locate_template, load_template, require_once('/themes/eduma/sidebar.php'), dynamic_sidebar, WP_Widget->display_callback, myCRED_Widget_Leaderboard->widget, mycred_render_shortcode_leaderboard\n'
    [Thu Dec 08 04:38:24.263969 2016] [proxy_fcgi:error] [pid 3366:tid 140263766849280] [client 127.0.0.1:47594] AH01071: Got error 'PHP message: WordPress database error Unknown column 'l.user_id' in 'on clause' for query \n\t\t\t\t\tSELECT DISTINCT u.ID, um.meta_value AS cred \n\t\t\t\t\tFROM wp_users u \n\t\t\t\t\tINNER JOIN wp_usermeta um ON ( u.ID = um.user_id ) \n\t\t\t\t\tLEFT JOIN wp_usermeta cap ON ( l.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' ) \n\t\t\t\t\tWHERE um.meta_key = 'mycred_default' \n\t\t\t\t\tAND um.meta_value != 0 \n\t\t\t\t\tORDER BY um.meta_value+0 DESC, um.user_id ASC\n\t\t\t\t\tLIMIT 0,8; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), do_action('thim_wrapper_loop_end'), thim_wrapper_loop_end, get_sidebar, locate_template, load_template, require_once('/themes/eduma/sidebar.php'), dynamic_sidebar, WP_Widget->display_callback, myCRED_Widget_Leaderboard->widget, mycred_render_shortcode_leaderboard\n'
    #31648

    rohitmagnlik
    Newbie

    Hi Team,

    Any help?

    #31680

    rohitmagnlik
    Newbie

    Hi,

    I can also see following error in log:

    [16-Dec-2016 15:55:47 UTC] WordPress database error Unknown column 'l.user_id' in 'on clause' for query
                                            SELECT DISTINCT u.ID, um.meta_value AS cred
                                            FROM wp_users u
                                            INNER JOIN wp_usermeta um ON ( u.ID = um.user_id )
                                            LEFT JOIN wp_usermeta cap ON ( l.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' )
                                            WHERE um.meta_key = 'mycred_default'
                                            AND um.meta_value != 0
                                            ORDER BY um.meta_value+0 DESC, um.user_id ASC
                                            LIMIT 0,8; made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/eduma/wrapper.php'), do_action('thim_wrapper_loop_end'), WP_Hook->do_action, WP_Hook->apply_filters, thim_wrapper_loop_end, get_sidebar, locate_template, load_template, require_once('/themes/eduma/sidebar.php'), dynamic_sidebar, WP_Widget->display_callback, myCRED_Widget_Leaderboard->widget, mycred_render_shortcode_leaderboard
    [
    #31683

    2KDesign
    Member

    Hello!
    I think “WordPress Database Error” says everything. I guess your database is not setup properly and its no problem based on mycred.
    But if you changed some code or added some code i bet this could happen also…

    since i and a lot of other users have mycred running, we can say that it is working.
    Also the leaderbord makes no problems on my site.

    #31730

    rohitmagnlik
    Newbie

    Yes, the first error was indeed an error in my database; however second error is in MyCred itself.

    Correct query is:

    SELECT DISTINCT u.ID, um.meta_value AS cred, um.user_id
                                            FROM wp_users u
                                            INNER JOIN wp_usermeta um ON ( u.ID = um.user_id )
                                            LEFT JOIN wp_usermeta cap ON ( um.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' ) 
                                            WHERE um.meta_key = 'mycred_default'
                                            AND um.meta_value != 0
                                            ORDER BY um.meta_value+0 DESC, um.user_id ASC
                                            LIMIT 0,8;

    This error occurs only in MyCred Leaderboard Widget in Sidebar.

    Please note l.user_id in original query (in previous post). It “l” doesn’t stand for any table.

    #31735

    2KDesign
    Member

    On my site the leaderboard is working. i didnt changed any code or something…

    #31739

    rohitmagnlik
    Newbie

    I see. Is it multisite installation?

    which version of PHP, Servers, MySQL are you using?

    #31740

    2KDesign
    Member

    I have a german hoster
    PHP 7.0.14
    MySQL 5.5

    Yes, i have multisite

    #31741

    rohitmagnlik
    Newbie

    Hi,

    This query was generated by the plugin:

    SELECT DISTINCT u.ID, um.meta_value AS cred
                                            FROM wp_users u
                                            INNER JOIN wp_usermeta um ON ( u.ID = um.user_id )
                                            LEFT JOIN wp_usermeta cap ON ( l.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' )
                                            WHERE um.meta_key = 'mycred_default'
                                            AND um.meta_value != 0
                                            ORDER BY um.meta_value+0 DESC, um.user_id ASC
                                            LIMIT 0,8;

    Can you please check whether it works fine with you.

    It’s generated in mycred_leaderboard.php:90. Your variable $multisite_check added LEFT JOIN wp_usermeta cap ON ( l.user_id = cap.user_id AND cap.meta_key = 'cap.wp_1_capabilities' ). l.user_id doesn’t have any reference to l in whole query.

    Thanks

    #31742

    2KDesign
    Member

    you might try to change

    l.user_id

    to

    log.user_id

    #31743

    rohitmagnlik
    Newbie

    I just tried it but still it doesn’t work.

    Also, log is not in select query.

    #31744

    2KDesign
    Member

    in the multisite part of leaderboard.php its called log.user_id

    // Multisite support
    else {

    $blog_id = absint( $GLOBALS[‘blog_id’] );
    $query = $wpdb->prepare( ”
    SELECT DISTINCT log.user_id AS ID, SUM( log.creds ) AS cred
    FROM {$mycred->log_table} log
    LEFT JOIN {$wpdb->usermeta} cap ON ( log.user_id = cap.user_id AND cap.meta_key = ‘cap.wp_{$blog_id}_capabilities’ )

    WHERE log.ref = %s
    {$time_filter}
    GROUP BY log.user_id
    ORDER BY SUM( log.creds ) {$order}, log.user_id ASC
    {$limit};”, $based_on );

    }

    }

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

Last edited December 8, 2016