Solutions
ForgeRock Identity Platform
ForgeRock Identity Cloud

No handler to dispatch to errors in IG (All versions)

Last updated Feb 23, 2023

The purpose of this article is to provide assistance if you encounter "no handler to dispatch to" errors in IG.


1 reader recommends this article

Symptoms

The following error is seen in the route-system.log:15:01:29:505 | ERROR | main | o.f.o.h.r.RouterHandler | no handler to dispatch to

You may also see a similar error referring to a URI, for example:08:22:54:974 | ERROR | http-nio2-203.0.113.0-8080-exec-84 | o.f.o.h.DispatchHandler | no handler to dispatch to for URI 'https://example.com/demo'This particular error is usually accompanied by 404 Not found errors.

Recent Changes

N/A

Causes

These errors occur when IG has not been configured to handle the incoming request or the request to the specified URI:

  • The “no handler to dispatch to” error means the router cannot find a route that accepts the incoming request. This error happens when none of the route conditions match the incoming request and you haven't defined a default route. 
  • The “no handler to dispatch to for URI” error is similar and indicates that the router cannot find a route that can handle the request to the specified URI because none of the route conditions match the request path (URI).

Solution

If you see these errors during the startup phase (that is, they occur before the routes are available as indicated in the logs), they are safe to ignore. For example, you see messages similar to this in the route-system.log:15:01:29:505 | ERROR | main | o.f.o.h.r.RouterHandler | no handler to dispatch to 15:01:29:520 | INFO | main | o.f.o.h.r.RouterHandler | Routes endpoint available at '/openig/api/system/objects/_router/routes' 15:01:29:541 | INFO | main | o.f.o.h.r.RouterHandler | Loaded the route with id '01-static' registered with the name '01-static' ... 15:01:29:609 | INFO | main | o.f.o.h.r.RouterHandler | Loaded the route with id 'zz-default' registered with the name 'zz-default' 15:01:29:665 | INFO | main | o.f.o.l.Launcher | All 8 verticles started in 1234ms on ports : [8080, 8443]

If they are happening after startup, you should:

  1. Investigate the request that generated the error to identify why none of the existing routes were invoked. You should check the logs for further information about the request or capture a HAR. 

See Default logging behaviorHow do I generate more detailed debug logs to diagnose an issue in IG (All versions)? and How do I create a HAR file for troubleshooting IG? for further information.

  1. Correct existing route conditions or define new route conditions as needed to handle the incoming request or request to the specified URI.

Unknown requests

You can also improve how unknown requests are handled by returning a 404 or another standard response when an unknown request is received. You can do this using one of the following approaches:

  • Add a defaultHandler to the Router configuration. See Router Properties for further information.
  • Define a default route with no condition, which will be triggered when no other conditions match. See Adding a default route and Route Properties for further information.

See Also

Router

Configure routers and routes

Set route conditions

Related Training

N/A

Related Issue Tracker IDs

OPENIG-6793 (Include additional context in error log entry when RouterHandler#notFoundHandler is called)


Copyright and Trademarks Copyright © 2023 ForgeRock, all rights reserved.