Errors on Production unless I run composer install on server

Weird bug. I’ve moved a Bedrock install from one Trellis install into another. I have three Bedrock sites on this server and two run fine.

The latest one I’ve added though, throws function ... not found errors with some plugins (ACF and GADWP) on some pages, like editing posts or viewing the dashboard.

If I SSH into production, delete the plugin and run composer install it will install the plugin again and the site works fine. But then breaks again if I ever do a deploy.

I’m guessing it’s some sort of permissions issue? The plugins are there, they just aren’t read properly on Production.

Any ideas?

What are the permissions before it doesn’t work? After you fix it, what are the permissions?

I’ve had a few issues w/ Composer getting “confused,” although I’m not sure they were related to permissions. You might try kind of “cleaning things out” as per this solution to an entirely different issue.

Yeah permissions was just a bit of a guess. It looks like the permissions are the same whether I install the plugins via composer on deploy, or manually via ssh.

And it’s not that issue either. I did a full new bedrock install on it today and same issue. Two plugins that throw errors about missing functions if they’re installed on deploy, that disappear if installed manually.

I’ve run composer clearcache on the server too. No effect.

This particular site was on a trellis server that used php7.2, and is now on one that uses 7.1… but I wouldn’t think that’s the issue? Works without problem on development.

You’ve checked for the existence of the plugins after deploy, have you checked for the existence of the actual files containing the missing functions? I feel like this happened to me once or twice, although I can’t remember how I solved it. :confused:

If you’re moving versions of PHP but using the same composer.lock file I feel like that could possibly cause an issue?

My next step would probably be to start looking at the Trellis roles/tasks you’re using to run Composer and double-checking everything there. IIRC Trellis does a little big of copying stuff around w/r/t Composer to try and slim down update times, maybe things aren’t getting copied correctly?

Solution: the web/wp folder was being committed to the git repo