Bug 1129641 - Py-sdk commands fail with "RequestError"
Summary: Py-sdk commands fail with "RequestError"
Status: CLOSED DUPLICATE of bug 1122546
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-sdk
Version: 3.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.5.0
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
Whiteboard: infra
Depends On:
Blocks: 1110830
TreeView+ depends on / blocked
Reported: 2014-08-13 12:16 UTC by Ori Gofen
Modified: 2016-05-26 01:48 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-08-20 17:58:07 UTC
oVirt Team: Infra

Attachments (Terms of Use)
attach_snap_liron.py (1.35 KB, text/x-python)
2014-08-13 12:16 UTC, Ori Gofen
no flags Details

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

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>
  File "/usr/lib/python2.6/site-packages/ovirtsdk/api.py", line 152, in __init__
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 118, in request
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 146, in __doRequest
  File "/usr/lib/python2.6/site-packages/ovirtsdk/web/connection.py", line 134, in doRequest
    raise RequestError, response
status: 401
reason: Unauthorized
detail: HTTP Status 401
Version-Release number of selected component (if applicable):

How reproducible:

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-- Running command: LoginUserCommand internal: false.
2014-08-20 14:43:27,866 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ajp-- 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-- 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 of the SDK. It isn't available in ovirt.org yet, but you can get it here:


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

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