Roots Discourse

Bedrock Deployments - Missing plugins and theme/resources

Hi guys,

This might be a noob question, and it probably is. So I’m trying to deploy a Bedrock site into a staging environment.

I’m using DeployHQ, and when I visit my site, I get a blank screen. I am able to navigate to wp/wp-admin and login, however, all my plugins aren’t there and I get a whole bunch of:

“[plugin] has been deactivated due to an error: Plugin file does not exist.”

Also when I try to view the theme in “Appearance” I get " [themename]/resourcesVersion: false"

I’ve got “composer install” as part of the build when deploying, and I have .env file with the staging database info. Not sure what else I am missing.

Any help would be much appreciated!

Thanks in advance,
Nathan

  1. Can you SSH into your server and see if the files it complains about are there or not?
  2. Are all your plugins in your site’s composer.json file?
  3. What’s the log output of your build process? Are there any errors?
  4. Is composer update being run in the right location?

(This is likely unrelated to your problem, but generally in deployment you want to run composer install not composer update. update will increase the version on everything it tracks to the highest allowable version within whatever constraints you’ve defined; install will install exactly the versions locked in your composer.lock, which is what you want for a deploy–predictable output w/r/t to your dependencies.)

Thanks for your quick reply!

I can see that my plugins are on the server. With that being said, I should mention that the plugins are inside the web/app/plugins directory. You mention they should be in my composer file, and since I am not sure, I doubt they are, as locally I have been copying the plugins I need straight into the web/app/plugins directory.

Regarding composer update, sorry I should say, I have composer install as the build command on deploy, and that’s being run from the Bedrock root.

Cheers,
Nathan

You shouldn’t be copying plugins manually; you should be tracking them with composer. Composer can’t install what it isn’t tracking. Please read the following:



Thanks for pointing me in the right direction. I’ll get to resolving. Cheers!

Might be a dumb question, but how is it that it works locally with the theme and plugins now managed via Composer?

Hey Nathan ! I ran into the same questions when I first moved from my dev environment to Staging. I do not know why they are managed by composer on staging/prod, however I do know that a simple way to get those plugins onto your staging or production site is:

SSH into the staging/production server
navigate to /srv/www/<your-site-url>/current
run the command composer require wpackagist-plugin/<plugin-name>

this will install the plugin ! Another solution (not sure if this is best practice, I am also a newbie) is to edit the .gitignore file in your site’s github repository. Mine had /plugins listed, meaning that the plugins folder was NOT being committed to my github repository, and therefore my staging site (which was pulling from that github repository) did not have any plugins installed.

Hopefully this was helpful to someone reading in the future.

Plugins are also intended to be managed locally with composer, not just on staging & production. The reason for this is some that plugins can be tracked as dependencies of your larger “application,” keeping behavior, etc, consistent across environments. The philosophy behind this is explained here: https://roots.io/twelve-factor-02-dependencies/ I strongly recommend reading all the articles in the “12-Factor App” series; they’ll illuminate a lot of the design decisions behind by the roots stack works the way it does, and why it does the things it does.

Thanks so much @alwaysblank - I will do some reading to educate myself on the beloved Root stack! super.