Solved WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.
-
WordPress 5.5 comes with auto-updates functionality for plugins and themes. The Managed version of this app unfortunately (or fortunately?) still blocks automatic updates.
I tried it out with one site and it had two plugin updates available, and a notice that said it would be updated in 2 hours. I checked 3 hours later and the notice then changed to the next update will be in 11 hours (basically every 12 hours it updates as far as I can tell).
Just a heads up to anyone on the Managed version who is hoping to take advantage of the built-in auto-updates for themes and plugins - it ain't working with he way the Managed app is configured.
Will need to use the Unmanaged app I guess for that functionality. My hope is the Unmanaged app will come with LDAP support eventually so I can make the move back to that version.
-
@d19dotca I noticed that WordPress (Managed) was not updating to 5.5 within WordPress itself (unliked WordPress Unmanaged)... and so I figured perhaps I'd need to upgrade the app itself to get WordPress 5.5, but after clicking Checking for updates and the clicking Update Available it informed me:
This update is a pre-release and not considered stable yet. Please update at your own risk.
So I didn't update.
Perhaps once it is stable the auto-updates will work?
/me shrugs
-
@jdaviescoates I believe that message you saw is for 5.5 (coincidentally same version) of Cloudron itself, not WordPress Managed. The WordPress Managed app was released yesterday though with WordPress 5.5 (as opposed to Cloudron 5.5), and inside of WordPress 5.5 it has functionality to auto-update plugins and themes - basically eliminating the need to have an additional plugin to do that task.
That new built-in functionality isn’t working and I’m pretty certain (though hoping someone else can confirm) that it’s because of the “disable Wordpress updates” plug-in that’s auto-installed in the Managed image. I haven’t tried yet but I’d suspect if I used the Unmanaged version then it’d work just fine.
-
@d19dotca said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
I believe that message you saw is for 5.5 (coincidentally same version) of Cloudron itself, not WordPress Managed.
No, it's for the WordPress (Managed) package update:
Not a Cloudron update.
-
@jdaviescoates oh that’s interesting, I somehow totally missed that message when I was updating. Hopefully this is just an issue with the pre-release version then.
-
@jdaviescoates interestingly the forum post with the release notes doesn’t mention it as beta either. https://forum.cloudron.io/topic/2407/wordpress-managed-package-updates
-
@d19dotca
btw dont use the auto-update, it dosent provide any check on the update, we are faing many WordPress crash because customer activate this new feature. -
@d19dotca said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
@jdaviescoates interestingly the forum post with the release notes doesn’t mention it as beta either. https://forum.cloudron.io/topic/2407/wordpress-managed-package-updates
I also note that after hitting Check for Updates, the fact that there is now an update then triggers an email about the update, and the email doesn't contain the warning about it being unstable either:
-
@MooCloud_Matt Just to clarify, you’re talking about the auto-update within WordPress itself, the new functionality right? Interesting that you’ve seen some crashes and stuff already.
I went through and updated about 12 WordPress sites yesterday afternoon and did some brief testing of them all, one-by-one since it was a major WordPress update. Thankfully there were no public-facing issues, aside from one where I had to regenerate the CSS files. Everything went smoother than I expected, honestly.
The only real issue I’ve experienced is the one I’m reporting here, but to be fair I only tried enabling the auto-update for plugins and themes on two of twelve sites. No crashes or anything though observed, just that the auto-update isn’t doing anything.
-
Yeah, we haven't heard any WP 5.5 related issues either. What crash are we talking about? The package itself gets rolled out slowly since we have a very large amount of WP installs.
The auto-update of plugins should ideally work, let me check why it doesn't.
-
@d19dotca
I called them crashes, but to be precise they are CSS errors, or WooCommerce for example or other plugins that are out of date with the current version of WordPress or other plugins and therefore create incompatibilities.
For example, those who activated this function and had Divi or Elementors, in the first hours the site did not load the images correctly because the two builders were not yet updated to support lazy load by WP.
For this reason it is recommended to use external tools that perform the updates, there are many even free ones, which perform a backup before the automatic update and once the update has been performed they compare the CSS and the HTML to check is identical, if not then they will proceed to reverse the backup. -
@girish
I'm speaking of the new auto-update feature of WP, that is similar to use an auto-update script for packages on a rolling realize linux distro, is not a good idea in production. -
-
@d19dotca said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
Just a heads up to anyone on the Managed version who is hoping to take advantage of the built-in auto-updates for themes and plugins - it ain't working with he way the Managed app is configured.
@d19dotca What error did you see for this? Was this some cURL error?
I am debugging this bizzare error and was wondering if it's related to what you saw.
-
@girish That's an interesting one, I never saw that error in my quick test, but I wonder if that error only shows for a short period of time so maybe I missed it.
Mine just had a message about 2 hours from now it'll check again, and I knew there were updates to it as it showed it, but it didn't install them and when I checked 3 hours later since it was supposed to be done 2 hours later, it showed the next attempt was 11 hours from then (so basically it tries to check every 12 hours I guess), but no action was taken to install the update when it should have done it.
-
Actually, this seems like some plugin related issue. Because on the same instance I could update other plugins. I have asked our customer to contact the plugin author, I will update once he gets back.
-
@girish Yeah that seems like a different issue, so that's a good conclusion on that one. I'm still interested in knowing why the auto-update isn't working, did you see it work for you then? I have a sneaky suspicion this has to do with the WordPress cron doing it every 12 hours but I think since it's disabled and we run our own in this app (correct me if I'm wrong but I think the cron was handled differently than default), this may explain the discrepancy.
-
@d19dotca How can I test the auto updates? Install an old version of plugin and enable auto update and wait for a day?
cron shouldn't be a problem. Essentially, php apps are loaded by the server only when someone makes a page request. Some PHP apps (like WP) have a built-in "cron" module which checks if some cron task is due and runs it, but it can do this only when someone requests a page. If you have a reasonable traffic site, it will work out. But if someone doesn't visit your site for 4 hours, those cron jobs are not going to be run. The alternate solution (WP supported) is to disable this built-in cron and instead just run it using crontab or something outside the PHP/Apache. This is what we do.
-
@girish yes that should work.
Admin columns pro use private repo, the new autoupdate feature will overload the repo-server, because it try to update all the server in that time zone at the same time.
That may be the cause of the timeout of curl request.But normally if u try to update it manually should work
-
@girish Good question. My test was I had a plugin that was out-of-date (it coincidentally was at the time of WordPress 5.5 update), and as soon as I noticed it I set it to be enabled for auto-updates, and it gives a message saying at that time it'd be done in 2 hours, but it didn't do it and the counter reset afterwards to 11 hours (would have been 12 if I checked on time though).
So to test I would think your proposal would work, uploading an out-of-date plugin, check for updates to verify it recognizes an update is available, then enable the auto-update on that particular plugin and see if it updates automatically by WordPress.
For the cron part, you are likely correct - I am not intimately familiar with that level since moving to Cloudron for the app package, but I assumed this may be an issue because I thought the app package is calling the cron every 1-5 minutes, but yet the WordPress item is saying every 12 hours, so it seemed like a discrepancy and thus a possible issue. Plus the "disable core updates" plugin is there too which I felt may also interfere from auto-checks.
-
@MooCloud_Matt said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
https://www.wordfence.com/blog/2020/08/wordpress-auto-updates-what-do-you-have-to-lose/
A good overview (as one would expect from Wordfence), thanks.
-
OK, I waiting for Hello Dolly to auto-update in 12 hours to see what the error is. I couldn't figure an obvious way to trigger auto-updates immediately.
-
I was able to reproduce this. It looks like it triggers the cron event
wp_update_plugins
but that even does nothing.root@01d9cbb3-049c-4b99-b5e6-299ea3775d75:/app/code# exec /usr/local/bin/gosu www-data:www-data /app/pkg/wp --skip-themes cron event run wp_update_plugins Executed the cron event 'wp_update_plugins' in 0.007s. Success: Executed a total of 1 cron event.
-
@girish Is this a WordPress issue then in that case or to do with the way this is packaged in Cloudron?
-
@girish just wanted to follow-up on this. Any idea what could be causing this?
-
@d19dotca It's in my todo list, have to investigate but so it's not obvious yet what the issue is.
-
-
@jdaviescoates Good question! That won't be the root cause for me though I'm pretty sure as I don't have WordFence installed (or any security-related plugins really yet).
-
@jdaviescoates Yeah, same as @d19dotca for my setup as well. I don't have WordFence. Why does wordfence want FTP permissions anyway? Is it patching some code?
-
@girish it's for adding firewall rules to .htaccess
-
@jdaviescoates
Normally this kind of plugin for security they want to have access to all the WordPress to intervene if needed on all the WordPress root directory.
This message is form wp. Because WordPress it's self provide an interface not edit files and accessing data, when a plugin try to access the filesystem with the filesystem API and the API fail, will automatically ask for the credential of ftp.
But .htaccess is editable I think on managed too, so it's trying to do something in a read only directory on the image. -
@girish Hi Girish, Any updates on this one? Did we ever find what causes the auto-updates to not work?
-
@d19dotca This one has me totally stumped. It's crazy that there is no obvious way to test this. All the time it is "scheduled in 12 hours".
-
@girish Do we know if this works in Unmanaged? I haven't tried there, but if it works in Unmanaged... maybe that's one more reason to make Unmanaged the primary WordPress app package
haha I'll maybe try in Unmanaged over the weekend if it hasn't already been tried.
-
@d19dotca good question! I've just enabled auto-updates on a load of plugins (and the Twenty Twenty theme) on one of my Unmanaged sites so will report back...
-
@jdaviescoates This was before my time here. But if you successfully get the feature working on Unmanaged. I'll install Managed and see where the break lies. I use to dive into the Wordpress Core Code for fun so I should be able to find what it's trying to write to but can't and quits (most likely a log file, maybe a backup before updating - but you'd think those files would be written in
/uploads
which is writeable. -
@jdaviescoates said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
@d19dotca good question! I've just enabled auto-updates on a load of plugins (and the Twenty Twenty theme) on one of my Unmanaged sites so will report back...
Works!
-
@jdaviescoates You're on unmanaged, right? If you are, I'll look into it on Managed to see if I can find the break. My actual expertise is Wordpress so I want to make WP a first class citizen on Cloudron as much as possible!
️
-
@Lonk said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
@jdaviescoates You're on unmanaged, right?
Correct.
@Lonk said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
If you are, I'll look into it on Managed to see if I can find the break. My actual expertise is Wordpress so I want to make WP a first class citizen on Cloudron as much as possible! ️
Great
-
@Lonk That'd be awesome! I hope to learn lots from you over time, haha. I'm very comfortable with WordPress but not quite at the "development" level. So this sounds great if we can learn later what the root cause was (assuming you find one).
-
@d19dotca said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
@Lonk That'd be awesome! I hope to learn lots from you over time, haha. I'm very comfortable with WordPress but not quite at the "development" level. So this sounds great if we can learn later what the root cause was (assuming you find one).
Thanks for the encouragement. Now that I feel Comfortable with Docker / Cloudron / Docerode / Networking / etc, I'll solely be focusing on making Wordpress better in every way I can. I used Wordpress for 10 years as a developer and I really loved it, so getting to help architecture the platform around it to make it run more efficiently / be easier for other's to use, I'm excited to do for this community (whom I feel has given me a lot of support when building my first app).
-
@Lonk @girish So what was the fix for this btw, assuming you found one? Just curious because in the other thread I see the feature parity of plugin auto-updates working, so assumed someone found the root cause for that?
-
-
@d19dotca The issue had to with the plugin that was disabling automatic update of WordPress. I had initially removed the plugin since it disappeared from wordpress.org as well as reported here - https://forum.cloudron.io/topic/3114/wordpress-issue-the-plugin-disable-wordpress-core-updates-has-been-removed-from-wordpress-org . To fix that, I wrote a custom plugin which also has some issue I guess. In any case, I just removed the plugin now, it's not really needed.
-
I just installed a brand new domain and wanted to install Wordpress Managed
it all goes fine but when I want to upgrade WP to latest version, I'm being asked for FTP credentials ?
no matter what I use it does not work, WP won't upgrade itself.
I don't have this bug in any of my other WP managed installs..
I read this thread but now I'm even more confused on what's happening here..
Anyone managed to upgrade WP in the end ? -
@girish said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
@d19dotca The issue had to with the plugin that was disabling automatic update of WordPress. I had initially removed the plugin since it disappeared from wordpress.org as well as reported here - https://forum.cloudron.io/topic/3114/wordpress-issue-the-plugin-disable-wordpress-core-updates-has-been-removed-from-wordpress-org . To fix that, I wrote a custom plugin which also has some issue I guess. In any case, I just removed the plugin now, it's not really needed.
So Managed now can enable automatic updates? Or maybe I’m confused - why isn’t it needed anymore?
-
@rmdes said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
it all goes fine but when I want to upgrade WP to latest version, I'm being asked for FTP credentials ?
You cannot update WordPress with the managed version. It's asking for FTP creds because the filesystem is read only. We will push an update to WP 5.5.3 in the coming day or two.
Some technical info: In previous managed cloudron packages, it won't show the update UI. This was because we had a custom plugin that blocked updates. Unfortunately, that plugin also blocked plugin auto updates. I had removed it so that automatic updates of plugins work in Managed WP. That removal has the side effect that you see update WP UI...
-
Oh I understand now, thanks for the explanation
-
@rmdes I have pushed a 5.5.3 package some time back
-
@girish But why is the disable plugins not needed anymore, is it hard coded somewhere else (like in wp-config.php)?
-
It's fixed over here, thanks a lot !!
-
Can the custom blocking plugin be modified to block core updates but allow other plugin auto-updates?
-
@robi said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
Can the custom blocking plugin be modified to block core updates but allow other plugin auto-updates?
I believe that’s what he did.
-
@Lonk said in WordPress 5.5 auto-updates not working in Managed version, likely due to core updates blocked.:
I believe that’s what he did.
Unfortunately, no. Since, I am not a WP dev, I couldn't figure out how to just disable core updates and keep plugin updates enabled. So, I disabled the plugin altogether. https://git.cloudron.io/cloudron/wordpress-managed-app/-/commit/08e6cf17a24e047806f4846bf1083b33c40642d6 is the plugin we previously had. If you know how to disable just core updates but not plugin updates, let me know and I can put that plugin back in.
-
Since this plugin was before the WP auto-update functionality, it may make sense to rethink how to do this now.
Allow all updates, but filter out only the core and hide the auto-update option from core to maintain the desired effect.
-
I'm having this issue again, but not on all my WP's, I'm so confused right now, I don't even know what's happening, but it's asking for credentials again instead of updating from cloudron packages, I'm on managed, I even tried to install a clean new WP and restore my backup from my old WP (also managed) and guess what : exact same problem, can't upgrade, asking for credentials..even though the WP managed app just got installed and is supposed to be last version ?
What's going on here ?
-
@rmdes what kind of credentials is who asking for?
-
@nebulon It's asking FTP credentials on all my WP managed, maybe it's just because there is a new version but not yet packaged ?
-
@rmdes on the managed app, you cannot update WP. It will behave similar to what you faced i.e it will ask for credentials. This is because WP figures that it cannot write to the code directory and falls back to uploading code via FTP (a behavior I really dislike but I don't think this can be disabled).