Bug 1919075 - The elasticsearch jobs fail with error no permissions for [indices:admin/aliases/get]
Summary: The elasticsearch jobs fail with error no permissions for [indices:admin/alia...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Logging
Version: 4.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.5.z
Assignee: Jeff Cantrill
QA Contact: Qiaoling Tang
URL:
Whiteboard: logging-exploration
Depends On: 1916910 1928772
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-22 04:04 UTC by Saurabh Sadhale
Modified: 2024-06-13 23:59 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
collapses the multiple policy cronjobs to a single job with multiple tasks it runs: delete rollover The reasoning is there is a potential race condition between the previous jobs which both rely upon a -write alias that may lead to false information. Additionally, ES does not have transactions or is ACID. By converting these into tasks we execute for management we: potentially free disk for ES to do additional work give a better chance for the rollover to be successful
Clone Of:
Environment:
Last Closed: 2021-03-17 15:21:04 UTC
Target Upstream Version:
Embargoed:
jcantril: needinfo-
jcantril: needinfo-
jcantril: needinfo-


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift elasticsearch-operator pull 644 0 None open Bug 1919075: Condense indexmanagement into single cronjob 2021-02-12 22:13:47 UTC
Red Hat Knowledge Base (Solution) 5726861 0 None None None 2021-01-22 04:24:35 UTC
Red Hat Product Errata RHBA-2021:0784 0 None None None 2021-03-17 15:21:31 UTC

Description Saurabh Sadhale 2021-01-22 04:04:33 UTC
Description of problem:
The elasticsearch jobs rollover,delete for app infra audit fails with the following error: 

~~~
{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"},"status":403}
Error while attemping to determine the active write alias: {"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"},"status":403}
~~~

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Deploy Cluster Logging with EO image elasticsearch-operator.4.5.0-202012120433.p0 and cluster-logging-operator-v4.5.0-202012120433.p0
2.The jobs should fail after installation of Cluster Logging with the above described error. 
3.

Actual results:
Jobs get into error state

Expected results:
Jobs should be successful. 

Additional info:

Comment 2 Hui Kang 2021-01-26 15:05:30 UTC
@sau, could you provide the must-gather for the cluster https://github.com/openshift/cluster-logging-operator/tree/master/must-gather#usage? Thanks.

Comment 4 Anand Paladugu 2021-02-01 18:52:18 UTC
Hi

Any update on this BZ ?

Thanks

Anand

Comment 6 Anand Paladugu 2021-02-04 16:52:28 UTC
hmm. I dont know if there any limits on google drive.  Can you directly access the must gather from the case then ?

Comment 8 Anand Paladugu 2021-02-22 13:43:45 UTC
Hui  Kang,

Can you also check the case 02828704 that has the same symptoms. ? 

Thanks

Anand

Comment 9 Anand Paladugu 2021-02-23 16:54:25 UTC
@jcantril 

My customer seems to have upgraded to 4.6.17 and they are seeing this issue there too.  Do you know if the issue impacted 4.6.17 and are you planning to port the fix to 4.6.z ?

Thanks

Anand

Comment 12 Qiaoling Tang 2021-03-11 08:16:07 UTC
Verified with elasticsearch-operator.4.5.0-202103060503.p0

Comment 14 errata-xmlrpc 2021-03-17 15:21:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.5.35 extras update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:0784

Comment 15 Anand Paladugu 2021-03-21 22:31:50 UTC
Hi

My customer seems to have upgraded to 4.6.17 and they are seeing this issue there too.  Do you know if the issue impacted 4.6.17 and are you planning to port the fix to 4.6.z ?

Thanks

Anand

Comment 16 akamarathunga 2021-03-31 02:35:05 UTC
We are seeing the error OCP 4.6.20 cluster with 
 - CLO version 4.6.0-202103202154.p0 
 - Elasticsearch operator version 4.6.0-202103130248.p0

{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"},"status":403}

Error while attemping to determine the active write alias: {"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"},"status":403}

Comment 17 akamarathunga 2021-03-31 02:35:30 UTC
We are seeing the error OCP 4.6.20 cluster with 
 - CLO version 4.6.0-202103202154.p0 
 - Elasticsearch operator version 4.6.0-202103130248.p0

{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"},"status":403}

Error while attemping to determine the active write alias: {"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/aliases/get] and User [name=system:serviceaccount:openshift-logging:elasticsearch, roles=[admin_reader], requestedTenant=null]"},"status":403}

Comment 20 David J. M. Karlsen 2021-04-21 20:21:09 UTC
Same problem with clean install of:
cluster-logging.5.0.2-18                  Red Hat OpenShift Logging          5.0.2-18                                             Succeeded
elasticsearch-operator.5.0.2-18           OpenShift Elasticsearch Operator   5.0.2-18                                             Succeeded

[2021-04-21T19:52:00,904][ERROR][c.a.o.s.a.BackendRegistry] [elasticsearch-cdm-fzzbb5dp-1] Cannot authenticate user because admin user is not permitted to login via HTTP
[2021-04-21T19:52:01,005][INFO ][c.a.o.s.p.PrivilegesEvaluator] [elasticsearch-cdm-fzzbb5dp-1] No cluster-level perm match for User [name=system:serviceaccount:openshift-operators-redhat:elasticsearch-operator, roles=[admin_reader], requestedTenant=null] Resolved [aliases=[*], indices=[*], allIndices=[*], types=[*], originalRequested=[], remoteIndices=[]] [Action [indices:admin/template/get]] [RolesChecked [admin_user]]
[2021-04-21T19:52:01,005][INFO ][c.a.o.s.p.PrivilegesEvaluator] [elasticsearch-cdm-fzzbb5dp-1] No permissions for [indices:admin/template/get]

Comment 22 akamarathunga 2021-07-02 05:30:28 UTC
Cluster version - 4.6.21
CLO version - 4.6.0-202106181629
ESO version - 4.6.0-202106181629

The index rollover jobs use service account 'system:serviceaccount:openshift-logging:elasticsearch'. Therefore, I added it to 'sgconfig/roles_mapping.yml' as follows.

sg_role_admin:
  users:
    - 'CN=system.admin,OU=OpenShift,O=Logging'
    - 'system:serviceaccount:openshift-logging:elasticsearch'
  backendroles:
    - 'elasticsearch-operator'

Then, ran the 'es_seed_acl' to update search guard permissions.

This has to be done on all ES pods. These changes are not persistent. If the pod gets recreated, need to execute the above steps.

Comment 23 Periklis Tsirakidis 2021-07-02 13:08:04 UTC
Hi everyone,

you are addressing an issue for the 4.6.z on a closed BZ for 4.5.z. I accidentally happened to check this out. I am advising you to follow-up on the 4.6.z advisories for a similar BZ next time. This is the appropriate way to track down if and when something got fixed.

For example in your case:
- The appropriate BZ is: https://bugzilla.redhat.com/show_bug.cgi?id=1929688
- The fix is shipped with: 4.6.23
- The advisory for 4.6.23 telling you that is: https://errata.devel.redhat.com/advisory/70859


Note You need to log in before you can comment on or make changes to this bug.