Bug 1519541 - log-collector-analyzer: ERROR: column v.agent_ip does not exist
Summary: log-collector-analyzer: ERROR: column v.agent_ip does not exist
Alias: None
Product: ovirt-log-collector
Classification: oVirt
Component: analyzer
Version: 4.2.0
Hardware: All
OS: All
Target Milestone: ovirt-4.2.2
: 4.2.3
Assignee: Ala Hino
QA Contact: David Necpal
Depends On:
Blocks: 1456888
TreeView+ depends on / blocked
Reported: 2017-11-30 21:11 UTC by Douglas Schilling Landgraf
Modified: 2018-03-29 11:12 UTC (History)
6 users (show)

Fixed In Version: ovirt-log-collector-4.2.3
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2018-03-29 11:12:30 UTC
oVirt Team: Integration
rule-engine: ovirt-4.2+
rule-engine: exception+
dnecpal: testing_plan_complete-
ylavi: planning_ack+
sbonazzo: devel_ack+
lsvaty: testing_ack+

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
oVirt gerrit 86418 master MERGED analyzer: Fix generating agent IP info 2018-01-17 17:35:33 UTC
oVirt gerrit 86491 ovirt-log-collector-4.2 MERGED analyzer: Fix generating agent IP info 2018-01-17 17:38:59 UTC

Description Douglas Schilling Landgraf 2017-11-30 21:11:47 UTC
The column agent_ip has changed name, we require to fix analyzer for recent db (4.2).

Generating reports:
psql:/usr/share/ovirt-log-collector/analyzer/produceReport/sqls/hosts_query_all.sql:137: ERROR:  column v.agent_ip does not exist
LINE 8:             v.agent_ip AS "Agent IP",
            v.vds_name AS "Name of Host",
            CASE WHEN sp.spm_vds_id=v.vds_id THEN 'SPM' ELSE 'Normal' END AS "SPM",
            coalesce(htt.text, 'Unknown (id='||v.vds_type||')') AS "Host Type",
            c.name AS "Cluster",
            sp.name AS "Data Center",
            v.agent_ip AS "Agent IP",
            v.host_name AS "FQDN or IP",
            regexp_replace(v.rpm_version, '[a-z]+.', '') AS "vdsm",
            v.kvm_version AS "qemu-kvm",
            regexp_replace(v.libvirt_version, '[a-z]+.', '') AS "libvirt",
            v.spice_version AS "spice",
            v.kernel_version AS "kernel",
            hst.text AS "Status",
            v.host_os AS "Operating System",
            v.vm_count AS "VM Count",
            v.mem_available AS "Available memory (MB)",
            v.usage_mem_percent AS "Used memory %",
            v.usage_cpu_percent AS "CPU load %"
            vds v
        JOIN cluster c ON c.cluster_id=v.cluster_id
        LEFT OUTER JOIN storage_pool sp ON c.storage_pool_id = sp.id
        LEFT OUTER JOIN host_status_temp hst ON hst.id = v.status
        LEFT OUTER JOIN host_type_temp htt ON htt.id = v.vds_type
        ORDER BY c.name, v.vds_name
CONTEXT:  PL/pgSQL function __temp_hosts_show_all() line 20 at RETURN QUERY
Generated analyzer_report.html

Comment 1 Douglas Schilling Landgraf 2017-12-12 15:54:45 UTC
Just a hint from: 

    -- We might have cases where engine db's like 3.2, 3.3, 3.4, 3.5 have
    -- vds table with column ip and 3.6 or later with column agent_ip.
    -- To avoid a second SQL query when going to compat mode let's
    -- change the column name in our own local temp. db.
    IF EXISTS (SELECT column_name
               FROM information_schema.columns
               WHERE table_name='vds' and column_name='ip') THEN
        ALTER TABLE vds RENAME COLUMN ip TO agent_ip;
    END IF;

Comment 2 Yaniv Lavi 2018-01-15 08:41:16 UTC
Please make sure you don't break compatibility with 3.x which is the main use case of the analyzer right now.

Comment 3 David Necpal 2018-02-27 17:28:51 UTC
Verified on version ovirt-log-collector-analyzer-4.2.4-3.el7ev.noarch

Comment 4 Sandro Bonazzola 2018-03-29 11:12:30 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.

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