• My plugins are owned by daemon including subdirectories & files w 775.
    I update plugin A successfully; copy of plugin A’s directory remains in upgrade-temp-backup/plugins directory with all subdirectories now owned by ftp account user; I have a new request to update plugin A a week later. This update fails w error: Could not move the old version to the upgrade-temp-backup directory. Remember the version in wp-content is owned by daemon. there is an old version of plugin A sitting in upgrade-temp-backup/plugins w subdirectories owned by ftp account owner. Why wasn’t the file in the temp directory removed after the successful update? The update fails with the above error. I’m guessing it’s the difference in owner?Now WordPress deactivates Plugin A and removes it from my admin list of installed plugins altho it is still sitting in wp-content/plugins. How can I a) prevent this from happening and b) restore my invisible plugin?
    Thank you.

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

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Andy Fragen

    (@afragen)

    The Plugin Dependencies plugin has nothing to do with updating plugins. There is clearly a permissions issue and I have no idea why the user is ‘ftp’ and not your normal user or web server.

    How to exactly did you do the initial update to the plugin?

    Part of the fix is to restore the correct user to the appropriate directories.

    Thread Starter hmabpera

    (@hmabpera)

    Thank you, Andy, for trying to help me.
    I did the initial update from the admin/plugins.php page by selecting the plugin there and choosing Update Now.

    Obviously, I don’t understand much about users and owners. Our wordpress installation is on an AWS server. I believe the super user is daemon. when I logon to the WordPress files on the server I use sftp with a username, e.g., buddy123.
    Last week I was told to chown the plugin files and sub directories to daemon so the updates would be successful. The system admin did that. Updates worked — until I had to update two of those plugins again this week. These updates failed. Coincidentally, the plugin copy was sitting in the upgrade-temp-backup directory with the PLUGIN-NAME directory owned by daemon but the files and directories under that are owned by buddy123. This followup Update Fails with the error about mving the old version to the upgrade temp backup directory failure.

    Two other plugin updates ran successfully today. Neither of them had leftover files in the upgrade-temp-backup directory before they updated but they do now after their successful update. Do you think this should be so?

    Interestingly, the plugins that failed had leftover files in that directory but they no longer do have them after the failure. Maybe they got mv’ed to wp-content/plugins because the ones there are now owned by buddy123 but apparently are “invisible” to WordPress, by this I mean the plugins are no longer in my list of admin/plugins and do not function on the website.

    Again, I thank you very much for your time and expertise. From your writing on this topic, I determined that you have an understanding of how the “updating plugins” routine really is supposed to work. That is why I am asking for your help.

    Thread Starter hmabpera

    (@hmabpera)

    I forgot to mention that after the failed update, there was a message on the plugins page “the plugin PLUGIN NAME” has been deactivated due to an error: Plugin file does not exist” Note again that the plugin file is in the wp-content/plugins directory but gone from the admin/plugins list on our site. Again, thanks for your assistance.

    Plugin Author Andy Fragen

    (@afragen)

    The deactivation error occurs when either the original slug in the wp-content/plugins changes or the system can’t see the plugin.

    I’m not familiar with AWS but it’s certainly likely that the owner being changed is the cause. You should have the same owner for all the WP directories. You may need to involve your AWS administrator.

    Thread Starter hmabpera

    (@hmabpera)

    Thank you, Andy. Your advice is spot on. This problem began when the backup/restore (UpDraftPlus) of my plugins wiped out all my plugins in wp-content/plugins. I unpacked the plugins zip file and cp’ed each plugin from there into wp-content plugins. and activated same. Seemed OK. Everything worked. BUT I couldn’t update any plugins as these requests came in. I was advised to change the owner of all the plugins to Daemon. First update worked. As soon as I had to update the same plugin subsequently, I got the upgrade-temp-backup error along with the deactivate, remove from admin/plugin.php list.

    what do you advise? Everything went south when I did the UDPlus restore.
    Thanks.

    Plugin Author Andy Fragen

    (@afragen)

    You will need to update the whole directory structure with the owner of the web server. Probably daemon but I’m not certain.

    Thread Starter hmabpera

    (@hmabpera)

    this is what I tried before and that caused the failure on the second update of a any plugin. Our system admin changed the owner of all the plugins to daemon. the first update after that (successful) left a directory plugin in upgrade-temp-backup/plugins directory. the second update of that plugin gave the error message: could not move the old version to the upgrade-temp-backup directory (but the file which is now in the contents/plugins directory previously owned by daemon is now owned by “buddy123” as are those other plugins which are in upgrade-temp-backup/plugins. it looks like it cp’ed it there but didn’t connect it to the system.

    Do you know why it didn’t it didn’t or couldn’t remove those temporary backup files from that directory after the successful update?

    thanks for hanging in here with me.

    Plugin Author Andy Fragen

    (@afragen)

    Most likely the failure to update and remove is due to the incorrect owner. At this point I really don’t know who the correct owner is supposed to be.

    Thread Starter hmabpera

    (@hmabpera)

    Plugin Author Andy Fragen

    (@afragen)

    If your websever user is daemon then all of WP’s files should probably belong to daemon. I don’t know what’s changing it the FTP user but it’s possible that setting define( 'FS_METHOD', 'direct' ); in your wp-config.php file and updating all the files and folders in your WP installation back to the user daemon might solve the issue.

    It also might break stuff. Please make a backup and check with your sysadmin.

    Thread Starter hmabpera

    (@hmabpera)

    Thanks, Andy,

    Is this a possible scenario:

    1. PLUGIN_NAME plugin owner is daemon

    2. PLUGIN_NAME update succeeds

    3. successful update leaves previous PLUGIN_NAME folder in upgrade-temp-backup folder with sub files & folders no longer owned by daemon

    4. subsequent PLUGIN_NAME update can’t move current folder into upgrade-temp-backup folder because there’s a folder with that name already there (with sub files & folders no longer owned by daemon)

    5. this causes error, PLUGIN_NAME update fails,

    6. wordpress copies the upgrade-temp-backup/PLUGIN_NAME folder into content-plugins folder, because that’s what it does if there’s an error

    7. likewise wordpress deactivates this PLUGIN_NAME plugin

    (BTW there is no PLUGIN_NAME.php in the upgrade-temp-backup/ PLUGIN_NAME folders)

    Again, thanks for hanging in here with me. It’s hard to figure out how to fix this situation w/o knowing what the update plugin code is doing.

    Thread Starter hmabpera

    (@hmabpera)

    Hi Andy,
    I’m hoping you and your colleagues can shed some more light on the logic of the new update plugin code which is preventing me from updating plugins.

    the stumbling block for me is the upgrade-temp-backup directory.
    Is there a way I can update my plugins w/o using the upgrade-temp-backup directory?

    thanks.

    Plugin Author Andy Fragen

    (@afragen)

    Thread Starter hmabpera

    (@hmabpera)

    Thanks, Andy. I have read this artcle before but I’m sorry to say it is beyond my experience. Is it possible that I can set up a cron job to clear out upgrade-temp-backup directory regularly to enable subsequent updates of the same plugin to succeed?

    Plugin Author Andy Fragen

    (@afragen)

    There is already a wp-cron event to clear out upgrade-temp-backup weekly.

    Are you still having user ownership issues?

    • This reply was modified 11 months ago by Andy Fragen.
Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘updating plugins fails’ is closed to new replies.