Missing route: entity.encryption_profile.canonical

Created on 24 May 2018, about 6 years ago
Updated 19 June 2024, 10 days ago

Route: entity.encryption_profile.canonical is missing from encrypt.routing.yml.

1) It can lead to abort config import with a message:

Unexpected error during import with operation delete for encrypt.profile.[profile-machine-name]: Route "entity.encryption_profile.canonical" does not exist.

witch can lead to inconsistency.

2) You can get WSOD after deleting unused key on admin UI with exception:

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.encryption_profile.canonical" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 190 of core/lib/Drupal/Core/Routing/RouteProvider.php).

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡­πŸ‡ΊHungary szato

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.0 & MySQL 5.7
    last update about 1 month ago
    Composer require failure
  • πŸ‡ͺπŸ‡ΈSpain budalokko Girona

    5 years later I was able to reproduce this one. In my case is in combination with the Next.js β†’ Drupal module.

    Instructions to reproduce:

    1. Create an encryption profile
    2. Install Next.js module and its dependencies (no worries, no need to configure).
    3. Delete your encryption profile through the UI.
    4. WSOD !

    The issue is due to EncryptProfile config entity declares a "canonical" path in its "links" section, but doesn't implement it:

    https://git.drupalcode.org/project/encrypt/-/blob/8.x-3.x/src/Entity/Enc...

    Drupal example on configuration entities β†’ does not include a "canonical" path. Also when creating such entity with drush gen entity:configuration, the resulting entity does not contain such path, and the module does not use it.

    Hence, my suggestion would be to remove that line, which actually fixes the issue.

    Please check the attached patch. It does not contain a test. I could try writing it, but not sure its actually wanted. Not breaking the other tests might be enough in this case.

    BTW the code in Next.js triggering the error is something like this, in a generic hook_entity_predelete, which seems quite right:

    if ($entity->hasLinkTemplate('canonical')) {
      $url = $entity->toUrl();
    }
    
  • Status changed to RTBC about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States pookmish

    Patch in #5 solved it for me. I wouldn't think there needs to be a canonical path for encryption profiles anyways.

    I've been just ignoring the error for a while and finally decided to see if there was anyone with the same issue. Glad I waited until today.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.0 & MySQL 5.7
    last update 24 days ago
    Composer require failure
  • πŸ‡¬πŸ‡§United Kingdom Finn Lewis

    I ran into the same error, just trying to edit my encryption profile.

    The patch in #5 fixes it for me.

    Might we get a release?

    Many thanks!

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.1 + Environment: PHP 8.1 & MySQL 5.7
    last update 22 days ago
    17 pass
    • rlhawk β†’ committed 34829c3d on 8.x-3.x
      Issue #2975098 by szato, budalokko, pookmish: Missing route: entity....
  • Status changed to Fixed 10 days ago
  • πŸ‡ΊπŸ‡ΈUnited States rlhawk Seattle, Washington, United States

    Committed, thanks!

Production build 0.69.0 2024