Bug 884286

Summary: rhn-search fails silently to build index for serverCustomInfo
Product: [Community] Spacewalk Reporter: Zailo Leite <zleite>
Component: ServerAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.8   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-07 13:25:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1484117    

Description Zailo Leite 2012-12-05 20:05:24 UTC
Description of problem:

rhn-search fails silently to build index for serverCustomInfo if last_modified_by column value is null in table rhnServerCustomDataValue.

Version-Release number of selected component (if applicable):

milestone 1.8

How reproducible:

Always.

Steps to Reproduce:
1. set last_modified_by to "" in rhnServerCustomDataValue for a given row;
2. run /etc/init.d/rhn-search cleanindex 
  
Actual results:

Searches for values in Custom info will not return hits. No log messages about failure to index table.

Expected results:

Indexes and functional search for values in Custom info, or error message in logs about failure to index table.

Additional info:

Running query "UPDATE rhnServerCustomDataValue SET last_modified_by='1'"; fixes the problem.

The table schema allows for nulls in created_by and last_modified_by. Maybe they should be set to "not null"? At least that would generate an error instead of table corruption.


               Table "public.rhnservercustomdatavalue"
      Column      |           Type           |       Modifiers        
------------------+--------------------------+------------------------
 server_id        | numeric                  | not null
 key_id           | numeric                  | not null
 value            | character varying(6000)  | 
 created_by       | numeric                  | 
 last_modified_by | numeric                  | 
 created          | timestamp with time zone | not null default now()
 modified         | timestamp with time zone | not null default now()

Comment 1 Zailo Leite 2013-01-04 20:01:20 UTC
I tried adding a "not null" constraint in the field, and as a result calling system.setCustomValues fails trying to set a null value, so it seems that it is an API problem...

Comment 2 Milan Zázrivec 2014-03-07 13:25:51 UTC
I tried to set custom system values with Webui, API & rhn-custom-value
utility -- rhnServerCustomDataValue.last_modified_by was always set
correctly and search server always correctly indexed the created
custom system value (all Spacewalk 2.1).

Setting the value in last_modified_by column to NULL may corrupt
functionality of Spacewalk (or some if its parts), nevertheless,
this is not a valid use case nor a valid bug reproducer for Spacewalk.

Closing.

Comment 3 Eric Herget 2017-09-28 17:56:12 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.