8000 Script cache:clear returned with error code 255 · Issue #26730 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Script cache:clear returned with error code 255 #26730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
samayo opened this issue Apr 1, 2018 · 10 comments
Closed

Script cache:clear returned with error code 255 #26730

samayo opened this issue Apr 1, 2018 · 10 comments

Comments

@samayo
Copy link
samayo commented Apr 1, 2018
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 4.0

I apologize for the words I choose in advance, am a bit tired and frustrated, this is my 6-7th time since 2014 I'm trying to install this framework but everytime something keeps breaking during the process, I can barely reach the hello world page.

last time I tried it was in Jan, 2017

I tried to give it a final try today, but I can't get past the install phase.

I am using Symfony 4, Composer 1.6.3 and PHP 7.2

These are the "exact" commands I ran to get the error.

composer create-project symfony/website-skeleton my-project
cd my-project
composer require server --dev

This time its faster, it broke just in 3 steps.

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!
!!  Warning: Uncaught ErrorException: Warning: require(/var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory in /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php:356
!!  Stack trace:
!!  #0 /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php(356): require()
!!  #1 /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php(497): ContainerONNi8Yj\srcDevDebugProjectContainer->load('/var/www/lab/fr...')
!!  #2 /var/www/lab/frameworks/my-project/vendor/symfony/event-dispatcher/EventDispatcher.php(229): ContainerONNi8Yj\srcDevDebugProjectContainer->ContainerONNi8Yj\{closure}()
!!  #3 /var/www/lab/frameworks/my-project/vendor/symfony/event-dispatcher/EventDispatcher.php(61): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.error')
!!  #4 /var/www/lab/frameworks/my-project/vendor/sym in /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php on line 356
!!
!!  Fatal error: ContainerONNi8Yj\srcDevDebugProjectContainer::load(): Failed opening required '/var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php on line 356
!!  PHP Warning:  Uncaught ErrorException: Warning: require(/var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/getSwiftmailer_EmailSender_ListenerService.php): failed to open stream: No such file or directory in /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php:356
!!  Stack trace:
!!  #0 /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php(356): require()
!!  #1 /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php(497): ContainerONNi8Yj\srcDevDebugProjectContainer->load('/var/www/lab/fr...')
!!  #2 /var/www/lab/frameworks/my-project/vendor/symfony/event-dispatcher/EventDispatcher.php(229): ContainerONNi8Yj\srcDevDebugProjectContainer->ContainerONNi8Yj\{closure}()
!!  #3 /var/www/lab/frameworks/my-project/vendor/symfony/event-dispatcher/EventDispatcher.php(61): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.error')
!!  #4 /var/www/lab/frameworks/my-project/vendor/sym in /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php on line 356
!!  PHP Fatal error:  ContainerONNi8Yj\srcDevDebugProjectContainer::load(): Failed opening required '/var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/srcDevDebugProjectContainer.php on line 356
!!  05:18:30 CRITICAL  [php] Fatal Compile Error: ContainerONNi8Yj\srcDevDebugProjectContainer::load(): Failed opening required '/var/www/lab/frameworks/my-project/var/cache/dev/ContainerONNi8Yj/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.:/usr/share/pear:/usr/share/php') ["exception" => Symfony\Component\Debug\Exception\FatalErrorException { …}] []
!!
!!  In srcDevDebugProjectContainer.php line 356:
!!
!!    Compile Error: ContainerONNi8Yj\srcDevDebugProjectContainer::load(): Failed
!!     opening required '/var/www/lab/frameworks/my-project/var/cache/dev/Contai
!!    nerONNi8Yj/getSwiftmailer_EmailSender_ListenerService.php' (include_path='.
!!    :/usr/share/pear:/usr/share/php')
!!
!!
!!  cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

The error is persistent, from restarting server to laptop doesn't fix it.

If I try to run the built-in server with php bin/console server:run it says the server is listening, and all is ok.:

[root@localhost my-project]#  php bin/console server:run

[OK] Server listening on http://127.0.0.1:8000

// Quit the server with CONTROL-C.

PHP 7.2.2 Development Server started at Sun Apr  1 02:01:09 2018
Listening on http://127.0.0.1:8000
Document root is /var/www/lab/frameworks/my-project/public
Press Ctrl-C to quit.

But when I visit http://127.0.0.1:8000 or http://localhost:8000 I get ERR_CONNECTION_REFUSED as if it's not working. And the port is free, I have no application using it.

I'm not really interested in using Symfony beyond this point so I'm not asking for solution, I just want to say all these issue originate including a vast amount from this github page are from the caching part/module ... my question is, why is caching really important to the point it renders the entire application dysfunctional? Which one is more important caching or the framework?

@Simperfit
Copy link
Contributor
8000 Simperfit commented Apr 1, 2018

I don't think the problem is the same for everyone, I just tried using the same command with my laptop with the same version of all the component as you and it works, just tried in a docker container too and it works.

Do you mind trying with a docker container to maybe identify a problem on the machine running the commands ? (or a vagrant box if you don't like docker). It seems to me that's you have a rights problem and the container can not required files.

@Simperfit
Copy link
Contributor

Status: Waiting feedback

@xabbuh
Copy link
Member
xabbuh commented Apr 1, 2018

@samayo would you be willing to help us debugging why this is failing for you? Otherwise, I suggest to close here as we will then not be able to fix it.

@linaori
Copy link
Contributor
linaori commented Apr 1, 2018

I'm not really interested in using Symfony beyond this point so I'm not asking for solution, I just want to say all these issue originate including a vast amount from this github page are from the caching part/module ... my question is, why is caching really important to the point it renders the entire application dysfunctional? Which one is more important caching or the framework?

Building the container in a bigger application can take around 6~8 seconds, so you don't want this each and every request (which is where the error is coming from). As I do not work on Windows, I can't comment much on this, but have you checked the permissions of the webserver and the files? If this was a more common error, it would've surely popped up far more often on any of the support channels as well.

@NavyCoat
Copy link
NavyCoat commented Apr 1, 2018

I have this problem on 3.4 and 4.0.6. PHP7.1
But after installing these packages:
composer require --dev symfony/browser-kit symfony/css-selector

After this I've received:

vagrant@vagrant:/vagrant$ composer require --dev symfony/browser-kit symfony/css-selector
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
ocramius/package-versions:  Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 255
!!  PHP Warning:  Uncaught ErrorException: Warning: require(/vagrant/var/cache/dev/ContainerKhg1szm/getConsole_ErrorListenerService.php): failed to open stream: No such file or directory in /vagrant/var/cache/dev/ContainerKhg1szm/srcDevDebugProjectContainer.php:114
!!  Stack trace:
!!  #0 /vagrant/var/cache/dev/ContainerKhg1szm/srcDevDebugProjectContainer.php(114): require()
!!  #1 /vagrant/var/cache/dev/ContainerKhg1szm/srcDevDebugProjectContainer.php(155): ContainerKhg1szm\srcDevDebugProjectContainer->load('/vagrant/var/ca...')
!!  #2 /vagrant/vendor/symfony/event-dispatcher/EventDispatcher.php(229): ContainerKhg1szm\srcDevDebugProjectContainer->ContainerKhg1szm\{closure}()
!!  #3 /vagrant/vendor/symfony/event-dispatcher/EventDispatcher.php(61): Symfony\Component\EventDispatcher\EventDispatcher->sortListeners('console.error')
!!  #4 /vagrant/vendor/symfony/event-dispatcher/EventDispatcher.php(43): Symfony\Component\EventDispatcher\EventDispatcher->getListeners('console.error')
!!  #5 /vagrant/vendor/symfony/console/Application.php(889): Symfony\Compone in /vagrant/var/cache/dev/ContainerKhg1szm/srcDevDebugProjectContainer.php on line 114
!!  PHP Fatal error:  ContainerKhg1szm\srcDevDebugProjectContainer::load(): Failed opening required '/vagrant/var/cache/dev/ContainerKhg1szm/getConsole_ErrorListenerService.php' (include_path='.:/usr/share/php') in /vagrant/var/cache/dev/ContainerKhg1szm/srcDevDebugProjectContainer.php on line 114
!!  2018-04-01T16:24:52+00:00 [critical] Fatal Compile Error: ContainerKhg1szm\srcDevDebugProjectContainer::load(): Failed opening required '/vagrant/var/cache/dev/ContainerKhg1szm/getConsole_ErrorListenerService.php' (include_path='.:/usr/share/php')
!!
!!  In srcDevDebugProjectContainer.php line 114:
!!
!!    Compile Error: ContainerKhg1szm\srcDevDebugProjectContainer::load(): Failed
!!     opening required '/vagrant/var/cache/dev/ContainerKhg1szm/getConsole_Error
!!    ListenerService.php' (include_path='.:/usr/share/php')
!!
!!
!!  cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
!!
!!

Catalog ContainerKhg1szm is empty.

Composer.json

"require": {
        "php": "^7.1.3",
        "ext-iconv": "*",
        "nocarrier/hal": "^0.9.12",
        "sensio/framework-extra-bundle": "^5.1",
        "symfony/console": "^4.0",
        "symfony/flex": "^1.0",
        "symfony/framework-bundle": "^4.0",
        "symfony/lts": "^4@dev",
        "symfony/orm-pack": "^1.0",
        "symfony/routing": "^4.0",
        "symfony/yaml": "^4.0"
    },
    "require-dev": {
        "doctrine/doctrine-fixtures-bundle": "^3.0",
        "symfony/browser-kit": "^4.0",
        "symfony/dotenv": "^4.0",
        "symfony/phpunit-bridge": "^4.0"
    },

@xabbuh
Copy link
Member
xabbuh commented Apr 1, 2018

@NavyCoat Does it change anything if you move the location of the cache to a directory that is not synced with your host system?

@NavyCoat
Copy link
NavyCoat commented Apr 2, 2018

@xabbuh Hm, it works.

@xabbuh xabbuh closed this as completed Apr 3, 2018
@samayo
Copy link
Author
samayo commented Apr 13, 2018

@xabbuh how do you even 'move' the cache to another location? It's already part of the Symfony app, wouldn't that break things?

@xabbuh
Copy link
Member
xabbuh commented Apr 13, 2018

You can change the directory by changing the getCacheDir() method of the application's kernel.

@samayo
Copy link
Author
samayo commented Apr 13, 2018

Thanks, but to where? Also, I thought the Kernel should not be altered like that. Is there some guide or blog about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0