Hello,

I am a beginner in Drupal 8. I created a module following some tutorials. After I installed that module in Drupal 8 (8.0.1) version. It is creating problems with entire Drupal site. After installing that module, I am able to login as admin user, but unable to access any of the admin sections.

I am just encountering this error. "The website encountered an unexpected error. Please try again later." which is a serious issue. I checked the watchdog logs in the database. Please see the error log below:

"

| php  | a:5:{s:5:"%type";s:58:"Symfony\Component\Routing\Exception\RouteNotFoun
dException";s:8:"@message";s:37:"Route "hello.content" does not exist.";s:9:"%fu
nction";s:51:"Drupal\Core\Routing\RouteProvider->getRouteByName()";s:5:"%file";s
:70:"C:\wamp\www\drupal_test\core\lib\Drupal\Core\Routing\RouteProvider.php";s:5
:"%line";i:191;} |

"

I attached my module here for further testing.

CommentFileSizeAuthor
hello.zip1.79 KBkirantej_p

Comments

kirantej_p created an issue. See original summary.

kirantej_p’s picture

dawehner’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Fixed
Issue tags: -drupal8, -Routing

hello.content
but your code uses

hello:
  path: '/say_hello'
  defaults:

so the route name is hello

kirantej_p’s picture

Can you please elaborate your update?

When I tried to access the '/say_hello' path, it is giving the result and the error when tried to echo in the Controller function.

almaudoh’s picture

Change hello: to hello.content: in your module's *.routing.yml file.

kirantej_p’s picture

Yes. Also, I cleared cache and then it worked. Thanks guys. :)

Status: Fixed » Closed (fixed)

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

thirstysix’s picture

same issue in my custom module.

Symfony\Component\Routing\Exception\RouteNotFoundException: Route -------- does not exist, in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 187 of core\lib\Drupal\Core\Routing\RouteProvider.php).

how to rectify this issue. I can't able to view other pages.

cilefen’s picture

It is not possible to offer advice without seeing your code.

aswathyajish’s picture

Version: 8.0.1 » 8.6.16

I have the same error in status report when I upgraded drupal core to 8.6.16.

Symfony\Component\Routing\Exception\RouteNotFoundException: Route "entity.webform_ui.element.add_page" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 201 of /opt/web/core/lib/Drupal/Core/Routing/RouteProvider.php).