Problem/Motivation
I am getting this exception when deleting nodes.
The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">Drupal\Core\Entity\EntityStorageException</em>: External URLs do not have internal route parameters. in <em class="placeholder">Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete()</em> (line <em class="placeholder">731</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php</em>).
Drupal\decoupled_router\CacheInvalidator->getTagsBySourcePath('/node/610') (Line: 54)
Drupal\decoupled_router\CacheInvalidator->invalidateByPath(Array) (Line: 29)
decoupled_router_path_delete(Array)
call_user_func_array('decoupled_router_path_delete', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('path_delete', Array) (Line: 177)
Drupal\Core\Path\AliasStorage->delete(Array) (Line: 251)
Drupal\pathauto\AliasStorageHelper->deleteMultiple(Array) (Line: 174)
Drupal\pathauto\AliasStorageHelper->deleteBySourcePrefix('/node/610') (Line: 189)
Drupal\pathauto\AliasStorageHelper->deleteEntityPathAll(Object) (Line: 106)
pathauto_entity_delete(Object)
call_user_func_array('pathauto_entity_delete', Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_delete', Array) (Line: 206)
Drupal\Core\Entity\EntityStorageBase->invokeHook('delete', Object) (Line: 773)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('delete', Object) (Line: 406)
Drupal\Core\Entity\EntityStorageBase->delete(Array) (Line: 723)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->delete(Array) (Line: 398)
Drupal\Core\Entity\Entity->delete() (Line: 73)
Drupal\Core\Entity\ContentEntityDeleteForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder->processForm('node_page_delete_form', Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder->buildForm('node_page_delete_form', Object) (Line: 93)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
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: 151)
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: 45)
Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->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: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I've traced it to CacheTagsInvalidator::getTagsBySourcePath().
Method is called with the same node 2 times and on the second one it is getting the exception.
The aliases on the node are all for different languages.
The ones that are failing are deleted languages (stale aliases).
Proposed resolution
Catch the exception and return empty result in that case...
Remaining tasks
Patch...
User interface changes
None expected.
API changes
None expected.
Data model changes
None expected.
Release notes snippet
None expected.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | decoupled_router-exception-in-invalidateByPath-3042390-2.patch | 623 bytes | ndobromirov |
Comments
Comment #2
ndobromirov commentedHere is a simple patch to prevent the WSOD.
Comment #3
ndobromirov commentedI found this to be the root cause in my case :(. There were deleted languages and all the nodes that had aliases on that languages were throwing that exception. Linking it here, so we know...
See the core's issue: #2851029: [PP-1] Disallow removing a language when there is content in that language
Comment #4
e0ipsoThe patch seems reasonable.
Comment #6
e0ipso