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-&gt;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-&gt;getTagsBySourcePath(&#039;/node/610&#039;) (Line: 54)
Drupal\decoupled_router\CacheInvalidator-&gt;invalidateByPath(Array) (Line: 29)
decoupled_router_path_delete(Array)
call_user_func_array(&#039;decoupled_router_path_delete&#039;, Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler-&gt;invokeAll(&#039;path_delete&#039;, Array) (Line: 177)
Drupal\Core\Path\AliasStorage-&gt;delete(Array) (Line: 251)
Drupal\pathauto\AliasStorageHelper-&gt;deleteMultiple(Array) (Line: 174)
Drupal\pathauto\AliasStorageHelper-&gt;deleteBySourcePrefix(&#039;/node/610&#039;) (Line: 189)
Drupal\pathauto\AliasStorageHelper-&gt;deleteEntityPathAll(Object) (Line: 106)
pathauto_entity_delete(Object)
call_user_func_array(&#039;pathauto_entity_delete&#039;, Array) (Line: 403)
Drupal\Core\Extension\ModuleHandler-&gt;invokeAll(&#039;entity_delete&#039;, Array) (Line: 206)
Drupal\Core\Entity\EntityStorageBase-&gt;invokeHook(&#039;delete&#039;, Object) (Line: 773)
Drupal\Core\Entity\ContentEntityStorageBase-&gt;invokeHook(&#039;delete&#039;, Object) (Line: 406)
Drupal\Core\Entity\EntityStorageBase-&gt;delete(Array) (Line: 723)
Drupal\Core\Entity\Sql\SqlContentEntityStorage-&gt;delete(Array) (Line: 398)
Drupal\Core\Entity\Entity-&gt;delete() (Line: 73)
Drupal\Core\Entity\ContentEntityDeleteForm-&gt;submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;node_page_delete_form&#039;, Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;node_page_delete_form&#039;, Object) (Line: 93)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 45)
Drupal\jsonapi\StackMiddleware\FormatSetter-&gt;handle(Object, 1, 1) (Line: 49)
Asm89\Stack\Cors-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;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.

Comments

ndobromirov created an issue. See original summary.

ndobromirov’s picture

Status: Active » Needs review
Issue tags: +bug, +bug fix
StatusFileSize
new623 bytes

Here is a simple patch to prevent the WSOD.

ndobromirov’s picture

I 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

e0ipso’s picture

The patch seems reasonable.

  • e0ipso committed 83cb86a on 8.x-1.x authored by ndobromirov
    Issue #3042390 by ndobromirov, e0ipso: Exception on node delete
    
e0ipso’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.