This site suddenly is making an AnnotionException. Nothing was changed on the server nor de site itself, just maybe Apache / PHP updates. I tried using different PHP versions, 7.4 / 8.0 / 8.1 but all give the same error.
When I run the site locally on 8.0 or 8.1 there is no error. Can anyone point me in the right direction as to where I should start looking?
Drupal 9.4.0
Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The class "Drupal\language\Annotation\LanguageNegotiation" is not annotated with @Annotation. Are you sure this class can be used as annotation? If so, then you need to add @Annotation to the _class_ doc comment of "Drupal\language\Annotation\LanguageNegotiation". If it is indeed no annotation, then you need to add @IgnoreAnnotation("LanguageNegotiation") to the _class_ doc comment of class Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser. in Doctrine\Common\Annotations\AnnotationException::semanticalError() (line 39 of /home/avascosolar/test/app/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php).
Drupal\Component\Annotation\Doctrine\DocParser->Annotation() (Line: 640)
Drupal\Component\Annotation\Doctrine\DocParser->Annotations() (Line: 338)
Drupal\Component\Annotation\Doctrine\DocParser->parse('/**
* Class for identifying language from the browser Accept-language HTTP header.
*
* @LanguageNegotiation(
* id = \Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser::METHOD_ID,
* weight = -2,
* name = @Translation("Browser"),
* description = @Translation("Language from the browser's language settings."),
* config_route_name = "language.negotiation_browser"
* )
*/', 'class Drupal\language\Plugin\LanguageNegotiation\LanguageNegotiationBrowser') (Line: 101)
Drupal\Component\Annotation\Doctrine\SimpleAnnotationReader->getClassAnnotations(Object) (Line: 125)
Drupal\Component\Annotation\Doctrine\SimpleAnnotationReader->getClassAnnotation(Object, 'Drupal\language\Annotation\LanguageNegotiation') (Line: 145)
Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery->getDefinitions() (Line: 86)
Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() (Line: 285)
Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() (Line: 175)
Drupal\Core\Plugin\DefaultPluginManager->getDefinitions() (Line: 22)
Drupal\Core\Plugin\DefaultPluginManager->getDefinition('language-url') (Line: 185)
Drupal\language\LanguageNegotiator->negotiateLanguage('language_interface', 'language-url') (Line: 133)
Drupal\language\LanguageNegotiator->initializeType('language_interface') (Line: 218)
Drupal\language\ConfigurableLanguageManager->getCurrentLanguage() (Line: 92)
Drupal\language\EventSubscriber\LanguageRequestSubscriber->setLanguageOverrides() (Line: 74)
Drupal\language\EventSubscriber\LanguageRequestSubscriber->onKernelRequestLanguage(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 134)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)