• Resolved Zeljko Jagust

    (@zjagust)


    Hello,

    I have multiple pages where I’m using SSH SFTP Updater Support plugin. It is configured so it automatically loads ssh keys from variables defined in wp-config.php. Example:

    /** WordPress Update Method */
    define( ‘FS_METHOD’, ‘ssh2’ );
    define( ‘FTP_BASE’, ‘/home/user/example.com/htdocs/’ );
    define( ‘FTP_PUBKEY’, ‘/home/user/.ssh/id_rsa.pub’ );
    define( ‘FTP_PRIKEY’, ‘/home/user/.ssh/id_rsa’ );
    define( ‘FTP_USER’, ‘user’ );
    define( ‘FTP_HOST’, ‘127.0.0.1:22’ );
    define( ‘FTP_SSL’, false );

    This was working for me for past two years, having no issues with WordPress updates itself, nor plugins. With the release of WP update 5.2.3 I’m getting the following error when trying to update:

    “The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php”
    Installation Failed.

    I have no such problems with plugin/theme updates, those still work fine and as expected.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Check the permissions and ownership on that file, and compare it to to the other WP core files.

    Thread Starter Zeljko Jagust

    (@zjagust)

    OK, let me clarify. My WordPress instances are not “using” webserver/php user like www-data, nobody and similar, but they are running under a dedicated user per instance. So for this example let’s call that user a “user”.

    So, as you can see from my initial post, permissions and ownership are set for “user” and I have configured my WP instances to use ssh2 method where I defined all the required variables for this to work in each instance wp-config.php file. And again as I mentioned, this was working for the past two years and still is working for everything else (plugins/themes/uploads) but not for WP core updates. Issue appeared with the version 5.2.3.

    And to answer your question, yes, permissions and ownership on that file matches to all other WP core files.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    >> . My WordPress instances are not “using” webserver/php user like www-data, nobody and similar, but they are running under a dedicated user per instance. So for this example let’s call that user a “user”. <<

    Good!

    It looks correct to me. But just to be sure, (and you may have already done this), please

    chown -R user:user /path/to/wordpress

    Thread Starter Zeljko Jagust

    (@zjagust)

    Ok, this has nothing to do with persmissions nor anything similar. I have a ChrootDirectory defined in my sshd config for each user which makes /home/user directory their (that user) actual root.

    Setting FTP_BASE to /sitename/htdocs in wp-config.php solves the problem:
    define( ‘FTP_BASE’, ‘/example.com/htdocs/’ );

    And it actually makes sense, system wise.

    I just want to confirm, and to emphasize, that if one has a chroot for a user account, then the FTP_BASE must be relative to the chroot directory, not a complete path to the filesystem root.

    In other words, if the full and real path to where WP is installed is
    /var/www/user_chroot/blog/
    then the FTP_BASE must be specified as
    /blog/

    I just fixed three of my sites using this advice.

    Yes, file permissions have to be correct, but the FTP_BASE was also required for my sites.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Update to 5.2.3 Fails’ is closed to new replies.