Composer update error - site down :(

I would like to update the plugin so I run Composer on the Vagrant box.

From my Trellis directory i run:
vagrant ssh
cd /srv/www//current
composer update

I received this error in the console

and when I tried to see the local website I see this :sob::sob::sob:

unfortunately, we need to go live tomorrow, is there a quick fix for this?

my composer file is this one:

i am sorry for this panic post, but as I said we are supposed to go live tomorrow :sob:

any help would be super helpful :pray:

A quick search for the error and you can see others with a similar issue. I know the versions are different but try the solutions there as they should be what you need.

Shouldn’t trellis check for HTTP 200 before permanently switching the current symlink to the new release?

Trellis does ensure composer install successful before symlink during deploy (i.e.: $ ./bin/
However, running composer install directly inside vagrant VM does not. because ansible is not being invoked.


i followed this solution

so I ran: ANSIBLE_TAGS=composer vagrant provision from my trellis local directory.

but I have still have the same errors:

( ! ) Fatal error: Uncaught Error: Class 'Dotenv\Dotenv' not found in /srv/www/ on line  *17*

( ! ) Error: Class 'Dotenv\Dotenv' not found in /srv/www/ on line  *17*

am I missing something?

what else I can try to do?

i tried also to remove the vendor directory from /site/ and running composer update again.

  1. From my Trellis directory: vagrant ssh
  2. cd /srv/www/<sitename>/current
  3. composer update

but i get a new error

  Could not delete web/wp/wp-admin/css/about-rtl.css:


any suggestion would be great :pray:

You could try deleting the web/wp directory manually. Composer should reinstall it.

thanks @MWDelaney for your reply, i tried also remove web/wp directory manually.

now the problem is ACF plugin, can I remove also this manually or I will lose something?

basically, I can remove all the directories manually, until the composer install will finish with a success message, or there is something that it is better to don’t delete manually?

looking at the console output, I am wondering if there is a problem with the cache.
is it normal that composer install these packages loading from cache?

many thanks

Obviously don’t delete any plugins or packages you maintain manually, but if all your plugins are managed with composer I say just blow away everything in vendor and plugins, run composer clear-cache and try composer install again.

@MWDelaney you are my hero :pray:
i finally have my development site working again, thanks for your suggestions, very helpful.

looking at the git unstaged files, the only thing that I changed is a line in the requirements.yml file in the trellis directory. (found this solution here)


Should I do the re-provision of the staging/production after this update?

For future reference, if anybody will run into the same problem, these are the steps. (thanks to @MWDelaney)

  1. For development , run this: ANSIBLE_TAGS=composer vagrant provision (see this topic)
  2. Manually delete the vendor folder, the web/wp and the plugins that you manage with composer
  3. From my Trellis directory: vagrant ssh
  4. cd /srv/www/<sitename>/current
  5. composer clear-cache
  6. composer update

This topic was automatically closed after 42 days. New replies are no longer allowed.