1

I've cloned a fresh Drupal install from Pantheon and I'm attempting to run it on my local machine. I've used Lando to clone a repo and pull the relevant files, db, and code. I attempt Lando Start and when accessing my site I get the following error

The website encountered an unexpected error. Please try again later.
Error: __clone method called on non-object in Drupal\Core\Routing\UrlGenerator->getRoute() (line 426 of core/lib/Drupal/Core/Routing/UrlGenerator.php).
Drupal\Core\Routing\UrlGenerator->getRoute('') (Line: 270)
Drupal\Core\Routing\UrlGenerator->generateFromRoute('', Array, Array, 1) (Line: 105)
Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('', Array, Array) (Line: 68)
Drupal\Core\Routing\RedirectDestination->get() (Line: 51)
Drupal\Core\Routing\RedirectDestination->getAsArray() (Line: 164)
Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->makeSubrequest(Object, '/system/403', 403) (Line: 112)
Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber->on403(Object) (Line: 109)
Drupal\Core\EventSubscriber\HttpExceptionSubscriberBase->onException(Object, 'kernel.exception', Object)
call_user_func(Array, Object, 'kernel.exception', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.exception') (Line: 219)
Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object, Object, 1) (Line: 91)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
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: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

The site works fine on Pantheon. It's a fresh install with no configuration. No content, no additional users. I've attempted to set this up in a new directory, and I run a lando rebuild before pulling a second time and starting. Nothing seems to work. Pantheon support can't replicate the issue and the site is ok on the server, so I thought I'd turn to the community.

Help? Anyone able to point me in the right direction?

bren
  • 83
  • 2
  • 6
  • Are you on Windows, Mac, or Linux? Have you gotten a Pantheon site working on Lando before? Have you gotten a D8 site working on Lando before? If you wipe the local site database, are you able to do a fresh Drupal install? Are you using the 'pantheon' Lando recipe? – adfaklsdjf Feb 18 '22 at 18:59
  • Consider adding the 'lando' tag to this; I suspect this is more an issue of Lando setup/configuration than the other things. – adfaklsdjf Feb 18 '22 at 19:01
  • Thanks! I've added the Lando tag. I'm working on a mac and this is my first time working with Pantheon and Lando. I am using the pantheon lando recipe. I tried doing a fresh Drupal install after wiping the database but the install failed. – bren Feb 21 '22 at 09:10
  • Sorry to ask the obvious, but have to tried clearing the cache when you see this? I see this exact error after pulling a db from Pantheon to local lando, but it always goes away after clearing the cache. I'd love to track down the cause, though. First glance it seems drupal is confused about the paths when switching environments. – John May 02 '22 at 16:42
  • Just got back to this as I'm running another Drupal site and I got the same issue again. Running lando drush cc and clearing the cache did work like you said. – bren Jul 01 '22 at 15:08

3 Answers3

2

Turns out there was a problem with my SQL database from Pantheon, and I was getting an error as a logged in Drupal user. When I wasn't logged in the site would work fine. I had to drop all tables from the SQL DB I got from pantheon and then install the Drupal site from scratch. So it looks like the SQL DB from Pantheon didn't export correctly? Leaving this here in case anyone else experiences a similar issue.

bren
  • 83
  • 2
  • 6
2

This is solved by clearing the cache, run

lando drush cc

Should work after that, in case anyone else gets the same issue.

bren
  • 83
  • 2
  • 6
1

I had the same issue with a D9 fresh site. I was trying to get the database using lando pull. To fix it I did a manual backup and imported the database. Solved.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 22 '23 at 20:02