• I have 90+ sites hosted on managed servers, configured so that WordPress needs to use FTP credentials for updates.

    Some of those sites auto-updated to WP 6.1

    Many of them WSOD’s or got stuck in maintenance mode.

    I have:

    rolled back to WP6.0
    uploaded an old version plugin
    updated it all okay
    manually updated site to WP6.1 by uploading files via FTP
    uploaded an old version plugin
    updated it
    but site stuck in maintenance mode.

    Deleting .maintenance fixes the site, but the next plugin update breaks it.

    I have checked with server logs and the common feature of the failed updates seems to be this error:

    PHP Fatal error: Uncaught Error: Call to undefined function wp_cache_get() in /var/www/xxxxxx.co.uk/public_html/zzzz/wp-includes/option.php:165

    And that’s triggered by the wp_maintenance() function.

    I need help.

    As it stands at the moment, I have two choices:
    switch 90+ sites to different servers, or roll them all back to WP6.0

    Any suggestions please?

    • This topic was modified 3 years, 7 months ago by boldfish.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter boldfish

    (@boldfish)

    To add to this, on one site I am testing with the site remains in maintenance mode for minutes and then resolves.

    This is unusual behaviour

    Thread Starter boldfish

    (@boldfish)

    Attempting to trouble shoot on another server same issue .maintenance not deleted, but different error:

    Got error ‘PHP message: PHP Warning: ftp_rmdir(): /public_html/hq-bo/.maintenance: No such file or directory in /var/www/xxxxxxxx.co.uk/public_html/hq-bo/wp-admin/includes/class-wp-filesystem-ftpext.php on line 397’, referer: https://www.xxxxxx.co.uk/hq-bo/wp-admin/update-core.php?action=do-theme-upgrade

    well, the file *is there*

    Thread Starter boldfish

    (@boldfish)

    so I dig a bit deeper

    looking at the code suggests that the wrong file type is being sent to the function.

    it shouldn’t be trying to use ftp_rmdir() it should be using ftp_delete( $this->link, $file );

    /**
    * Deletes a file or directory.
    *
    * @since 2.5.0
    *
    * @param string $file Path to the file or directory.
    * @param bool $recursive Optional. If set to true, deletes files and folders recursively.
    * Default false.
    * @param string|false $type Type of resource. ‘f’ for file, ‘d’ for directory.
    * Default false.
    * @return bool True on success, false on failure.
    */
    public function delete( $file, $recursive = false, $type = false ) {
    if ( empty( $file ) ) {
    return false;
    }

    if ( ‘f’ === $type || $this->is_file( $file ) ) {
    return ftp_delete( $this->link, $file );
    }

    if ( ! $recursive ) {
    return ftp_rmdir( $this->link, $file );
    }

    $filelist = $this->dirlist( trailingslashit( $file ) );

    if ( ! empty( $filelist ) ) {
    foreach ( $filelist as $delete_file ) {
    $this->delete( trailingslashit( $file ) . $delete_file[‘name’], $recursive, $delete_file[‘type’] );
    }
    }

    return ftp_rmdir( $this->link, $file );
    }`

    This is clearly a bug somewhere else, and since it’s only affecting filesystem-ftpext.php it’s why using FS_direct fixes it.

    Backtracking to where the function is called from to see why it’s not passing filetype next…

    Thread Starter boldfish

    (@boldfish)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WP6.1 gets stuck in maintenance mode’ is closed to new replies.