Bug 789770 - USER_IS_ALREADY_LOGGED_IN after failed command
Summary: USER_IS_ALREADY_LOGGED_IN after failed command
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Ori Liel
QA Contact: Ilanit Stein
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-12 22:15 UTC by Floris
Modified: 2016-02-10 19:11 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-26 07:36:54 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)
Data sent and received to reproduce (12.47 KB, text/plain)
2012-07-15 13:43 UTC, Floris
no flags Details

Description Floris 2012-02-12 22:15:15 UTC
It seems that if an API command fails (e.g. because you used the invalid syntax), the command that comes right after it fails as well with an "401 Unauthorized" HTTP error.
Subsequent commands do work properly again.


oVirt log seems to suggest the user is already logged in.
Perhaps it did not log out properly after the error?

==
2012-02-12 20:46:13,085 WARN  [org.ovirt.engine.core.bll.LoginAdminUserCommand] (http--0.0.0.0-8080-1) CanDoAction of action LoginAdminUser failed. Reasons:USER_IS_ALREADY_LOGGED_IN
2012-02-12 20:46:13,086 INFO  [org.ovirt.engine.api.restapi.security.auth.LoginValidator] (http--0.0.0.0-8080-1) Login failure, user: admin domain: internal reason: [USER_IS_ALREADY_LOGGED_IN]
==

Comment 6 Ori Liel 2012-07-15 12:29:51 UTC
Floris, can you please give some more information about how to reproduce this bug? 

I wrote a shell script with two consecutive curl commands. The first is update with bad syntax, the second is update with good syntax. The commands are executed sequentially, one right after the other. The first one fails with SAX exception (due to the bad syntax), but the second one succeeds; I do not see the "user still logged-in" issue.

Comment 7 Floris 2012-07-15 13:43:57 UTC
Created attachment 598308 [details]
Data sent and received to reproduce

Issue occurs when you trying to create a new VM (POST /api/vms), and having a syntax error there.
See attached.

Comment 9 Ori Liel 2012-07-18 07:28:59 UTC
Thanks for the log. I updated my curl script to execute the same commands that you've sent. However, the second command still works fine. 

Contents of script curl_commands.sh: 

#First request:
#---------------
echo '<vmSYNTAXERROR><name></name><cluster id="test"/><template><name>Blank</name></template><memory>805306368</memory><os><boot dev="hd"/></os><display><type>vnc</type></display></vm>' | curl -v -u "admin@internal":letmein! -H "Content-type:application/xml" 'http://localhost:8080/api/vms' -X POST -T -

#Second request:
#--------------
curl -v -u "admin@internal":letmein! -H "Content-type:application/xml" 'http://localhost:8080/api/networks' -X GET


What did you use to send the http requests (curl?)

Ori

Comment 10 Floris 2012-07-18 12:52:50 UTC
>What did you use to send the http requests (curl?)

PHP Zend framework HTTP classes
Log was created with Wireshark. So I'm certain what it sends is correct.


Also my requests are done from another server, not localhost. Not sure if that might affect your login session restrictions.

Comment 13 Ori Liel 2012-07-26 07:36:54 UTC
I tried from a remote computer as well (reply to comment 10), and the problem still didn't reproduce.

I can't fix without reproducing, so I'm closing the bug. Maybe one day it will resurface in a way that will allow reproducing it.


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