Created attachment 918697 [details]
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):
Steps to Reproduce:
1. open SPICE console
log is full of NPEs, seems related to command context similarly to bug 1120725
however adding needinfo on Omer, as to why vmDynamic.getConsoleCurrentUserName returns NULL?
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)
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.
Doesn't look related to the changes around command context,
(there is no error in command or query)
looks more related to this change:
getConsoleCurrentUserName() can return null..
please put me as reviewer for the fix
I tried to reproduce it with latest 3.5. Can you please give more information what needs to be done to reproduce?
Just open SPICE console
The console is opened without any issues.
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
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.
When was real issue & fixed, why NOTABUG?
(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
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.
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
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.
(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.
no NPE while opening spice console via native.
oVirt 3.5 has been released and should include the fix for this issue.