When running `composer drupal-rebuild`, the following error is returned:

Script Drupal\composer_manager\Composer\Command::rebuild handling the drupal-rebuild event terminated with an exception                               
  [InvalidArgumentException]                
  Required prefix configuration is missing  
CommentFileSizeAuthor
#4 2473969-4.patch945 bytesR.Muilwijk
#3 2473969-3.patch749 bytesjoshtaylor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Introduced in this core commit:

commit 4192117d5487c537355557c44ca6269d69b6c3fb
Author: Alex Pott <alex.a.pott@googlemail.com>
Date:   Sat Apr 18 12:27:32 2015 +0200

    Issue #2395143 by amateescu, Fabianx, Berdir, beejeebus, dashaforbes, larowlan, dawehner, catch, alexpott, neclimdul, yched, znerol, fgm, effulgentsia: YAML parsing is very slow, cache it with FileCache

This command doesn't boot Drupal, but includes ExtensionDiscovery manually.
ExtensionDiscovery can't parse the yaml files anymore because the yaml parser now requires the file cache to be setup in DrupalKernel, which we don't run at all.

Berdir’s picture

Call FileCacheFactory::setPrefix() with some value or set 'class' in the configuration to the null backend to skip it: FileCacheFactory::setConfiguration(['default' => ['class' => '\Drupal\Component\FileCache\NullFileCache']]);

You could open an issue to make that the default, not sure...

joshtaylor’s picture

Status: Active » Needs review
FileSize
749 bytes

Something like this?

R.Muilwijk’s picture

FileSize
945 bytes

The patch only runs on drupal-rebuild but should run on both drupal-update and drupal-rebuild.

jbrown’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #4 works for me for both drupal-update and drupal-rebuild.

Berdir’s picture

Looks good to me as well, this is not something that's worth to cache, especially since it's in cli anyway.

  • bojanz committed a878b02 on 8.x-1.x authored by Berdir
    Issue #2473969 by joshtaylor, R.Muilwijk, Berdir: composer drupal-...
bojanz’s picture

Committed, thank you all. Gave the commit credit to Berdir since he's the one who gave us the magic incantation ;)

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

  • bojanz committed 9694ad3 on 8.x-1.x
    Revert "Issue #2473969 by joshtaylor, R.Muilwijk, Berdir: composer...
bojanz’s picture

Status: Fixed » Reviewed & tested by the community

The core issue (#2395143: YAML parsing is very slow, cache it with FileCache) was reverted, so I had to revert this patch as well.

Waiting for the core issue to be recommitted.

Berdir’s picture

Aaaand it's in again :)

bojanz’s picture

Status: Reviewed & tested by the community » Fixed

The nice thing about reverts is that I can give attribution to multiple people :)

  • bojanz committed e5cced0 on 8.x-1.x authored by R.Muilwijk
    Issue #2473969 by joshtaylor, R.Muilwijk, Berdir: composer drupal-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.