Bug 1129641

Summary: Py-sdk commands fail with "RequestError"
Product: [Retired] oVirt Reporter: Ori Gofen <ogofen>
Component: ovirt-engine-sdkAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED DUPLICATE QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.5CC: acanan, acathrow, bugs, ecohen, gklein, iheim, ogofen, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-20 17:58:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1110830    
Attachments:
Description Flags
attach_snap_liron.py none

Description Ori Gofen 2014-08-13 12:16:46 UTC
Created attachment 926385 [details]
attach_snap_liron.py

Description of problem:
After an attempt to execute attach_snapshot command flow(attached file)
which have already worked on other versions.

Py-sdk failed with error message:

Traceback (most recent call last):
  File "attach_snap_liron.py", line 11, in <module>
    debug=False
  File "/usr/lib/python2.6/site-packages/ovirtsdk/api.py", line 152, in __init__
    url=''
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 118, in request
    persistent_auth=self._persistent_auth)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 146, in __doRequest
    persistent_auth=persistent_auth
  File "/usr/lib/python2.6/site-packages/ovirtsdk/web/connection.py", line 134, in doRequest
    raise RequestError, response
ovirtsdk.infrastructure.errors.RequestError: 
status: 401
reason: Unauthorized
detail: HTTP Status 401
 
Version-Release number of selected component (if applicable):
rc1

How reproducible:
100%

Steps to Reproduce:
1.see file

Actual results:
operation fails 

Expected results:


Additional info:

Comment 1 Juan Hernández 2014-08-20 09:42:14 UTC
This is exactly what happens when you use an incorrect user name or password? Can you double check that?

Also please check the engine.log file, as it may indicate what is the reason for the failed authentication.

Comment 2 Ori Gofen 2014-08-20 11:10:41 UTC
double checked.user and password are correct.

Comment 3 Juan Hernández 2014-08-20 11:12:12 UTC
Did you check the engine.log file?

Comment 4 Ori Gofen 2014-08-20 11:48:58 UTC
from the engine logs:

2014-08-20 14:43:26,248 INFO  [org.ovirt.engine.core.bll.OvfDataUpdater] (DefaultQuartzScheduler_Worker-34) Attempting to update VMs/Templates Ovf.
2014-08-20 14:43:27,850 INFO  [org.ovirt.engine.core.bll.aaa.LoginUserCommand] (ajp--127.0.0.1-8702-8) Running command: LoginUserCommand internal: false.
2014-08-20 14:43:27,866 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ajp--127.0.0.1-8702-8) Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: User admin logged in.

                                 *** Note ***
when attempting to connect to py-sdk with a wrong username or password the engine.log message is different:

2014-08-20 14:46:33,894 ERROR [org.ovirt.engine.core.aaa.filters.BasicAuthenticationFilter] (ajp--127.0.0.1-8702-9) Failure in authentication to profile org.ovirt.engine.core.aaa.AuthenticationProfile@34e4ab2b. Invocation Result code is 0. Authn result code is 12

Comment 5 Juan Hernández 2014-08-20 12:53:17 UTC
Can you please run this adding the debug=True parameter to the call of the API constructor and report the results? Take into account that the results will contain the user password, so you may want to change it before running the test.

Comment 7 Juan Hernández 2014-08-20 17:58:07 UTC
This is a duplicate of bug 1122546. Please repeat your test with version 3.5.0.4 of the SDK. It isn't available in ovirt.org yet, but you can get it here:

  https://jhernand.fedorapeople.org/rpms/ovirt-engine-sdk-python/3.5.0.4-1

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