I cloned a version of a Drupal 8.9.20 site to a local installation (MAMP PRO). That seemed to word, but when I call the site I get an error:
The website encountered an unexpected error. Please try again later.
With verbose error mode I get further:
Error: Call to a member function id() on bool in Drupal\Core\Entity\EntityStorageBase->setStaticCache() (line 188 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->setStaticCache(Array) (Line: 311)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 188)
Drupal\Core\Entity\EntityRepository->getCanonicalMultiple('node', Array, Array) (Line: 180)
Drupal\Core\Entity\EntityRepository->getCanonical('node', '236', Array) (Line: 149)
Drupal\Core\ParamConverter\EntityConverter->convert('236', Array, 'node', Array) (Line: 100)
Drupal\Core\ParamConverter\ParamConverterManager->convert(Array) (Line: 89)
Drupal\Core\Access\AccessManager->checkNamedRoute('entity.node.canonical', Array, Object, 1) (Line: 212)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->menuLinkCheckAccess(Object) (Line: 92)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array) (Line: 96)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array) (Line: 96)
Drupal\Core\Menu\DefaultMenuLinkTreeManipulators->checkAccess(Array)
call_user_func(Array, Array) (Line: 148)
Drupal\Core\Menu\MenuLinkTree->transform(Array, Array) (Line: 56)
Drupal\pg_helper\BreadcrumbBuilder->build(Object) (Line: 47)
Drupal\pg_fe_users\Theme\ThemeswitcherNegotiator::is_internal() (Line: 23)
Drupal\pg_fe_users\Theme\ThemeswitcherNegotiator->applies(Object) (Line: 67)
Drupal\Core\Theme\ThemeNegotiator->determineActiveTheme(Object) (Line: 405)
Drupal\Core\Theme\ThemeManager->initTheme(Object) (Line: 96)
Drupal\Core\Theme\ThemeManager->getActiveTheme() (Line: 43)
Drupal\Core\Cache\Context\ThemeCacheContext->getContext(NULL) (Line: 118)
Drupal\Core\Cache\Context\CacheContextsManager->convertTokensToKeys(Array) (Line: 307)
Drupal\Core\Render\RenderCache->createCacheID(Array) (Line: 66)
Drupal\Core\Render\RenderCache->get(Array) (Line: 109)
Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 77)
Drupal\Core\Render\RenderCache->get(Array) (Line: 109)
Drupal\Core\Render\PlaceholderingRenderCache->get(Array) (Line: 137)
Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber->onRequest(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.request', Object) (Line: 127)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
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: 70)
Drupal\pg_fe_users\StackMiddleware\PgPageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
What could be the reason? Any hints how to resolve this?
For your advice many thanks in advance!
Solution:
The advice from @4k4 solved the problem:
Rebuilding the cache by http://www.example.com/core/rebuild.php
removed the error message.