/var/www/discourse/lib/plugin_guard.rb:10:in `initialize': undefined method `exists?' for File:Class (NoMethodError)
However, looking at the code this was already fixed here, and when I check out the code manually then it has the fix…?
So I am a bit lost. I am using /usr/local/bin/discourse_rebuild but where does it copy the code to /lib/plugin_guard.rb ? And where does the old code come from?
The way the plugin guard works is that it copies the plugin files into the container prior to any other code being run. This allows it to catch all plugin errors regardless of their source or load order. It uses pups templates to do this. Check out the template in the guard code
You’ll see it’s loaded in the app.yml file of the canary server
If you look at the template you’ll see it’s copying the files from a repo cloned into /shared/discourse-plugin-guard. So go to that repo on the server and do a git pull to see if it’s up to date.
Sorry, should have PR’d these in one go but I didn’t realise the extent of the issue on that occasion.
We already have a script to update the plugin guard as part of the build process which you can
invoke manually as a one-off after plugin-guard has received a significant fix.
That is good practice: fix plugin guard, then run the update script on both servers.
Apologies, I actually upon fixing the plugin guard, I updated it on tests-passed canary and tried to access the stable canary, failed and gave up a couple of weeks ago. I didn’t pursue it at the time as stable was behind.
The reason this has hit Stable now is I suspect the version of Ruby just switched to catch up with tests-passed.