Easyadminbundle: Script cache:clear returned with error code 255 on install

Created on 22 Jun 2020  路  8Comments  路  Source: EasyCorp/EasyAdminBundle

Hi all,

I am running Symfony 5.1 on a digitalocean (2gb mem, 25gb storage), ubunto 18.04., nginx setup. Everything works perfectly fine. Now, when try to run "composer require easycorp/easyadmin-bundle" I receive a "Script cache:clear returned with error code 255" error. Attached the terminal error code.

Any idea why this is happening? Any help is highly appreciated..

Thanks!
Marc
Bildschirmfoto 2020-06-22 um 14 53 06

UPDATE:
I removed the line
"cache:clear": "symfony-cmd"
from scripts within my composar.json file and now the script fails at
Executing script assets:install public [KO] [KO] Script assets:install %PUBLIC_DIR% returned with error code 255
Bildschirmfoto 2020-06-22 um 15 22 45

bug

Most helpful comment

Awesome - thanks @BaptN

Just for me being a dumbdumb:
First I go the regular route via
composer require easycorp/easyadmin-bundle

Then the old EasyAdminController.php will cause the error.

Then I go and change my composer.json adjusting it with what you wrote.

Then I run
composer update -vvv

and it should work?

Plus, once there is a official bug-fix, I remove the part I added to the composer.json and rerun
composer update -vvv

Correct?

All 8 comments

Hi,

I initially deployed symfony5 and EasyAdmin3 over php 7.3, and had no problem. However, I had today to downgrade to php 7.2, and after that I see this same error popping everywhere (cache:clear, any webpage, etc).

Looks like php 7.2 is very un-happy with the heredoc syntax in file Controller/EasyAdminController.php.

One solution is to fork this repo, edit the file Controller/EasyAdmin.php and remove the whole HEREDOC (it's just here to talk you about migration, anyway).

One better solution is by the way to start today talking about migration to 7.3, as official end of security support for 7.2 is planned for november :)

Hi @BaptN,

Thanks for the speedy reply.

It鈥檚 really just for a small application and i do not want to spend a whole lot of time. That is essentially the reason why i wanted to use easyadmin ;)

What would you suggest to do in order to get it working?

I am fairly new to Symfony and would not know how to proceed with any of the two suggested routes without help..

Thanks so much
Marc

I had some kind of deadline today too, so I went with the dirty solution ;)

I created https://github.com/BaptN/EasyAdminBundle , as a fork of this repository.

Then, edited the file "src/Controller/EasyAdminController.php", getting rid of the problematic HEREDOC.
Then, in my composer.json file, I added :

`
{

.....

"repositories": [
    {

        "type": "vcs",

        "url": "https://github.com/BaptN/EasyAdminBundle"

    }

],
"require": {
   ...
    "easycorp/easyadmin-bundle": "dev-master",
  .....
 }

}
`

After this, re-type composer update, and it's enough to replace the EasyCorp version of the repository with the forked one. Composer can however be quite slow to rebuild the metadata it needs from a custom VCS, but you can type composer update -vvv to see what happens.

You can use my fork if you want, but keep in my this is very temporary ! I'm sure this will be fixed directly here soon. When it's effectively fixed, just remove the "repositories" part of your file composer.json, launch composer update again, and things will be back to normal.

Awesome - thanks @BaptN

Just for me being a dumbdumb:
First I go the regular route via
composer require easycorp/easyadmin-bundle

Then the old EasyAdminController.php will cause the error.

Then I go and change my composer.json adjusting it with what you wrote.

Then I run
composer update -vvv

and it should work?

Plus, once there is a official bug-fix, I remove the part I added to the composer.json and rerun
composer update -vvv

Correct?

Thanks @BaptN - I ran it and this flipping Script cache:clearis throwing a KO again...any thoughts?
Bildschirmfoto 2020-06-23 um 09 00 28

I'm sorry about this issue. I'm going to release a maintenance version today with this fix.

Ah great, @javiereguiluz - this means tomorrow I can "just" run composer require easycorp/easyadmin-bundle and should work?

@osinho yes! The new 3.0.1 version is now released: https://github.com/EasyCorp/EasyAdminBundle/releases/tag/v3.0.1

Thank you all for reporting and fixing this bug!

Was this page helpful?
0 / 5 - 0 ratings