Bug 1120692 - NPE when opening SPICE console
Summary: NPE when opening SPICE console
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-webadmin
Version: 3.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Piotr Kliczewski
QA Contact: Jiri Belka
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-17 12:56 UTC by Raz Tamir
Modified: 2016-02-10 19:33 UTC (History)
11 users (show)

Fixed In Version: ovirt-3.5.0_rc1.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-17 12:43:13 UTC
oVirt Team: Infra


Attachments (Terms of Use)
engine log (11.49 MB, text/plain)
2014-07-17 12:56 UTC, Raz Tamir
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 31150 master MERGED core: making sure not throw NPE when opening SPICE console Never
oVirt gerrit 31174 ovirt-engine-3.5 MERGED core: making sure not throw NPE when opening SPICE console Never

Description Raz Tamir 2014-07-17 12:56:00 UTC
Created attachment 918697 [details]
engine log

Description of problem:
When opening SPICE console SetVmTicketCommand is running and follows with NPE:
2014-07-17 15:49:39,146 ERROR [org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo] (DefaultQuartzScheduler_Worker-7) [5f98205d] ResourceManager::RerunFailedCommand: Error: NullPointerException: , vds = 56ec3952-6545-4301-a19f-fe9b974d0433 : aqua-vds5.qa.lab.tlv.redhat.com
.....

Version-Release number of selected component (if applicable):
ovirt-engine-3.5.0-0.0.master.20140629172257.git0b16ed7.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. open SPICE console
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Michal Skrivanek 2014-07-18 09:44:45 UTC
log is full of NPEs, seems related to command context similarly to bug 1120725

Comment 2 Michal Skrivanek 2014-07-18 09:56:00 UTC
however adding needinfo on Omer, as to why vmDynamic.getConsoleCurrentUserName returns NULL?

Comment 3 Yair Zaslavsky 2014-07-18 11:07:15 UTC
SetVmTicket.getConsoleUserName

Performs getCurrentUser and the consuler user name is updated later on
(see the perform method).


if you look at both CTORs of CommandBase -

protected CommandBase(T parameters)

and

protected CommandBase(T parameters, CommandContext cmdContext)

eventually a command CommandContext will be created if not passed from parent command (this is the case of VmTicket - it is the top level command).

Then the db user will be extracted from the session data container based on the session.

As I see it - a session timeout might have occurred, or due to some other reason the session id passed at the parameters of SetVmTicket is wrong.

Comment 4 Omer Frenkel 2014-07-20 10:17:43 UTC
Doesn't look related to the changes around command context,
(there is no error in command or query)
looks more related to this change:
http://gerrit.ovirt.org/#/c/26456/

getConsoleCurrentUserName() can return null..

please put me as reviewer for the fix

Comment 5 Piotr Kliczewski 2014-07-28 15:10:37 UTC
I tried to reproduce it with latest 3.5. Can you please give more information what needs to be done to reproduce?

Comment 6 Raz Tamir 2014-07-29 09:30:59 UTC
Just open SPICE console

Comment 7 Piotr Kliczewski 2014-07-29 09:55:02 UTC
The console is opened without any issues.

Comment 8 Michal Skrivanek 2014-07-29 10:45:50 UTC
I'd try going through Unknown VM state perhaps, and/or open the console close to lifecycle events

in any case as Omer pointed out the code change 26456 should be fixed/reverted

Comment 9 Piotr Kliczewski 2014-08-01 07:37:35 UTC
I tested it with ovirt 3.5 beta2. There were no issues with Chrome but when I run it from firefox there was no console. I changed vv file association in  nautilus.
I restarted firefox and it works OK now.

It may be fixed as Michal suggested.

Comment 10 Pavel Stehlik 2014-08-06 10:44:52 UTC
When was real issue & fixed, why NOTABUG?

Comment 11 Michal Skrivanek 2014-08-06 11:16:40 UTC
(In reply to Piotr Kliczewski from comment #9)
> It may be fixed as Michal suggested.

I didn't suggest that. I said (and Omer as well) that the code in 26456 broke it and it _should_ be fixed
The code is simply wrong when the console username is NULL and that does happen in certain conditions

Comment 12 Piotr Kliczewski 2014-08-06 11:42:52 UTC
I am not sure whether it was fixed or not but I was not able to reproduce the bug. Please provide steps that will help me understand what the issue is.

Comment 13 Michal Skrivanek 2014-08-06 13:31:39 UTC
even if you look at it from coverity perspective it's just accessing a return value from function possibly returning NULL, so it's wrong in any case.
Unfortunately I don't know the exact scenario

Comment 14 Piotr Kliczewski 2014-08-06 13:44:00 UTC
I tested it before with 3.5 and was not able to reproduce. Coverity bug needs to be fixed but how do we know if it fixes this bug as well. We are unable to reproduce.

Comment 15 Oved Ourfali 2014-08-06 13:46:58 UTC
(In reply to Piotr Kliczewski from comment #14)
> I tested it before with 3.5 and was not able to reproduce. Coverity bug
> needs to be fixed but how do we know if it fixes this bug as well. We are
> unable to reproduce.

Just add a check if username is null, before doing the username manipulation.

Comment 16 Jiri Belka 2014-09-11 12:39:46 UTC
ok, rhevm-backend-3.5.0-0.11.beta.el6ev.noarch

no NPE while opening spice console via native.

Comment 17 Sandro Bonazzola 2014-10-17 12:43:13 UTC
oVirt 3.5 has been released and should include the fix for this issue.


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