• Resolved egycode

    (@egycode)


    Hello,

    Thank you for the great and free plugin! I had these error on error log file these are the stack trace log for the php errors

    [21-Aug-2018 02:20:23 UTC] Exception: fclose() expects parameter 1 to be resource, boolean given ON ?wp-admin/admin-ajax.php in /wp-content/themes/reviewpro/functions.php:112
    Stack trace:
    #1 /wp-content/plugins/updraftplus/admin.php(1377): fclose(false)
    #2 /wp-content/plugins/updraftplus/admin.php(1193): UpdraftPlus_Admin->do_updraft_download_backup(0, ‘db’, ‘1534816811’, ”, false, ”)
    #3 /wp-includes/class-wp-hook.php(286): UpdraftPlus_Admin->updraft_download_backup(”)
    #4 /wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #5 /wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #6 /wp-admin/admin-ajax.php(100): do_action(‘wp_ajax_updraft…’)
    #7 {main}
    [21-Aug-2018 02:20:23 UTC] Exception: unlink(): No such file or directory ON /wp-admin/admin-ajax.php in /wp-content/themes/reviewpro/functions.php:112
    Stack trace:
    #1 /wp-content/plugins/updraftplus/admin.php(1378): unlink(”)
    #2 /wp-content/plugins/updraftplus/admin.php(1193): UpdraftPlus_Admin->do_updraft_download_backup(0, ‘db’, ‘1534816811’, ”, false, ”)
    #3 /wp-includes/class-wp-hook.php(286): UpdraftPlus_Admin->updraft_download_backup(”)
    #4 /wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #5 /wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #6 /wp-admin/admin-ajax.php(100): do_action(‘wp_ajax_updraft…’)
    #7 {main}

    Please fix these issues!

    • This topic was modified 6 years, 6 months ago by egycode.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author David Anderson / Team Updraft

    (@davidanderson)

    wp-admin/admin-ajax.php in /wp-content/themes/reviewpro/functions.php

    This error, and the other one, are generated, according to the message you’re seeing, in the ‘reviewpro’ theme, not in UpdraftPlus.

    Thread Starter egycode

    (@egycode)

    Thank you for your reply!

    I use a php function that handle php errors which is located in theme functions.php file and it return the requested url in the error log as reference for me to investigate the error and I already removed the line from stack trace

    And its obvious in the trace that its related to the updraft plugin!

    /wp-content/plugins/updraftplus/admin.php(1377): fclose(false)

    /wp-content/plugins/updraftplus/admin.php(1378): unlink(”)

    Also I got this error today after doing automatic backup to google drive!

    [23-Aug-2018 02:24:42 UTC] PHP Notice: Undefined index: others in /wp-content/plugins/updraftplus/backup.php on line 664

    Couldn’t log a stack trace by the custom php function that handle php errors in functions.php file!

    • This reply was modified 6 years, 6 months ago by egycode.
    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    What version of UpdraftPlus is currently installed on the site?

    Thread Starter egycode

    (@egycode)

    Latest version.

    Thread Starter egycode

    (@egycode)

    new error in the log today!

    [24-Aug-2018 03:47:21 UTC] Backtrace from warning ‘constant(): Couldn’t find constant DOING_CRON’ at /wp-content/plugins/updraftplus/class-updraftplus.php 2712: /wp-admin/admin-ajax.php 100 calling do_action() –> /wp-includes/plugin.php 453 calling do_action() –> /wp-includes/class-wp-hook.php 310 calling apply_filters() –> /wp-includes/class-wp-hook.php 286 calling updraft_ajax_handler() –> /wp-content/plugins/updraftplus/admin.php 1431 calling backupnow() –> /wp-content/plugins/updraftplus/includes/class-commands.php 117 calling request_backupnow() –> /wp-content/plugins/updraftplus/admin.php 2066 calling do_action() –> /wp-includes/plugin.php 453 calling do_action() –> /wp-includes/class-wp-hook.php 310 calling apply_filters() –> /wp-includes/class-wp-hook.php 286 calling backupnow_database() –> /wp-content/plugins/updraftplus/class-updraftplus.php 2692 calling boot_backup() –> /wp-content/plugins/updraftplus/class-updraftplus.php 2933 calling get_semaphore_lock() –> /wp-content/plugins/updraftplus/class-updraftplus.php 2712 calling constant()

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    It appears that the errors highlighted in your log are from functions where error reporting has been suppressed via the ‘@’ error control operator.
    These are situations where a non-fatal error may be expected, but can safely be ignored.

    However, your custom error handler does not appear to support this. Your error handler should check that error_reporting() === 0, and abort if so (See https://php.net/set_error_handler for more details).

    Plugin Author David Anderson / Team Updraft

    (@davidanderson)

    This is to say… in your custom handler, you are logging events whose type PHP is advising you are set to be ignored.

    In https://php.net/set_error_handler, look at the paragraph beginning ‘It is important to remember that’; in particular the info about the @ operator.

    Thread Starter egycode

    (@egycode)

    Thank you both, @dnutbourne and @davidanderson

    I commented the case switch statement code in the function to log all error types! My bad!

    But I think this error is a different situation, though

    [23-Aug-2018 02:24:42 UTC] PHP Notice: Undefined index: others in /wp-content/plugins/updraftplus/backup.php on line 664

    Thread Starter egycode

    (@egycode)

    By investigating the last error, i found it related to the prune_retained_backups function and it seem to occur every day when the backup is being created and uploaded to google drive, the index others may be associated with the folder others and it is triggered while deleting the retained backup from the remote server on gooole drive!

    I reviewed the backup files on my google drive account and i found that backups created on 22nd of this month didn’t prune, I set the retain version to only 1, so from my understanding it should retain the backup created on 23rd and delete the backup created on 22nd? or I’m wrong!

    Plugin Contributor DNutbourne

    (@dnutbourne)

    Hi,

    Apologies for the delay.

    Please could you send us a copy of the latest backup log where this issue occurs?
    The contents will be too long to post here directly, but you can use an online service such as Pastebin, and post the link here.

    Best Wishes,
    David N

    Thread Starter egycode

    (@egycode)

    Sorry, the log file has been deleted and this error didn’t occur in the last days! maybe it happen only if you try to create a specific backup like others folder after an automatic backup already created, the plugin will delete the most recent same backup part (others folder) from the last full backup on remote storage! Is this implemented in your code?

    Have a nice day!

    Plugin Author David Anderson / Team Updraft

    (@davidanderson)

    [23-Aug-2018 02:24:42 UTC] PHP Notice: Undefined index: others in /wp-content/plugins/updraftplus/backup.php on line 664

    There is indeed a gremlin there. It’s only affect is to cause a misleading log line in limited circumstances. Fixed now for our next release. Thanks for the report!

    Thread Starter egycode

    (@egycode)

    There is indeed a gremlin there. It’s only affect is to cause a misleading log line in limited circumstances. Fixed now for our next release. Thanks for the report!

    Sorry for the late reply, I was busy.. the error related to the index occurred again

    [08-Sep-2018 02:10:06 UTC] PHP Notice: Undefined index: others in /wp-content/plugins/updraftplus/backup.php on line 664

    Thanks.

    • This reply was modified 6 years, 5 months ago by egycode.
    Plugin Author David Anderson / Team Updraft

    (@davidanderson)

    Hi,

    As I say, it’s fixed in the next release. Which was just made available, a few minutes ago.

    David

    Thread Starter egycode

    (@egycode)

    Sorry, I didn’t look at the date, I thought this was fixed in the last release as I didn’t see this thread long time ago..

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘fclose() and unlink() errors’ is closed to new replies.