Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1057202 - cannot assign permissions to already added user
Summary: cannot assign permissions to already added user
Keywords:
Status: CLOSED DUPLICATE of bug 1057147
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-core
Version: 3.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.4.0
Assignee: Martin Perina
QA Contact: bugs@ovirt.org
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-23 15:50 UTC by Petr Beňas
Modified: 2015-01-04 23:05 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-29 12:07:54 UTC
oVirt Team: ---


Attachments (Terms of Use)

Description Petr Beňas 2014-01-23 15:50:18 UTC
Description of problem:
Cluster permissions can be set only for users, which were not added yet.

Version-Release number of selected component (if applicable):
3.4.0-0.5.beta1.fc19

How reproducible:
100%

Steps to Reproduce:
1. Add IPA domain using engine-manage-domains
2. in webUI, click Users tab and add an user
3. click Clusters, Permissions, Add 
4. assign a role to the user added in point 2.

Actual results:
User admin failed to grant permission for Role PowerUserRole on Cluster Default to User/Group Non interactive user.
Role can be assigned to user, which was not added yet

Expected results:


Additional info:
/var/log/ovirt-engine/engine.log

2014-01-23 17:41:23,396 INFO  [org.ovirt.engine.core.bll.AddPermissionCommand] (org.ovirt.thread.pool-6-thread-43) [17124635] Running command: AddPermissionCommand internal: false. Entities affected :  ID: 00000001-0001-0001-0001-000000000001 Type: VdsGroups,  ID: aaa00000-0000-0000-0000-123456789aaa Type: System
2014-01-23 17:41:23,400 ERROR [org.ovirt.engine.core.bll.AddPermissionCommand] (org.ovirt.thread.pool-6-thread-43) [17124635] Command org.ovirt.engine.core.bll.AddPermissionCommand throw exception: org.springframework.dao.DuplicateKeyException: CallableStatementCallback; SQL [{call insertuser(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; ERROR: duplicate key value violates unique constraint "users_domain_external_id_unique"
  Detail: Key (domain, external_id)=(brq-ipa.rhev.lab.eng.brq.redhat.com, \xf58875086f4311e18091001a4a013f06) already exists.
  Where: SQL statement "INSERT INTO users(department, domain, email, groups, name, note, role, active, surname, user_id, username, group_ids, external_id)
        VALUES(v_department, v_domain, v_email, v_groups, v_name, v_note, v_role, v_active, v_surname, v_user_id, v_username, v_group_ids, v_external_id)"
PL/pgSQL function insertuser(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,uuid,character varying,character varying,bytea) line 3 at SQL statement; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "users_domain_external_id_unique"
  Detail: Key (domain, external_id)=(brq-ipa.rhev.lab.eng.brq.redhat.com, \xf58875086f4311e18091001a4a013f06) already exists.
  Where: SQL statement "INSERT INTO users(department, domain, email, groups, name, note, role, active, surname, user_id, username, group_ids, external_id)
        VALUES(v_department, v_domain, v_email, v_groups, v_name, v_note, v_role, v_active, v_surname, v_user_id, v_username, v_group_ids, v_external_id)"
PL/pgSQL function insertuser(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,uuid,character varying,character varying,bytea) line 3 at SQL statement
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241) [spring-jdbc.jar:]
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1030) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1064) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:388) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.simple.AbstractJdbcCall.doExecute(AbstractJdbcCall.java:351) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.simple.SimpleJdbcCall.execute(SimpleJdbcCall.java:181) [spring-jdbc.jar:]
        at org.ovirt.engine.core.dao.DbUserDAODbFacadeImpl.save(DbUserDAODbFacadeImpl.java:119) [dal.jar:]
        at org.ovirt.engine.core.bll.AddPermissionCommand.executeCommand(AddPermissionCommand.java:94) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1114) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1199) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:1875) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:210) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInRequired(TransactionSupport.java:149) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:118) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1219) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:351) [bll.jar:]
        at org.ovirt.engine.core.bll.MultipleActionsRunner.executeValidatedCommand(MultipleActionsRunner.java:179) [bll.jar:]
        at org.ovirt.engine.core.bll.MultipleActionsRunner.runCommands(MultipleActionsRunner.java:151) [bll.jar:]
        at org.ovirt.engine.core.bll.MultipleActionsRunner$2.run(MultipleActionsRunner.java:160) [bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:97) [utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_51]
        at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_51]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
        at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "users_domain_external_id_unique"
  Detail: Key (domain, external_id)=(brq-ipa.rhev.lab.eng.brq.redhat.com, \xf58875086f4311e18091001a4a013f06) already exists.
  Where: SQL statement "INSERT INTO users(department, domain, email, groups, name, note, role, active, surname, user_id, username, group_ids, external_id)
        VALUES(v_department, v_domain, v_email, v_groups, v_name, v_note, v_role, v_active, v_surname, v_user_id, v_username, v_group_ids, v_external_id)"
PL/pgSQL function insertuser(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,uuid,character varying,character varying,bytea) line 3 at SQL statement
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:410)
        at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.execute(CachedPreparedStatement.java:297)
        at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.execute(WrappedPreparedStatement.java:404)
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1066) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.JdbcTemplate$6.doInCallableStatement(JdbcTemplate.java:1064) [spring-jdbc.jar:]
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:1014) [spring-jdbc.jar:]
        ... 23 more

2014-01-23 17:41:23,416 ERROR [org.ovirt.engine.core.bll.AddPermissionCommand] (org.ovirt.thread.pool-6-thread-43) [17124635] Transaction rolled-back for command: org.ovirt.engine.core.bll.AddPermissionCommand.

Comment 1 Einav Cohen 2014-01-24 15:34:45 UTC
from above: 
"... Command org.ovirt.engine.core.bll.AddPermissionCommand throw exception ..." - seems like an engine-core problem -> changing BZ Component accordingly.

Comment 2 Itamar Heim 2014-01-26 08:12:16 UTC
Setting target release to current version for consideration and review. please
do not push non-RFE bugs to an undefined target release to make sure bugs are
reviewed for relevancy, fix, closure, etc.

Comment 3 Einav Cohen 2014-01-29 12:05:17 UTC
looks like a duplicate of bug 1057147 (which is already in POST)?

Comment 4 Yair Zaslavsky 2014-01-29 12:07:54 UTC

*** This bug has been marked as a duplicate of bug 1057147 ***


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