Skip to content
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

[Cache] Fatal error: Interface 'Psr\SimpleCache\CacheInterface' not found #31720

Closed
andrzej-dunowski opened this issue May 30, 2019 · 14 comments
Closed

Comments

@andrzej-dunowski
Copy link

After upgrade from v4.2.9 to v4.3.0

Fatal error:  Interface 'Psr\SimpleCache\CacheInterface' not found in /var/www/clients/client1/web107/private/vendor/symfony/cache/Simple/AbstractCache.php on line 28

Helps

composer require psr/simple-cache

@nicolas-grekas
Copy link
Member

Correct: we removed the dependency from symfony/cache so you need to declare it explicitly in your app now. Maybe worth a CHANGELOG/UPGRADE entry? Would you mind sending a PR doing so?

@derrabus
Copy link
Member

What troubles me a bit is that Symfony 4.2 applications that don't use the PSR interface directly suddenly fail after the upgrade, for instance when instantiating (the now deprecated) Symfony\Component\Cache\Simple\FilesystemCache.

@andrzej-dunowski
Copy link
Author

My application used Simple Cache, which is now deprecated.
I corrected it, according to Cache Contracts.

I think that while Simple Cache exists, psr/simple-cache should exist in dependencies.

@derrabus
Copy link
Member

I think that while Simple Cache exists, psr/simple-cache should exist in dependencies.

Either that or we need to make sure that the deprecated classes remain usable without the PSR interface.

@nicolas-grekas
Copy link
Member

Oh, it's already in the changelog and upgrade files, all good on my side, there is no other way I know about.

@nicolas-grekas
Copy link
Member

make sure that the deprecated classes remain usable without the PSR interface

that's not possible, as the very purpose of the classes in the Simple namespace is to pass the psr/simple-cache type hints.

@derrabus
Copy link
Member

the very purpose of the classes in the Simple namespace is to pass the psr/simple-cache type hints.

Fair enough. In the project where I fixed this issue a couple of days ago, the developers just used FilesystemCache standalone because it's a cache that did what they needed it to do. They didn't really care about the fact that it implemented the PSR interface.

I might have missed the discussion on the topic, but would it be that problematic to keep the dependency for now and remove it together with the deprecated implementations in 5.0? I get the impression that the upgrade path might be smoother that way since developers would get a proper deprecation notice instead of a fatal error.

@nicolas-grekas
Copy link
Member

That'd smoothen for ppl that move to 4.3 and do the change before 4.4. Thus it wouldn't change the core process. But we can yes.

@nicolas-grekas
Copy link
Member

Closing as "not a bug". We can smoothen, but the more we wait the less an issue this is :)
This also matches our policy regarding dependencies.

@Jean85
Copy link
Contributor

Jean85 commented Jun 12, 2019

@nicolas-grekas isn't that a breaking change though? We are upgrading from the previous minor, and our apps are breaking due to this change...

@teohhanhui
Copy link
Contributor

Mysterious failure on AppVeyor: https://ci.appveyor.com/project/dunglas/dunglasapibundle/builds/25778904#L340

Something different about Windows, I suppose.

@derrabus
Copy link
Member

derrabus commented Jul 5, 2019

@teohhanhui Could be a variant of #32395

@teohhanhui
Copy link
Contributor

teohhanhui commented Jul 5, 2019

Curiously enough, it doesn't happen on master branch of API Platform, but only 2.4. Must be due to a different combination of package versions...

And of course, it only happens on Windows in our case. Lol...

M4LuZ added a commit to lansuite/lansuite that referenced this issue May 7, 2022
…from the general symfony cache framework in the version bump from 4.3.9 to 4.4.0.

This adds the new dependency to make the cache interface available again
andygrunwald pushed a commit to lansuite/lansuite that referenced this issue May 7, 2022
…from the general symfony cache framework in the version bump from 4.3.9 to 4.4.0. (#486)

This adds the new dependency to make the cache interface available again
@tacman
Copy link
Contributor

tacman commented Jul 9, 2022

TL;DR: composer req psr/simple-cache

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

No branches or pull requests

8 participants