# No handler found

**URL:** <https://discuss.elastic.co/t/no-handler-found/362560>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [July 4, 2024, 2:01pm UTC](https://discuss.elastic.co/t/no-handler-found/362560 "2024-07-04T14:01:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![edgarmat1964](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@edgarmat1964](https://discuss.elastic.co/u/edgarmat1964)\
**Post date:** [July 4, 2024, 2:01pm UTC](https://discuss.elastic.co/t/no-handler-found/362560/1 "2024-07-04T14:01:48Z")

</div>

Hi list,

I've got an issue where I get a "no handler found" error. I've started a trial license which is still active. My relevant elasticsearch.yml:

```auto
path.data: /data/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
discovery.seed_hosts: ["0.0.0.0"]
xpack.security.enabled: true
xpack.security.enrollment.enabled: true
xpack.security.http.ssl:
  enabled: true
  keystore.path: certs/http.p12
  client_authentication: optional
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
cluster.initial_master_nodes: ["elastic8.edgar-matzinger.nl"]
http.host: 0.0.0.0
xpack.security.authc.realms.pki.pki1.order: 1

```

I've created a PKI client certificate and this gives the following error:

```auto
{"error":{"root_cause":[{"type":"security_exception","reason":"action
[cluster:monitor/main] is unauthorized for user [edgarm] with
effective roles [], this action is granted by the cluster privileges [monitor,manage,all]"}],"type":"security_exception",
"reason":"action [cluster:monitor/main] is unauthorized for
user [edgarm] with effective roles [], this action is granted by
the cluster privileges [monitor,manage,all]"},"status":403}

```

And when I try to add some roles to the user (using DevTools in kibana):

```auto
PUT _xpack/security/role_mapping/kibana_certificate_authorization
{
  "roles" : ["superuser"],
  "rules" : { "field" : { "dn" : "CN=edgarm,OU=Thuis,DC=edgar-matzinger,DC=nl" } },
  "enabled": true
}

```

I get this error:

```auto
{
  "error": "no handler found for uri [/_xpack/security/role_mapping/kibana_certificate_authorization?pretty=true] and method [PUT]"
}

```

And there is no error message regarding this in elasticsearch.log

When I run this command in a CLI:

```auto
curl https://localhost:9200/_xpack/security/'_authenticate?pretty' --key edgarm.key --cert edgarm.crt --cacert edgarm-ca.crt -k -v

```

It gives me this:

```auto
{
  "error" : "no handler found for uri [/_xpack/security/_authenticate?pretty] and method [GET]"
}

```

And I have no clue where to look now...

Kind regards, Edgar Matzinger.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [July 5, 2024, 7:22am UTC](https://discuss.elastic.co/t/no-handler-found/362560/2 "2024-07-05T07:22:49Z")

</div>

It looks like you're following some very old docs that don't match your version of Elasticsearch.

As best I can tell you're running Elasticsearch 8, but the `/_xpack/security` paths are only valid for Elasticsearch 7.

You need to follow the docs that match the version of Elasticsearch you are running. In this case you want `/_security/role_mapping/`

- [Create or update role mappings API | Elasticsearch Guide [8.14] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html)

---

<div class="post-metadata">

**Author:** ![edgarmat1964](https://avatars.discourse-cdn.com/v4/letter/e/a3d4f5/32.png) [@edgarmat1964](https://discuss.elastic.co/u/edgarmat1964)\
**Post date:** [July 5, 2024, 7:32pm UTC](https://discuss.elastic.co/t/no-handler-found/362560/4 "2024-07-05T19:32:27Z")

</div>

You're correct and I misread your mail.
