Method Assetic\AssetWriter::getCombinations() does not exist exception on symfony2 deploy using capifony
Asked Answered
T

2

8

My deployment fail when calling:

cd /var/www/prod/releases/20130513164742 && php app/console assetic:dump --env=prod --no-debug

My setup worked fine yestertay but today I can't deploy it using the cap deploy command I checked by cloning the repo in my prod environment and executing php app/console assetic:dump --env=prod --no-debug (in dev mode), and it worked fine !

Any idea ?

 ** [out :: prod] executing "sh -c 'cd /var/www/prod/releases/20130513164742 && php app/console assetic:dump --env=prod --no-debug'"
 ** [out :: prod] PHP Deprecated:  getEntityManager is deprecated since Symfony 2.1. Use getManager instead in /var/www/prod/shared/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Registry.php on line 71
 ** [out :: prod] Dumping all prod assets.
 ** [out :: prod] Debug mode is off.
 ** [out :: prod] 
 ** [out :: prod] 
 ** [out :: prod] 
 ** [out :: prod]                                                                 
 ** [out :: prod]   [ReflectionException]                                         
 ** [out :: prod]   Method Assetic\AssetWriter::getCombinations() does not exist  
 ** [out :: prod]                                                                 
 ** [out :: prod] 
 ** [out :: prod] 
 ** [out :: prod] assetic:dump [--watch] [--force] [--period="..."] [write_to]
 ** [out :: prod] 
 ** [out :: prod] 

Edit:

after updating vendor on my git clone I get this error

www-data@Prod:~/prod/dev$ php app/console assetic:dump --env=prod --no-debug
PHP Catchable fatal error:  Argument 2 passed to Doctrine\Bundle\DoctrineBundle\ManagerConfigurator::__construct() must be an array, none given, called in /var/www/prod/dev/app/cache/prod/appProdProjectContainer.php on line 116 and defined in /var/www/prod/dev/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/ManagerConfigurator.php on line 35
Therewithal answered 13/5, 2013 at 16:59 Comment(5)
im getting the same issue. Did you update with composer today?Hoax
kriswallsmith/assetic got updated from alpha4 to beta1, github.com/kriswallsmith/assetic/issues/412Hoax
Yes ! since that it's broken ! Even in dev environment ! see my edit.Therewithal
@Hoax How can see whitch version I'm using in dev environment and How can I tell my composer stick to this version ?Therewithal
check composer.lock, search for assetic, should see the version. check my answer for telling it what version to stick toHoax
H
19

https://github.com/kriswallsmith/assetic/issues/412

Add "kriswallsmith/assetic": "v1.1.0-alpha4",

to your composer.json file, and update again

You'll want to change this when they fix the issue

EDIT:

For the record, moving to "symfony/symfony": "2.3.*" works now, without specifying the above

Hoax answered 13/5, 2013 at 17:33 Comment(1)
Dude I'm so thankful ! I was going crazy since 1 hour ! :DTherewithal
S
5

If someone still have probelm after add:

kriswallsmith/assetic": "v1.1.0-alpha4

probably you need to change version for symfony/assetic-bundle to 2.3.* (i have 2.1) and update again:

php composer.phar update

Sural answered 14/5, 2013 at 9:38 Comment(2)
With that Composer tells me that ascetic-bundle v2.3.0 requires kriswallsmith >= 1.1-beta1 which clashes with the requirement for 1.1.0-alpha4Aleksandropol
Same here, but once changed to 1.1.0-beta1 everything updated fine.Luckett

© 2022 - 2024 — McMap. All rights reserved.