Skip to content
Advertisement

“Error [Semantical Error] The annotation “@DoctrineORMMappingOnetoMany” in property” on Gitlab CI but not in local env or production [closed]

I’ve written some tests on an symfony 4.4 application and I would like to run these tests on my gitlab CI but I get this error :

Error [Semantical Error] The annotation “@DoctrineORMMappingOnetoMany” in property AppEntityClient::$logsRegions was never imported . Did you maybe forget to add a “use” statement for this annotation?

but I haven’t this error neither in my local env nor in production env and I import DoctrineORMMapping as ORM in my entity

Here my Client entity

JavaScript

My .gitlab-ci.yml

JavaScript

Complete gitlab error log :

$ php bin/console doctrine:database:drop –force –env=test Dropped database /tmp/test/test_db.sqlite for connection named default

$ php bin/console doctrine:database:create –env=test Created database /tmp/test/test_db.sqlite for connection named default $ php bin/console doctrine:schema:update –env=test –force

In AnnotationException.php line 39: [Semantical Error] The annotation “@DoctrineORMMappingOnetoMany” in prop erty AppEntityClient::$logsRegions was never imported . Did you maybe forget to add a “use” statement for this annotation?

doctrine:schema:update [–em EM] [–complete] [–dump-sql] [-f|–force] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-e|–env ENV] [–no-debug] [–]

Cleaning up file based variables

ERROR: Job failed: exit code 1

I don’t understand why it doesn’t work, any help is welcome 🙂

Advertisement

Answer

It seems that the problem is your annotation OnetoMany is invalid because of the case, the proper spelling should be OneToMany.

Try replacing it with :

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement