Bug 1332421 - [REST-API] The completion of copying template disk audit log is shown with user SYSTEM
Summary: [REST-API] The completion of copying template disk audit log is shown with us...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: RestAPI
Version: 3.6.5
Hardware: x86_64
OS: Unspecified
unspecified
low vote
Target Milestone: ovirt-4.0.4
: ---
Assignee: Fred Rolland
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-03 07:32 UTC by Elad
Modified: 2016-09-07 11:48 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-07 11:48:06 UTC
oVirt Team: Storage
amureini: ovirt-4.0.z?
ylavi: planning_ack+
tnisan: devel_ack+
acanan: testing_ack+


Attachments (Terms of Use)
engine.log (29.19 KB, application/x-gzip)
2016-05-03 07:32 UTC, Elad
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1324363 0 unspecified CLOSED [REST-API] Copy of template disk doesn't complete nicely 2021-02-22 00:41:40 UTC

Internal Links: 1324363

Description Elad 2016-05-03 07:32:23 UTC
Created attachment 1153260 [details]
engine.log

Description of problem:
When copying a template disk via REST-API, the audit log of the operation completion is shown with user SYSTEM instead of the actual user that did the operation (admdin@internal in my case). 
The audit log of the same operation, done via Webadmin portal includes the right user.


Version-Release number of selected component (if applicable):
rhevm-3.6.6-0.1.el6.noarch
rhevm-restapi-3.6.6-0.1.el6.noarch
rhevm-webadmin-portal-3.6.6-0.1.el6.noarch


How reproducible:
100%

Steps to Reproduce:
1. Copy a template disk via REST-API. For example:

<action>
<storage_domain>
<name>nfs9</name>
</storage_domain>
</action>


Actual results:
The following audit log is shown in Webadmin portal for copying a template disk via REST-API (for the operation completion):

User SYSTEM finished copying disk 1_Disk1 to domain nfs9.

engine.log:

2016-05-03 08:09:06,002 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-6-thread-10) [] Correlation ID: 7cdd7e56, Job ID: 38836a9b-572
e-4dc0-be41-11e44ac7641a, Call Stack: null, Custom Event ID: -1, Message: User SYSTEM finished copying disk 1_Disk1 to domain nfs9.


This is different from the audit log shown for the same operation completion while it's being done via Webadmin portal:

User admin@internal finished copying disk 1_Disk1 to domain nfs9.

engine.log:


2016-05-03 08:12:50,712 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-6-thread-46) [] Correlation ID: e30683a, Job ID: 27bcd335-6cd6
-4116-9e1f-696659fd6cfe, Call Stack: null, Custom Event ID: -1, Message: User admin@internal finished copying disk 1_Disk1 to domain nfs9.



Expected results:
The actual user should be reported in the audit log while copying a template disk via REST-API and not SYSTEM

Additional info: engine.log

Comment 1 Tal Nisan 2016-05-03 10:16:39 UTC
Tried to reproduce on 3.6.6, seems to work OK:
 User admin@internal-authz finished copying disk 1_Disk1 to domain NFS_TAL2.
 User admin@internal-authz logged out.
 User admin@internal-authz is copying disk 1_Disk1 to domain NFS_TAL2.

Moving to MODIFIED so you can test it on 3.6.6

Comment 2 Elad 2016-05-10 14:21:43 UTC
Still getting SYSTEM instead of the actual user in the audit log of template disk copy completion.

User SYSTEM finished copying disk test1_Disk1 to domain nfs13.

2016-05-10 15:20:11,250 INFO  [org.ovirt.engine.core.bll.MoveOrCopyDiskCommand] (org.ovirt.thread.pool-6-thread-7) [] Lock freed to object 'EngineLock:{exclusiveLocks='[ec57bc76-37ae-409b-9fd5-7f66385db6e5=<DISK, ACTION_TYPE_FAILED_DISK_IS_BEING_MIGRATED$DiskName test1_Disk1>]', sharedLocks='[4074a6a6-e573-4f99-9802-67f1ca0985f6=<TEMPLATE, ACTION_TYPE_FAILED_DISK_IS_BEING_MIGRATED$DiskName test1_Disk1>]'}'
2016-05-10 15:20:11,274 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-6-thread-7) [] Correlation ID: 7fb25bf, Job ID: 368aefbe-afe9-44a0-805c-19dabf7ca865, Call Stack: null, Custom Event ID: -1, Message: User SYSTEM finished copying disk test1_Disk1 to domain nfs13.

Used:
rhevm-3.6.6.2-0.1.el6.noarch

Comment 3 Red Hat Bugzilla Rules Engine 2016-05-10 14:21:50 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 4 Allon Mureinik 2016-06-27 11:56:00 UTC
Juan - if you're taking this, please change the team to Infra.
If not, please reassign it to me.

Comment 5 Fred Rolland 2016-08-30 13:53:47 UTC
Elad,
I cannot reproduce this issue in version 4.
Can you see if it is still happening to you ?
Thanks.

Comment 6 Elad 2016-09-07 11:36:28 UTC
Wasn't able to reproduce on latest 4.0 either.

POST application/xml to:

https://elad-rhevm3.scl.lab.tlv.redhat.com/ovirt-engine/api/disks/46e87932-14b1-48fe-accd-4da99f55ff39/copy

Body:

<action>
<storage_domain>
<name>nfs1</name>
</storage_domain>
</action>


Log:

2016-09-07 14:32:42,952 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (default task-11) [68db17c9] Correlation ID: 22cdc879, Job ID: b3ccf139-ba89-44ef-89ad-2b
b991014425, Call Stack: null, Custom Event ID: -1, Message: User admin@internal-authz is copying disk vm-1_Disk1 to domain nfs1.

rhevm-4.0.4-0.1.el7ev.noarch
ovirt-engine-restapi-4.0.4-0.1.el7ev.noarch

Comment 7 Allon Mureinik 2016-09-07 11:48:06 UTC
Closing based on that comment, please reopen if this reproduces


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