8000 [Cache] Cannot redeclare class · Issue #21520 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache] Cannot redeclare class #21520

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
zogs opened this issue Feb 3, 2017 · 12 comments
Closed

[Cache] Cannot redeclare class #21520

zogs opened this issue Feb 3, 2017 · 12 comments

Comments

@zogs
Copy link
zogs commented Feb 3, 2017
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.3.x-dev

Hi,
After a simple upgrade from 3.2.* to 3.3.x-dev, the cache system does not work normally anymore.
After upgrade, with a empty cache, the first HTTP request create the cache directory correctly. But the second fail inexorably. Returning exactly this error

Compile Error: Cannot redeclare class Symfony\Bundle\SecurityBundle\Security\FirewallMap

I'm pretty sure this looks like to a case-sensitive problem, as my system run on windows with a Vagrant VM hosting debian 8. And this is a frequent problem with that configuration !

I'm not enough confortable with symfony intern mechanism to find the issue myself tough...

@linaori
Copy link
Contributor
linaori commented Feb 3, 2017

Have you removed the full cache? rm -rf var/cache

@zogs
Copy link
Author
zogs commented Feb 3, 2017

Absolutly. Same problem occuring.

@zogs
Copy link
Author
zogs commented Feb 3, 2017

Not sure if case-sensitive problem actually... The same problem persist even when i put the cache directory complely inside the debian file system...

@chalasr
Copy link
Member
chalasr commented Feb 3, 2017

Could you try to remove your var/bootstrap.php.cache?
If it doesn't work, try to remove your vendor directory and re-run composer install based on the lock.

@zogs
Copy link
Author
zogs commented Feb 3, 2017
  • removing var/bootstrap.php.cache
  • removing composer.lock
  • removing vendor/
  • run composer install

problem persist..

@xabbuh xabbuh added Cache and removed Cache labels Feb 3, 2017
@zogs
Copy link
Author
zogs commented Feb 3, 2017

Could this be related to the new Simple Cache system ?

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Feb 3, 2017

How does this relate to Cache?
But FirewallMap.php changed recently. Can you open it and swap the order of the two class declarations you'll find in it? Does it work better then?

@zogs
Copy link
Author
zogs commented Feb 3, 2017

I dont know, i thought the problem came from the cache system, as it can be writed once, but not re-writed.

With your suggestion, the error message remains but changes from FirewallMap to _FirewallMap that can't be redeclare etc...

@javiereguiluz
Copy link
Member

Not sure if it's related, but in the Symfony Demo app we had the same problem, but with "Cannot redeclare class Symfony\Component\HttpFoundation\Response". It was solved by #21184.

@chalasr
Copy link
Member
chalasr commented Feb 3, 2017

I can't reproduce the issue on OSX+debian with PHP7+.
So maybe this line should be removed indeed https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L116

@zogs
Copy link
Author
zogs commented Feb 3, 2017

@chalasr Removing the line did the trick !

I'm running PHP 5.6 by the way...

@chalasr
Copy link
Member
chalasr commented Feb 3, 2017

@zogs Thanks for confirming, fixed in #21521.

@javiereguiluz Nice catch, thanks!

fabpot added a commit that referenced this issue Feb 3, 2017
…ile (chalasr)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[SecurityBundle] Remove FirewallMap from classes to compile

| Q             | A
| ------------- | ---
| Branch?       | master
| Tests pass?   | yes
| Fixed tickets | #21520
| License       | MIT

Commits
-------

d109109 [SecurityBundle] Remove FirewallMap from classes to compile
@fabpot fabpot closed this as completed Feb 3, 2017
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

7 participants
0