Bug 884286 - rhn-search fails silently to build index for serverCustomInfo
Summary: rhn-search fails silently to build index for serverCustomInfo
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.8
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space27
TreeView+ depends on / blocked
 
Reported: 2012-12-05 20:05 UTC by Zailo Leite
Modified: 2017-09-28 17:56 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-07 13:25:51 UTC
Embargoed:


Attachments (Terms of Use)

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.


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