PHP Invalid argument

I am seeing alot of these in my error log:

PHP Warning: Invalid argument supplied for foreach() in /public_html/wp-includes/functions.php on line 1254

WordPress database error for query SELECT meta_value FROM wp_sitemeta WHERE meta_key = 'upload_filetypes' AND site_id = 1 made by do_action_ref_array, call_user_func_array, do_all_pings, do_enclose, get_allowed_mime_types, apply_filters, call_user_func_array, check_upload_mimes, get_site_option, m_wpdb->query

I am not sure what caused this or how to fix this.

  • becky

    Hi Arun,

    Thanks for responding.

    The error doesn't in the front or backend. It is captured in the logged file. So I am not sure what caused. It's been a while though and I thought updating my site to 3.3.1, it will go away - it didn't :slight_frown:

    I have checked and repaired databases, the error still come back. I have been ignoring it but wonder if there is anything I can do to stop the error.

  • becky

    I ran on debug mode and got the following errors:

    Notice: Undefined index: mp_version in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 152

    Notice: Undefined index: key in /home/user/public_html/wp-content/plugins/tips/tips.php on line 54

    Notice: Undefined index: updated in /home/user/public_html/wp-content/plugins/tips/tips.php on line 57

    Notice: Undefined index: activated in /home/user/public_html/wp-content/plugins/tips/tips.php on line 57

    Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /home/user/public_html/wp-content/db.php on line 287

    Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /home/user/public_html/wp-content/db.php on line 294

    Notice: Undefined variable: query_type in /home/user/public_html/wp-content/db.php on line 665

    Notice: Undefined variable: query_type in /home/user/public_html/wp-content/db.php on line 665

    Notice: Undefined index: path in /home/user/public_html/wp-content/plugins/bad-behavior/bad-behavior-wordpress.php on line 173

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: Undefined index: allowed in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 505

    Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/user/public_html/wp-includes/functions.php on line 3587

    Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /home/user/public_html/wp-content/db.php on line 287

    Notice: Use of undefined constant DATACENTER - assumed 'DATACENTER' in /home/user/public_html/wp-content/db.php on line 294

    Notice: Trying to get property of non-object in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 1514

    Notice: Trying to get property of non-object in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 1518

    Notice: Undefined index: taxonomy in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 1070

    Notice: Undefined index: taxonomy in /home/user/public_html/wp-content/plugins/marketpress/marketpress.php on line 1070

    Notice: get_settings is deprecated since version 2.1! Use get_option() instead. in /home/user/public_html/wp-includes/functions.php on line 3467

    I am using all the latest wpmudev plugins

  • Mason

    Hiya becky,

    Those errors are all 'notices' rather than real errors. debug mode should only be ran during development to troubleshoot an actual plugin so I wouldn't worry about any of those messages.

    As to the original db error, what's your meta_value for upload_filetypes is it file types separated by spaces?

    If that's accurate you may need to overwrite your core wordpress files. How did you do your last update?

    Thanks!

  • becky

    Thanks masonjames for your reply.

    Yes, the meta_value for upload_filetypes are separated by spaces. I checked both the settings value and the value recorded in the database.

    I updated wordpress through the auto-update. So do i need to overwrite the wordpress files and upload through ftp? Will that be wp-admin, wp-includes and all the other files in the /public_html/ folder?

    EDIT: I forgot to say that this error occurred even before I updated wordpress. I got another site which has exactly the same plugins except for marketpress. Updated the same way but did not produce any error. The other difference I did not have a robot.txt file in the site producing the error.

  • Mason

    Hiya becky,

    Yeah, my hunch is that some portion of the WordPress upgrade failed. This is much less likely to happen doing a manual update via FTP as opposed to the auto-update.

    Manually upgrading WordPress just means Overwriting the wp-admin and wp-includes directories along with all files at the root. Your wp-config file won't be overwritten and you definitely want to keep everything in your wp-content.

    We always would recommend backing up your site files first, but follow the steps above and all should be fine. Let us know how it goes.

    Thanks!

  • becky

    Hi @masonjames

    The same database errors still occur after after overwriting the wordpress files :slight_frown:

    I also have 256 multi db too. The other pro-site have 16 multi db with no error.

    Do you think it could caused by the number db that I have?

    EDIT: I can't find anything wrong with functionality of my website though keep getting errors. Checked and repaired all DBs a few times, apart from pro-sites db, all other dbs could be repaired and checked.

  • becky

    Hi,

    They are below:

    $standard_global_tables = array ('blogs',
    'blog_versions',
    'registration_log',
    'signups',
    'site',
    'sitecategories',
    'sitemeta',
    'usermeta',
    'users',
    'bp_activity_sitewide',
    'bp_activity_user_activity',
    'bp_activity_user_activity_cached',
    'bp_friends',
    'bp_groups',
    'bp_groups_groupmeta',
    'bp_groups_members',
    'bp_groups_wire',
    'bp_messages_messages',
    'bp_messages_notices',
    'bp_messages_notices',
    'bp_messages_recipients',
    'bp_messages_threads',
    'bp_messages_threads',
    'bp_notifications',
    'bp_user_blogs',
    'bp_user_blogs_blogmeta',
    'bp_user_blogs_comments',
    'bp_user_blogs_posts',
    'bp_xprofile_data',
    'bp_xprofile_fields',
    'bp_xprofile_groups',
    'bp_xprofile_wire',
    'bp_activity',
    'bp_activity_meta');

    There is no particular time the error occur. But what i noticed is that when it occur, it does so like 20 times in a row in a span of 1-2 minutes. It will happen at least once a day or every 2 days. I have tried to track what particular occasion that may have caused the issue. So far, it's really hard for me to pin it down....

    EDIT: In the past year, I have updated multi-db plugin a few times by overwriting the db.php file only. I am currently using version 3.1.2.

  • Mason

    There is no particular time the error occur. But what i noticed is that when it occur, it does so like 20 times in a row in a span of 1-2 minutes.

    That leads me to think that there's a temporary connection issues on the server between WordPress and the databases and that there may not be anything to be done here. Especially since you're not noticing any functional issues, and database repairs aren't assisting.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.