1

I'm working on updating a Drupal 9 + CiviCRM installation which is managed with composer.

I'm staging the updates on a local VM copy of the site for testing prior to updating on the live instance, and running across errors when I try to run the update on the local VM (which has a setup scripted to match the AMI used by the live instance). Specifically, when running either composer update or a more detailed composer require civicrm/civicrm-{core,packages,drupal-8}:~5.51.1 --with-all-dependencies, I get a failure and abort with:

  - Downloading civicrm/civicrm-core:angular-file-upload (5.51.1)
  - Installing civicrm/civicrm-core:angular-file-upload (5.51.1): Extracting archive

In FileFinder.php line 30:
                                                                                                                                           
  opendir(/var/www/vhosts/{site}/vendor/civicrm/civicrm-core/bower_components/angular-file-upload/dist):
    failed to open dir: Operation not permitted                                                                                                               

The folder ...bower_components/angular-file-upload/ exists prior to starting the update (from 5.39) but the subfolder dist within it does not. I'm running the commands from within the VM guest as a user with full write permissions to the {site} folder. If I repeat the command after that failure, it reports

Extra file civicrm/civicrm-core:angular-file-upload has been locally overriden in bower_components/angular-file-upload. To reset it, delete and reinstall.

...then proceeds to fail the same way for ..bower_components/angular-unsavedChanges/demo, and so on.

Any suggestions at all?

One more thing: The /var/www/ folder is shared from the VM Host. If I run the composer command from the site root on the Host the update completes correctly. This seems to point to permissions on the Guest, but I can't see the issue. (I'm restoring in full from backup prior to each composer update, so testing against a common start.)

1
  • I would not call this exactly a composer issue - it's running into trouble with the civicrm specific composer plugin that grabs files from a tarball and manually adds them. i.e. it's not a standard composer type thing, but a sort-of-workaround you could say. So it might not be supported by the filesystem for example. I'd guess it's some kind of file permissions thing, ie. the user running composer has be to able to create directories. As an experiment, you could try manually creating that folder before running the composer install.
    – Alan Dixon
    Commented Aug 2, 2022 at 21:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.