The following error occurs when I run cron but NOT when I reanalyse links from within maintenance. The site is running Drupal 9.5
Additional uncaught exception thrown while handling exception.
Original
Error: Object of class Drupal\user\Entity\User could not be converted to string in PDOStatement->execute() (line 145 of /home/lowestoftoldnow/ourfallen18.lowestoftoldandnow.org/core/lib/Drupal/Core/Database/StatementWrapper.php).
PDOStatement->execute(Array) (Line: 145)
Drupal\Core\Database\StatementWrapper->execute(Array, Array) (Line: 44)
Drupal\mysql\Driver\Database\mysql\Insert->execute() (Line: 78)
Drupal\dblog\Logger\DbLog->log(5, '%type: @message in %function (line %line of %file) @backtrace_string.', Array) (Line: 127)
Drupal\Core\Logger\LoggerChannel->log(5, '%type: @message in %function (line %line of %file) @backtrace_string.', Array) (Line: 175)
_drupal_log_error(Array, ) (Line: 83)
_drupal_error_handler_real(8, 'Object of class Drupal\user\Entity\User could not be converted to int', '/home/lowestoftoldnow/ourfallen18.lowestoftoldandnow.org/core/lib/Drupal/Core/Session/UserSession.php', 119) (Line: 347)
_drupal_error_handler(8, 'Object of class Drupal\user\Entity\User could not be converted to int', '/home/lowestoftoldnow/ourfallen18.lowestoftoldandnow.org/core/lib/Drupal/Core/Session/UserSession.php', 119) (Line: 119)
Drupal\Core\Session\UserSession->isAuthenticated() (Line: 112)
Drupal\Core\Session\AccountProxy->isAuthenticated() (Line: 91)
Drupal\system\TimeZoneResolver->getTimeZone() (Line: 53)
Drupal\system\TimeZoneResolver->setDefaultTimeZone(Object, 'account.set', Object)
call_user_func(Array, Object, 'account.set', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'account.set') (Line: 65)
Drupal\Core\Session\AccountProxy->setAccount(Object) (Line: 66)
Drupal\Core\Session\AccountSwitcher->switchTo(Object) (Line: 179)
Drupal\linkchecker\Plugin\LinkStatusHandlerBase->switchSession() (Line: 108)
Drupal\linkchecker\Plugin\LinkStatusHandlerBase->handle(Object, Object) (Line: 79)
Drupal\linkchecker\Plugin\QueueWorker\LinkStatusHandle->processItem(Array) (Line: 183)
Drupal\Core\Cron->processQueues() (Line: 139)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 59)
Drupal\system\CronController->runManually()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
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: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Additional
Error: Object of class Drupal\user\Entity\User could not be converted to string in PDOStatement->execute() (line 145 of /home/lowestoftoldnow/ourfallen18.lowestoftoldandnow.org/core/lib/Drupal/Core/Database/StatementWrapper.php).
PDOStatement->execute(Array) (Line: 145)
Drupal\Core\Database\StatementWrapper->execute(Array, Array) (Line: 44)
Drupal\mysql\Driver\Database\mysql\Insert->execute() (Line: 78)
Drupal\dblog\Logger\DbLog->log(3, '%type: @message in %function (line %line of %file) @backtrace_string.', Array) (Line: 127)
Drupal\Core\Logger\LoggerChannel->log(3, '%type: @message in %function (line %line of %file) @backtrace_string.', Array) (Line: 175)
_drupal_log_error(Array, 1) (Line: 365)
_drupal_exception_handler(Object)