Bug 1241111 - [mla] error 'Query execution failed due to insufficient permissions' appears in log, when logging into user portal
Summary: [mla] error 'Query execution failed due to insufficient permissions' appears ...
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: ---
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.0.0-alpha
: ---
Assignee: Moti Asayag
QA Contact: Ondra Machacek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-08 13:13 UTC by Ondra Machacek
Modified: 2016-03-15 08:22 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-15 08:22:04 UTC
oVirt Team: Infra
Embargoed:
oourfali: ovirt-4.0.0?
ylavi: planning_ack?
oourfali: devel_ack+
ylavi: testing_ack?


Attachments (Terms of Use)

Description Ondra Machacek 2015-07-08 13:13:42 UTC
Description of problem:


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

How reproducible:
always

Steps to Reproduce:
1. Add user from external domain and assign him UserRole on cluster
2. login as this user into userportal

Actual results:
User is logged in, but error in log appears:
2015-07-08 15:10:21,665 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (default task-8) [] Query execution failed due to insufficient permissions.
2015-07-08 15:10:21,667 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: query execution failed due to insufficient permissions.


Expected results:
No errors in log.

Additional info:
2015-07-08 14:54:40,049 DEBUG [org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl] (default task-32) [] Query type 'GetConfigurationValues', Parameters 'VdcQueryParametersBase:{refresh='true', filt
ered='true'}'


2015-07-08 15:10:21,665 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (default task-8) [] Query execution failed due to insufficient permissions.
2015-07-08 15:10:21,667 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: query execution failed due to insufficient permissions.

Comment 1 Oved Ourfali 2015-07-15 08:33:13 UTC
Do you see any additional issue besides the error?
Usually it is due to some change in the user-portal that caused running a query without the real need to. And, this query isn't a user query.

Comment 2 Ondra Machacek 2015-08-03 11:21:22 UTC
Sorry for late response didn't notice the needinfo.
UserPortal works properly, I didn't see any strange or wrong behaviour, just the error message in log.

Comment 3 Oved Ourfali 2015-08-03 11:24:53 UTC
So I wouldn't call it a regression.
We need to understand why it is there, but if it has no effect then it isn't any regression.

Ori - please try to reproduce, and check what query is being called there.
Probably some background admin-only query.

Comment 4 Ondra Machacek 2015-09-24 15:09:19 UTC
2015-09-24 15:07:52,040 TRACE [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-12) [] START, GetConfigurationValueQuery(GetConfigurationValueParameters:{refresh='false', filtered='false', version='general', configurationValue='ApplicationMode'}), log id: 7289de9d
2015-09-24 15:07:52,040 TRACE [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-12) [] FINISH, GetConfigurationValueQuery, log id: 7289de9d
2015-09-24 15:07:52,041 TRACE [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-12) [] START, GetConfigurationValueQuery(GetConfigurationValueParameters:{refresh='false', filtered='false', version='general', configurationValue='ProductRPMVersion'}), log id: 5b47740d
2015-09-24 15:07:52,041 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-12) [] Query execution failed due to insufficient permissions.

Comment 5 Moti Asayag 2015-10-08 20:41:31 UTC
I tried to reproduce the issue using the jdbc-aaa, however it was reproduced only once (seems that the cause of the failure is ValidateSessionQuery validation failure).

However, the rest of the attempts fails to produce the same error.
Is there any particular steps to reproduce this ? (i.e. first time user login)

Comment 6 Ondra Machacek 2015-10-09 07:23:04 UTC
Sucessfully reproduced on latest 3.6.(rhevm-backend-3.6.0-0.18.el6.noarch)

There are no specific steps.

Few new things noticed:

1) If user have admin permissions and login to UP the error is not shown. (so don't try ie with admin@internal)

2)
The error appears always after login at the same time. So I guess it's something invoked by scheduler. As you can see it's always 9:XX:32

2015-10-09 09:09:32,090 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-10) [] Query execution failed due to insufficient permissions.
2015-10-09 09:09:32,090 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-10) [] Operation Failed: query execution failed due to insufficient permissions.
2015-10-09 09:10:32,090 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-1) [] Query execution failed due to insufficient permissions.
2015-10-09 09:10:32,091 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-1) [] Operation Failed: query execution failed due to insufficient permissions.


2015-10-09 09:14:32,404 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-2) [] Query execution failed due to insufficient permissions.
2015-10-09 09:14:32,405 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-2) [] Operation Failed: query execution failed due to insufficient permissions.


2015-10-09 09:16:32,415 ERROR [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-7) [] Query execution failed due to insufficient permissions.
2015-10-09 09:16:32,415 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-7) [] Operation Failed: query execution failed due to insufficient permissions.

Comment 7 Red Hat Bugzilla Rules Engine 2015-10-19 11:00:28 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 8 Yaniv Lavi 2015-10-29 12:19:48 UTC
In oVirt testing is done on single release by default. Therefore I'm removing the 4.0 flag. If you think this bug must be tested in 4.0 as well, please re-add the flag. Please note we might not have testing resources to handle the 4.0 clone.

Comment 9 Moti Asayag 2015-11-01 13:51:04 UTC
I was able to reproduce the scenario on my env as well, however the exact sequence for 100% reproducible is the following:

1. Send a request via the restapi with a user which has no admin rights, without providing the 'filter=true' as part of the request's header.

User 'user1' has only 'User Role' permissions.

The following request will succeed:
curl -v -H "filter: true" -u "user1@internal:123456" http://localhost:8080/api/
...
< HTTP/1.1 200 OK
...
It uses the filter api, where the accessed resources are restricted according to the permissions the user has.

The following request will fail:
curl -v -u "user1@internal:123456" http://localhost:8080/api/
...
< HTTP/1.1 400 Bad Request
<fault>
    <reason>Operation Failed</reason>
    <detail>query execution failed due to insufficient permissions.</detail>
</fault>
...

This is a legit failure, since a non-admin user is attempting to access the admin api.


All of the logs above contains restapi specific errors, i.e.:
2015-07-08 15:10:21,667 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-8) [] Operation Failed: query execution failed due to insufficient permissions.

Therefore no UserPortal <--> Backend issue is raised.

Without a specific case of a failure to access 'User Portal' (any attempt to invoke a query from the user portal without passing the 'filter'), I'd suggest to close this bug as NOTABUG.

Comment 10 Ondra Machacek 2015-11-02 07:47:17 UTC
I can't reproduce now as well, the broken command is now sending the filter param corectly.

2015-11-02 08:43:06,744 TRACE [org.ovirt.engine.core.bll.GetConfigurationValueQuery] (ajp-/127.0.0.1:8702-9) [] START, GetConfigurationValueQuery(GetConfigurationValueParameters:{refresh='false', filtered='true', version='general', configurationValue='ProductRPMVersion'}), log id: 24eb41a3

But it could be some race. So I wouldn't close yet, I'll try to find the root cause.

Comment 11 Oved Ourfali 2015-11-02 07:50:52 UTC
Targeting to 4.0, in case it will still be relevant.

Comment 12 Oved Ourfali 2016-03-15 08:22:04 UTC
Closing as WORKSFORME.
If reproduced, please re-open.


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