-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[master] Commands with --env=test throw exceptions #4626
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
Comments
when updating symfony, you need to remove your cache entirely. The serialization of the resources is not BC as it implements the Serializable interface. |
After having this issue, I removed the repo and got a fresh copy (so with an empty cache), but I still had the issue. Thanks for the tip and sorry for the inconvenience. |
The issue is still there and is real. Example: php app/console clear:cache # Good
php app/console --env=dev # Exception!
rm -rf ./app/cache/* # Solve
php app/console clear:cache --env=test # Good
php app/console --env=dev # Good
php app/console --env=test # Exception! |
The problematic code has been reverted for now. |
I'm not being able to reproduce the exception with an clean install. PHP 5.3.8 (32bit TS) on Windows 7. No, still no exception thrown. |
The complete series of command I executed: # Worked fine
php composer.phar self-update
php composer.phar update --dev
php app/console assetic:dump --no-debug --env=test
# Exception
php app/console cache:clear --env=test
# skipped
php app/console doctrine:database:drop --force --env=test
php app/console doctrine:database:create --env=test
php app/console doctrine:schema:update --force --env=test
php app/console widop:fixtures:load --env=test But as said above, I could clearly reproduce the bug by running the command System: PHP 5.4.4, Ubuntu 12.04. |
No exception on Windows (tried both 5.3 and 5.4). The problem does not seem to come from the serialize() in FileResource as this serialize() result is just fine. I think I got it. The file [...]/app/cache/test_new/kernel.tmp is serialized and valid. The ;}i5 is part of another serialization (as its nested), this is causing a chain reaction and making everything fail. |
GOT GOT GOT IT!! Changing this line in FileResource $this->resource = file_exists($resource) ? realpath($resource) : $resource; To the old version $this->resource = realpath($resource); Fixes the exception. |
ping |
@sstok I know this is an old issue, but do you still remember how to reproduce it and verify if we need to do anything about it? |
From what I remember, when the cache is warmed (with an existing one in place) the directory gets appended with Why always using the realpath() function prevents this is a bit of mystery. It wasn't really at the place you'd except the failure so it was a challenge to find it 💃 |
Ok, this should be fixed by #7360 which changed the renaming strategy. We don't append _new anymore, but replace the last character with ___ instead. This way the length is the same. |
I haven't encountered this bug for a while and assumed it was fixed, but I forgot about this issue. Should I close it? |
Yeah, should be fixed by #7360. Feel free to reopen it if you encounter this issue again. |
After updating my dependencies this morning with composer ("symfony/symfony": "2.1.*"), I figured out that every commands using the option "--env=test" would throw the following exception:
After putting a nice
var_dump($serialized);
inFileResource::unserialized()
, and running different commands we can see that the content of$serialize
causing this exception is the following one:s:59:"[...]/app/cache/test/kernel.tmp";}i:1
This "}i:1" looks particulary suspicious to me.
Anyone having the same trouble?
The text was updated successfully, but these errors were encountered: