Bug 1059692 - [engine-log-collector] ERROR: Unable to connect to REST API. Reason: Bad Request / ERROR: _get_hypervisors_from_api:
Summary: [engine-log-collector] ERROR: Unable to connect to REST API. Reason: Bad Req...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: oVirt
Classification: Retired
Component: ovirt-engine-logcollector
Version: 3.4
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 3.4.0
Assignee: Eli Mesika
QA Contact: Jiri Belka
URL:
Whiteboard: integration
Depends On:
Blocks: 1041749
TreeView+ depends on / blocked
 
Reported: 2014-01-30 11:28 UTC by Jiri Belka
Modified: 2014-03-31 12:27 UTC (History)
10 users (show)

Fixed In Version: ovirt-3.4.0-beta3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-31 12:27:02 UTC
oVirt Team: ---


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 23488 None None None Never
oVirt gerrit 24240 None None None Never
Red Hat Bugzilla 1052854 None None None Never
Red Hat Bugzilla 1055517 None None None Never

Internal Links: 1052854 1055517

Description Jiri Belka 2014-01-30 11:28:57 UTC
Description of problem:
# engine-log-collector -H 10.34.63.222
INFO: Gathering oVirt Engine information...
INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
ERROR: Unable to connect to REST API.  Reason: Bad Request
ERROR: _get_hypervisors_from_api: 
status: 400
reason: Bad Request
detail: statementcallback; sql [select * from (select * from storage pool where ( id in (select storage pool with storage domain.id from  storage pool with storage domain  ))  order by name asc ) as t1 offset (-2147483648 -1) limit 2147483647]; error: integer out of range; nested exception is org.postgresql.util.psqlexception: error: integer out of range
ERROR: The following host are not listed as hypervisors: 10.34.63.222. Known hypervisors can be listed using the list command

I created separate BZ1059689 for sql output here...

Version-Release number of selected component (if applicable):
ovirt-log-collector-3.4.0-0.0.master.20131224.gite939ada.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1. engine-log-collector -H $ip_of_your_host
2.
3.

Actual results:
_get_hypervisors_from_api does not work

Expected results:
work work

Additional info:
-%-
# engine-log-collector --no-postgresql -v
INFO: Gathering oVirt Engine information...
DEBUG: calling(['sosreport', '--batch', '--report', '--build', '--tmp-dir=/tmp/logcollector-Mu9wI6', '-o', 'engine,rpm,libvirt,general,networking,hardware,process,yum,filesys,devicemapper,selinux,kernel,apache,memory', '-k', 'rpm.rpmva=off', '-k', 'general.all_logs=True', '-k', 'apache.log=True'])
DEBUG: returncode(0)
DEBUG: STDOUT(
sosreport (version 2.2)


  This command will collect diagnostic and configuration
information from this Red Hat Enterprise Linux system and
installed applications.

  An archive containing the collected information will be
generated in /tmp/logcollector-Mu9wI6 and may be provided
to a Red Hat support representative.

  Any information provided to Red Hat will be treated in
accordance with the published support policies at:


  https://access.redhat.com/support/

  The generated archive may contain data considered
sensitive and its content should be reviewed by the
originating organization before being passed to any third
party.

  No changes will be made to system configuration.


  Running plugins. Please wait ...


  Completed [1/14] ...      
  Completed [2/14] ...      
  Completed [3/14] ...      
  Completed [4/14] ...      
  Completed [5/14] ...      
  Completed [6/14] ...      
  Completed [7/14] ...      
  Completed [8/14] ...      
  Completed [9/14] ...      
  Completed [10/14] ...      
  Completed [11/14] ...      
  Completed [12/14] ...      
  Completed [13/14] ...      
  Completed [14/14] ...      

  sosreport build tree is located at : /tmp/logcollector-Mu9wI6/jb-rh34-2014013010541391075671

)
DEBUG: STDERR()
INFO: Skipping postgresql collection...
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
DEBUG: API Vendor(ovirt.org)	API Version(3.4.0)
ERROR: Unable to connect to REST API.  Reason: Bad Request
ERROR: _get_hypervisors_from_api: 

status: 400

reason: Bad Request

detail: statementcallback; sql [select * from (select * from storage pool where ( id in (select storage pool with storage domain.id from  storage pool with storage domain  ))  order by name asc ) as t1 offset (-2147483648 -1) limit 2147483647]; error: integer out of range; nested exception is org.postgresql.util.psqlexception: error: integer out of range
INFO: No hypervisors were selected, therefore no hypervisor data will be collected.
Creating compressed archive...
DEBUG: calling(['xz', '--version'])
DEBUG: returncode(0)
DEBUG: STDOUT(xz (XZ Utils) 4.999.9beta
liblzma 4.999.9beta
)
DEBUG: STDERR()
DEBUG: calling(['tar', '-cf', '/tmp/sosreport-LogCollector-20140130110353.tar', '-C', '/tmp/logcollector-Mu9wI6', '.'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
DEBUG: calling(['xz', '-1', '/tmp/sosreport-LogCollector-20140130110353.tar'])
DEBUG: returncode(0)
DEBUG: STDOUT()
DEBUG: STDERR()
DEBUG: calling(['md5sum', '/tmp/sosreport-LogCollector-20140130110353.tar.xz'])
DEBUG: returncode(0)
DEBUG: STDOUT(a1ed12ac75af2ffd1d464c131d60df53  /tmp/sosreport-LogCollector-20140130110353.tar.xz
)
DEBUG: STDERR()
INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20140130110353.tar.xz.
The MD5 for this file is a1ed12ac75af2ffd1d464c131d60df53 and its size is 7.4M
-%-

Comment 1 Sandro Bonazzola 2014-01-31 10:19:17 UTC
Probably related to bug #1055517

Comment 2 Sandro Bonazzola 2014-01-31 10:33:50 UTC
Hi Jiri, I've pushed a patch for bug #1055517 here: http://gerrit.ovirt.org/#/c/23935/
Can you reproduce the issue using that patch?

Comment 3 Juan Hernández 2014-01-31 10:43:57 UTC
This is caused by a integer overflow in the page calculations performed by the engine. The fix is in progress:

http://gerrit.ovirt.org/23488

Eli, you may want to take it.

Comment 4 Jiri Belka 2014-02-06 09:33:03 UTC
Not working... 

[root@jb-rh34 ovirt_log_collector]# engine-log-collector -H 10.34.62.205                                                                                                      
INFO: Gathering oVirt Engine information...
INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
ERROR: Unable to connect to REST API.  Reason: Unauthorized
ERROR: _get_hypervisors_from_api: 
status: 401
reason: Unauthorized
detail: HTTP Status 401
ERROR: The following host are not listed as hypervisors: 10.34.62.205. Known hypervisors can be listed using the list command
[root@jb-rh34 ovirt_log_collector]# sed -n '124,131p' /usr/lib/python2.6/site-packages/ovirt_log_collector/helper/hypervisors.py
    """
    Initialize the oVirt RESTful API
    """
    url='https://{hostname}/ovirt-engine/api'.format(
        hostname=hostname,
    )
    api = API(url=url,
              username=username,

Comment 5 Sandro Bonazzola 2014-02-07 12:26:50 UTC
Jiri, http://gerrit.ovirt.org/23488 is not merged yet, so the issue is not solved yet.

Comment 6 Sandro Bonazzola 2014-02-10 16:35:11 UTC
Move to modified?

Comment 7 Jiri Belka 2014-02-25 09:17:24 UTC
ok, works ok on 'beta3'.


# engine-log-collector -H 10.34.63.222
INFO: Gathering oVirt Engine information...
INFO: Gathering PostgreSQL the oVirt Engine database and log files from localhost...
Please provide the REST API password for the admin@internal oVirt Engine user (CTRL+D to skip): 
About to collect information from 1 hypervisors. Continue? (Y/n): Y
INFO: Gathering information from selected hypervisors...
INFO: collecting information from 10.34.63.222
INFO: finished collecting information from 10.34.63.222
Creating compressed archive...
INFO: Log files have been collected and placed in /tmp/sosreport-LogCollector-20140225091417.tar.xz.
The MD5 for this file is 955e44025c67f8937f6fbcd980670aad and its size is 20.8M

Comment 8 Sandro Bonazzola 2014-03-31 12:27:02 UTC
this is an automated message: moving to Closed CURRENT RELEASE since oVirt 3.4.0 has been released


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