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

Compile Error: ... getProxyDefinition() Failed opening required ... __CG__AppBundleDocumentACCPermission.php #1644

Closed
manuelbcd opened this issue Sep 16, 2017 · 7 comments

Comments

@manuelbcd
Copy link

Hi. I have a document that is not creating the proxy cache file. The whole "Proxy" folder is populated within "cache" with all proxies but only this file is not created.

Error Message: Compile Error: Doctrine\Common\Proxy\AbstractProxyFactory::getProxyDefinition(): Failed opening required '/var/www/html/app/cache/dev/doctrine/odm/mongodb/Proxies/__CG__AppBundleDocumentACCPermission.php'

Do anybody have a clue about how to find out the problem?

Thanks in advance

@malarzm
Copy link
Member

malarzm commented Sep 17, 2017

Try setting a breakpoint to see what's going wrong in the factory.

@manuelbcd
Copy link
Author

Thanks @malarzm . Yes I did that and I discovered that the problem was mine. Database values was not consistent. But I have dealed with this problem several times and I'm wondering if we could improve the error output in order to point to the problem. The actual "Failed to open..." is very generic.

Thank you for your help

@malarzm
Copy link
Member

malarzm commented Sep 18, 2017

@manuelbcd I'm sure we can improve the error message, but I don't understand what the problem was :)

@manuelbcd
Copy link
Author

The problem was DB inconsistency. Documents fields were not matching with the mapped exclussion groups. With a backup of db it is working well.
However doctrine error was pointing to a proxy file that never exists so in short doctrine is making you follow an incorrect clue when you want to fix the problem.

@malarzm
Copy link
Member

malarzm commented Sep 18, 2017

The problem was DB inconsistency. Documents fields were not matching with the mapped exclussion groups.

Sorry, but I don't see what goes wrong here, is it that you were trying to create a Proxy for an unmapped class? If so, then I think an exception from ClassMetadataFactory should be thrown already. Also, exclusion policy is not a concept from Doctrine but from some serializer I reckon?

@manuelbcd
Copy link
Author

Sorry I meant DiscriminatorMap instead of exclussion, i mistaken the word.
Thank you. If you think that it's correct then everything is ok.

Regards

@malarzm
Copy link
Member

malarzm commented Sep 19, 2017

Ah unsupported discriminator values. Yes, they can be tricky, but due to BC we can't do much in 1.x as people can rely on the behaviour (e.g. incomplete discriminator map). We aim to improve the situation by being very strict on what is in the discriminator map and what comes from DB but we can only do that in 2.0 - #563 is used to track the request. I think we can close this for now, if there's anything more please post/reopen :)

@malarzm malarzm closed this as completed Sep 19, 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

2 participants