# Failed to resolve if it's a readonly tenant: Error: Not Found error

**URL:** <https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810>\
**Category:** OpenSearch Dashboards\
**Tags:** troubleshoot\
**Created:** [December 16, 2024, 8:19am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810 "2024-12-16T08:19:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![pizzaman](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pizzaman](https://forum.opensearch.org/u/pizzaman)\
**Post date:** [December 16, 2024, 8:19am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/1 "2024-12-16T08:19:50Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
2.18.0

**Describe the issue** :  
I set up multi-tenancy on opensearch dashboards and created a read-only tenant.  
Since then, I have been continuously encountering the following error, and I don’t know why.  
Please help.

Failed to resolve if it’s a readonly tenant: Error: Not Found

**Configuration** :  
opensearch dashboards multi-tenancy : true

**Relevant Logs or Screenshots** :  
Dec 13 12: 17: 05 opensearch-dashboards[  
2272623  
]: {  
“type”: “log”,  
“@timestamp”: “2024-12-13T03:17:05Z”,  
“tags”: [  
“error”,  
“plugins”,  
“securityDashboards”  
],  
“pid”: 2272623,  
“message”: “Failed to resolve if it’s a readonly tenant: Error: Not Found\n  
at SecurityClient.dashboardsinfo (/usr/share/opensearch-dashboards-2.18.0/plugins/securityDashboards/server/backend/opensearch\_security\_client.ts: 130: 13)\n  
at processTicksAndRejections (node:internal/process/task\_queues: 95: 5)\n  
at ReadonlyService.isReadonly (/usr/share/opensearch-dashboards-2.18.0/plugins/securityDashboards/server/readonly/readonly\_service.ts: 101: 30)\n  
at ReadonlyService.hideForReadonly (/usr/share/opensearch-dashboards-2.18.0/src/core/server/security/readonly\_service.js: 18: 13)\n  
at /usr/share/opensearch-dashboards-2.18.0/src/plugins/data/server/index\_patterns/index\_patterns\_service.js: 49: 14\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 52: 21\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/resolve\_capabilities.js: 51: 26\n  
at /usr/share/opensearch-dashboards-2.18.0/src/core/server/capabilities/routes/resolve\_capabilities.js: 53: 26\n  
at Router.handle (/usr/share/opensearch-dashboards-2.18.0/src/core/server/http/router/router.js: 174: 44)\n  
at handler (/usr/share/opensearch-dashboards-2.18.0/src/core/server/http/router/router.js: 140: 50)\n  
at exports.Manager.execute (/usr/share/opensearch-dashboards-2.18.0/node\_modules/@hapi/hapi/lib/toolkit.js: 60: 28)\n  
at Object.internals.handler (/usr/share/opensearch-dashboards-2.18.0/node\_modules/@hapi/hapi/lib/handler.js: 46: 20)\n  
at exports.execute (/usr/share/opensearch-dashboards-2.18.0/node\_modules/@hapi/hapi/lib/handler.js: 31: 20)\n  
at Request.\_lifecycle (/usr/share/opensearch-dashboards-2.18.0/node\_modules/@hapi/hapi/lib/request.js: 371: 32)\n  
at Request.\_execute (/usr/share/opensearch-dashboards-2.18.0/node\_modules/@hapi/hapi/lib/request.js: 281: 9)”  
}

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [December 16, 2024, 10:42am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/2 "2024-12-16T10:42:38Z")

</div>

@pizzaman Is the read-only tenant the only one assigned to that user?  
Could you share roles config of that user?

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [December 16, 2024, 10:45am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/3 "2024-12-16T10:45:04Z")

</div>

@pizzaman If this thread is duplicate of [Failed to resolve if it's a readonly tenant: Error: Not Found](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found/22791), please close the older one and continue conversation here.

---

<div class="post-metadata">

**Author:** ![pizzaman](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pizzaman](https://forum.opensearch.org/u/pizzaman)\
**Post date:** [December 17, 2024, 12:17am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/4 "2024-12-17T00:17:57Z")

</div>

> [@pablo](#):
>
> Is the read-only tenant the only one assigned to that user?  
> Could you share roles config of that user?

1. role.yml

```auto
---
_meta:
  type: "roles"
  config_version: 2

indexes_full_access:
  reserved: false
  index_permissions:
    - index_patterns:
        - "*"
      allowed_actions:
        - "*"
  tenant_permissions:
  - tenant_patterns:
    - "*"
    allowed_actions:
    - "kibana_all_write"
# ----------------------------------------------------
indexes_security_search_full_access:
  reserved: true
  index_permissions:
    - index_patterns:
        - "kube-apiserver-audit-*"
        - "syslog-*"
      allowed_actions:
        - "indices:data/read/search*"
        - "read"
        - "view_index_metadata"
  tenant_permissions:
  - tenant_patterns:
    - "SECURITY"
    allowed_actions:
    - "kibana_all_write"
# ----------------------------------------------------
indexes_web_search_full_access:
  reserved: true
  index_permissions:
    - index_patterns:
        - "ingress-nginx-*"
        - "mywebapp-*"
      allowed_actions:
        - "indices:data/read/search*"
        - "read"
        - "view_index_metadata"
  tenant_permissions:
  - tenant_patterns:
    - "WEB"
    allowed_actions:
    - "kibana_all_write"
# ----------------------------------------------------
# Restrict users so they can only view visualization and dashboard on OpenSearchDashboards
kibana_read_only:
  reserved: true

# ======================== Custom Roles =========================
test_write_access:
  reserved: true
  cluster_permissions:
    - 'indices:data/write/bulk'
    - 'cluster:monitor/main'
    - 'cluster:monitor/health'
  index_permissions:
    - index_patterns:
        - '*'
      allowed_actions:
        - 'indices:admin/create'
        - 'indices:admin/mapping/put'
        - 'indices:data/write/bulk'
        - 'indices:data/write/bulk*'
        - 'indices:data/write/index'
        - 'indices:data/write/update'
        - 'indices:data/write/delete'

```

1. roles\_mapping.yml

```auto
---

# In this file users, backendroles and hosts can be mapped to Security roles.
# Permissions for OpenSearch roles are configured in roles.yml

_meta:
  type: "rolesmapping"
  config_version: 2

kibana_server:
  reserved: true
  users:
  - "kibanaserver"

# Define your roles mapping here
all_access:
  reserved: false
  backend_roles:
  - "admin"
  - "opensearch_admin"
  - "OPENSEARCH_ADMIN"
  description: "Maps admin to all_access"
# ----------------------------------------------------
indexes_full_access:
  reserved: false
  backend_roles:
  - "opensearch_admin"
  description: "Maps admin to indexes_full_access"
# ----------------------------------------------------
own_index:
  reserved: false
  users:
  - "*"
  description: "Allow full access to an index named like the username"
# ----------------------------------------------------
readall:
  reserved: false
  backend_roles:
  - "opensearch_index_read_all"
  - "OPENSEARCH_USER"
# ----------------------------------------------------
indexes_security_search_full_access:
  reserved: true
  backend_roles:
  - "opensearch_index_read_all"
  - "opensearch_index_read_security"
  description: "Maps users to indexes_security_search_full_access"
# ----------------------------------------------------
indexes_web_search_full_access:
  reserved: true
  backend_roles:
  - "opensearch_index_read_all"
  - "opensearch_index_read_web"
  description: "Maps users to indexes_web_search_full_access"

# ======================== Custom Role Mapping =========================
kibana_user:
  reserved: true
  backend_roles:
  - "kibanauser"
  - "OPENSEARCH_USER"
  description: "General"

kibana_read_only:
  reserved: true
  backend_roles:  
  - "OPENSEARCH_VIEWER"
  description: "Read_Only"

test_write_access:
  reserved: true
  users:
  - "test"
  description: "Public Client User"

```

1. internal\_users.yml

```auto
---

# This is the internal user database
# The hash value is a bcrypt hash and can be generated with plugin/tools/hash.sh

_meta:
  type: "internalusers"
  config_version: 2

# Define your internal users here

## Demo users
kibanaserver:
  hash: {{opensearch_kibanaserver_hash}}
  reserved: true
  description: "Demo OpenSearch Dashboards user"

# ======================== Custom User =========================
admin:
  hash: {{opensearch_admin_hash}}
  reserved: true
  backend_roles:
  - "OPENSEARCH_ADMIN"
  description: "Super User"

kibanauser:
  hash: {{opensearch_kibanauser_hash}}
  reserved: true
  backend_roles:
  - "OPENSEARCH_USER"
  description: "General"

kibanareadonly:
  hash: {{opensearch_kibanareadonly_hash}}
  reserved: true
  backend_roles:  
  - "OPENSEARCH_VIEWER"
  description: "Read_Only"

tester:
  hash: {{opensearch_tester_hash}}
  reserved: true
  backend_roles:
  - "OPENSEARCH_TESTER"
  description: "Tester"

test:
  hash: {{opensearch_test_hash}}
  reserved: true
  backend_roles:
  - "OPENSEARCH_ADMIN"
  description: "Public Client User"

```

1. tenants.yml

```auto
---
_meta:
  type: "tenants"
  config_version: 2

# Define your tenants here
SECURITY:
  reserved: false
  description: "Tenant for security logs (e.g. kubernetes audit or opensearch audit)"
WEB:
  reserved: false
  description: "Tenant for web-app logs"

```

---

<div class="post-metadata">

**Author:** ![pizzaman](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pizzaman](https://forum.opensearch.org/u/pizzaman)\
**Post date:** [December 17, 2024, 12:24am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/5 "2024-12-17T00:24:11Z")

</div>

Yes, this is a duplicate of the previous issue and I will close it and continue the conversation here. It’s a very difficult problem, and I would appreciate your help.

---

<div class="post-metadata">

**Author:** ![pizzaman](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pizzaman](https://forum.opensearch.org/u/pizzaman)\
**Post date:** [December 17, 2024, 3:22am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/6 "2024-12-17T03:22:57Z")

</div>

Additionally, the error did not occur with the security settings used in 2.11 before upgrading to 2.18.

---

<div class="post-metadata">

**Author:** ![pizzaman](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pizzaman](https://forum.opensearch.org/u/pizzaman)\
**Post date:** [December 17, 2024, 7:34am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/7 "2024-12-17T07:34:39Z")

</div>

In version 2.15, the error does not occur, but it seems that the error occurs from version 2.16.

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [December 17, 2024, 10:20am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/8 "2024-12-17T10:20:22Z")

</div>

@pizzaman I don’t see any read-only tenant. All tenant permissions are kibana\_all\_write.

Could you run the following command with the user that has the issue and share the output?

```auto
curl --insecure -u <username>:<passowrd> -XGET https://<OpenSearch_IP_or_FQDN>:9200/_plugs/_security/authinfo?pretty

```

---

<div class="post-metadata">

**Author:** ![pizzaman](https://avatars.discourse-cdn.com/v4/letter/p/ee7513/32.png) [@pizzaman](https://forum.opensearch.org/u/pizzaman)\
**Post date:** [December 17, 2024, 10:33am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/9 "2024-12-17T10:33:37Z")

</div>

@pablo

The error occurs in version 2.16 or later for any user,  
and the error does not occur in version 2.15 or earlier.

```auto
{
    "user": "User [name=admin, backend_roles=[OPENSEARCH_ADMIN], requestedTenant=null]",
    "user_name": "admin",
    "user_requested_tenant": null,
    "remote_address": "{{private}}",
    "backend_roles": [
        "OPENSEARCH_ADMIN"
    ],
    "custom_attribute_names": [],
    "roles": [
        "all_access"
    ],
    "tenants": {
        "SECURITY": true,
        "admin": true,
        "raycluster": true,
        "system": true,
        "global_tenant": true,
        "WEB": true
    },
    "principal": null,
    "peer_certificates": "0",
    "sso_logout_url": null
}

```

---

<div class="post-metadata">

**Author:** ![jakabasej5](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jakabasej5](https://forum.opensearch.org/u/jakabasej5)\
**Post date:** [December 19, 2024, 8:00am UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/10 "2024-12-19T08:00:46Z")

</div>

try run a command with the user

---

<div class="post-metadata">

**Author:** ![pablo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/pablo/32/10363_2.png) [@pablo](https://forum.opensearch.org/u/pablo)\
**Post date:** [December 19, 2024, 10:06pm UTC](https://forum.opensearch.org/t/failed-to-resolve-if-its-a-readonly-tenant-error-not-found-error/22810/11 "2024-12-19T22:06:33Z")

</div>

@pizzaman I understand the reported user belongs to an external IDP. You’ve mapped the backend role OPENSEARCH\_ADMIN to the all\_access role.

Do you have an issue with this user? The all\_access role will have read/write access to all tenants.  
The read/write permission is set for the role, not the tenant.
