1

I am trying to a menu link to a node and getting this exception:

"Unrouted URIs do not have internal representations"

Backtrace:

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: Unrouted URIs do not have internal representations. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 770 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
token_tokens('url', Array, Array, Array, Object)
call_user_func_array('token_tokens', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array) (Line: 304)
Drupal\Core\Utility\Token->generate('url', Array, Array, Array, Object) (Line: 728)
token_tokens('menu-link', Array, Array, Array, Object)
call_user_func_array('token_tokens', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array) (Line: 304)
Drupal\Core\Utility\Token->generate('menu-link', Array, Array, Array, Object) (Line: 715)
token_tokens('menu-link', Array, Array, Array, Object)
call_user_func_array('token_tokens', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array) (Line: 304)
Drupal\Core\Utility\Token->generate('menu-link', Array, Array, Array, Object) (Line: 1131)
menu_ui_tokens('node', Array, Array, Array, Object)
call_user_func_array('menu_ui_tokens', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array) (Line: 304)
Drupal\Core\Utility\Token->generate('node', Array, Array, Array, Object) (Line: 196)
Drupal\Core\Utility\Token->replace('[node:menu-link:parent:url:relative]/[node:title]', Array, Array, Object) (Line: 193)
Drupal\pathauto\PathautoGenerator->createEntityAlias(Object, 'update') (Line: 329)
Drupal\pathauto\PathautoGenerator->updateEntityAlias(Object, 'update') (Line: 114)
pathauto_entity_update(Object)
call_user_func_array('pathauto_entity_update', Array) (Line: 402)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 169)
Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 418)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 470)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 304)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 395)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 761)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 364)
Drupal\Core\Entity\Entity->save() (Line: 356)
Drupal\node\NodeForm->save(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: 585)
Drupal\Core\Form\FormBuilder->processForm('node_page_edit_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
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}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

EDIT:

It looks like this was caused by a menu link being a child of a menu item that has an external link, and pathauto/token breaking on that.

Is there a way to improve the experience, like a form error instead of "website encountered an error" white screen?

  • This is not a fatal error, it is an exception. Enable verbose error logging and post the backtrace. – Berdir Dec 6 '16 at 19:38
  • Updated with backtrace. – Kevin Dec 6 '16 at 21:28
  • I'm voting to close this question as off-topic because it is a bug report that belongs in the drupal.org issue queue. – mpdonadio Dec 7 '16 at 1:22
3

Ok, based on the stacktrace, this happens somewhere during token replacements.

Your token for the alias is:

Drupal\Core\Utility\Token->replace('[node:menu-link:parent:url:relative]/[node:title]', Array, Array, Object) (Line: 193)

But it looks like that fails because your menu parent seems to be a non-routed URL, could be a external URL or it could be a known issue with drush and Drupal 8.2 that I fixed in https://github.com/drush-ops/drush/pull/2393. Make sure you are on the most recent drush version and do a drush cr.

Doesn't look related to paragraphs to me at all. I suggest you open an issue in token.module with that backtrace. It should catch that or check it before trying to get the relative path. That would then still result in a wrong alias, it is likely not the actual problem (unless you really have an external link there but then your pathauto configuration can't work).

  • You're right, will update. Not paragraph related. – Kevin Dec 6 '16 at 23:29
  • "Is there a way to improve the experience, like a form error instead of "website encountered an error" white screen?". The answer for that is also there (it is a bug, report it) – Berdir Dec 6 '16 at 23:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.