Problem in prod mode - MappingException #10616
Replies: 12 comments
-
I don't know why Doctrine would do this. Things I would do if I were you:
|
Beta Was this translation helpful? Give feedback.
-
Composer Outdated
Stack Trace il give you my last prod.log
Use a debugger based on what I see in the stack traceHow can i use a debugger in prod because he show me directly 500 error message, can you give me more information ? do you mean prod in with debug = true ? |
Beta Was this translation helpful? Give feedback.
-
That's not a stack trace. Use XDebug with a breakpoint, in dev, in prod mode. |
Beta Was this translation helpful? Give feedback.
-
Do a case-sensitive search with you IDE for |
Beta Was this translation helpful? Give feedback.
-
Before using the xdebug and doing what you asked me to do we'll do it step by step: To explain you well what happens:
I notice that when the debug is activated it finds all the controllers, as well as the routes, but without the debug active I have this error I need help how I can upgrade these packages with the command "compose outdated":
I have tried composing update and composing upgrade I can't get them up to date. |
Beta Was this translation helpful? Give feedback.
-
It's Now that's cleared up, I'm a bit surprised at the design of the error page… In Symfony, there used to be a stack trace tab, as shown here: https://symfony.com/doc/current/contributing/code/stack_trace.html#getting-stack-traces-with-symfony |
Beta Was this translation helpful? Give feedback.
-
sorry i mean composer update or upgrade not updating doctrine/instantiator and doctrine/lexer. |
Beta Was this translation helpful? Give feedback.
-
With APP_DEBUG at false you won't see a stacktrace I don't think it's design related. Are you using sonata or any genericity between controllers and entities ? |
Beta Was this translation helpful? Give feedback.
-
I don't know what sonata is, but I made it simple with symfony, Created by php/bin console make:entity + doctrine:migration + doctrine:migrate Personne.php
PersonneController.php
|
Beta Was this translation helpful? Give feedback.
-
Can you open a repository on github so I can have a look and try to replicate ? |
Beta Was this translation helpful? Give feedback.
-
No I can't. I asked my superior to fix the problem you asked me to open a repository on github, so that you help me to fix the problem, he refused, it's a company project they want to keep private. for the moment the duplication of the file Personne.php (with personne.php in lower case) it's enough for him. |
Beta Was this translation helpful? Give feedback.
-
I'm moving this to support. I don't have enough information to reproduce a bug and there are too many other libraries involved right now. Unless we have a reproducer, I don't see a bug here. |
Beta Was this translation helpful? Give feedback.
-
Bug Report
Hello,
I had a weird problem, I created a symfony 6.2.7 project with the doctrine version here is the info:
I created my Person entity with
php bin/console make:entity
which generated Personne.php (class Personne) and in doctrine table personne of course with the migration and all the steps.When I wanted to switch to prod mode: I got this error message:
It looks like doctrine is looking for a class called
'App\\Entity\\personne'
when it's actually'App\\Entity\\Personne'
.Temporary solution
For the moment I diverted that with a duplication of the file Personne.php and personne.php so that it works in both prod and dev mode. of in dev mode you don't need the duplication file.
Used but not working
I tried all the cache option delete:
The links of symfony for the deployment here they are all:
https://symfony.com/doc/current/deployment.html.
https://symfony.com/doc/3.4/setup/file_permissions.html
sonata-project/SonataAdminBundle#5021
Where the error comes from ?
I think the problem comes from doctrine which converts 'Personne' into 'personne' when doctrine is in prod mode, so it triggers MappingException with the message
"App\Entity' does not exist"
because there is not file calledpersonne.php
butPersonne.php
exist.Beta Was this translation helpful? Give feedback.
All reactions