Plugin installation not completed on first attempt (Moodle 4.5.3+)
I'm using a clean installation of Moodle 4.5.3+ (same on 5.0.0-rc1) and testing with Moosh 1.27. When I try to install a plugin using moosh plugin-install, it appears in the plugin overview as "To be installed", but there's no way to continue the installation via the Moodle UI or Moosh.
If I re-run the same command with the --delete (-d) option, the plugin then installs correctly.
Example:
/var/www/html $ moosh plugin-install availability_ipaddress
Installing
name: availability_ipaddress
version: 2025040401
Done
At this point, the plugin is shown in Moodle as "To be installed", but cannot be configured or completed.
Only after running:
/var/www/html $ moosh plugin-install -d availability_ipaddress
Removing previously installed availability_ipaddress from /var/www/html/availability/condition/ipaddress
Installing
name: availability_ipaddress
version: 2025040401
-->availability_ipaddress
++ Success (0.02 seconds) ++
Done
…does the installation complete successfully.
Question:
Is this a known issue with the first-time plugin installation in recent Moodle versions? Could there be a change in Moodle's plugin installation process that's not handled correctly in Moosh 1.27?
Let me know if you need more debug output or a specific plugin to test with.
Thanks!
Just adding a note: the plugin installation also completes successfully if I run:
moosh module-reinstall availability_ipaddress
after the first plugin-install. So it seems that some step is missing in the initial install process.
Tested with the latest master branch of Moosh, on Alpine 3.20 with PHP 8.3. The issue still occurs.
Happy to provide more debug info or test further if needed.
Just noting that this might be related to #534, which was opened recently and describes a similar symptom: the plugin appears as "To be installed" after moosh plugin-install, but the installation doesn’t complete unless it’s deleted and reinstalled, or manually reprocessed via moosh module-reinstall.
I originally reported this behavior here (#520) a few months ago, and it’s still happening on clean Moodle 4.5.3+ and 5.0.0-rc1 installations.
Additionally, in my Alpine-based Moodle Docker setup (see https://github.com/erseco/alpine-moodle/issues/95), a user observed related failures caused by 403 errors from Moodle.org—likely due to Cloudflare blocking requests without a proper user agent.
Still, even with downloads working, plugin installation requires a second step to complete. This might suggest a change in Moodle’s install workflow that Moosh doesn’t fully handle yet.
Happy to help test further or provide more details if needed. Thanks!
Thanks everyone — I'm closing this now, as the root cause seems to be clarified through related issue #534.
The plugin installation problem was partly due to Cloudflare blocking requests without a proper User-Agent header, which was causing plugin-list and plugin-install to fail silently or leave plugins in an incomplete "To be installed" state. Setting a custom user agent resolved the 403 errors (see also erseco/alpine-moodle#95).
With that change in place, and a better understanding of how moosh plugin-install behaves in recent Moodle versions, I consider this resolved on my side.
Thanks again!