Bug 855119 - Corrupted config file / kickstart script data on postgresql
Summary: Corrupted config file / kickstart script data on postgresql
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: WebUI
Version: 1.8
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Pazdziora
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space18
TreeView+ depends on / blocked
 
Reported: 2012-09-06 18:14 UTC by Stephen Herr
Modified: 2012-11-01 16:17 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-01 16:17:14 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Herr 2012-09-06 18:14:06 UTC
Description of problem:
If you are using the PostgreSQL database and a certain number of unknown other conditions are met, then config file and kickstart script contents appears corrupted in the webui. Unfortunately it is impossible to reproduce on some (most?) systems, due to some unknown variables. 

How reproducible:
On some systems, always, on other systems, never.

Steps to Reproduce:
1. View the contents of any config file or kickstart script in the webui
  
Actual results:
Contents are corrupted / are hex numbers instead of characters

Expected results:
File contents are displayed

Additional info:
This is due to the addition of a new and different default output style for bytea type fields in Postgres 9.0. In 9.0 the default output type is hex digits, whereas before then the only and default output type for bytea fields was the "escape" output type. All code in Spacewalk assumes it is receiving the "escape" type response from the bytea field, so if the database returns hex instead it doesn't know how to parse it and displays improperly.

The fix for this is really simple. We just need to set the tell the database to always use the escape output type for bytea fields:

ALTER DATABASE database SET bytea_output = 'escape';

Comment 1 Stephen Herr 2012-09-06 18:15:29 UTC
And not, in case it is not clear, the above fix should be safe on every system, regardless of if it is currently manifesting the problem or not.

Comment 2 Jan Pazdziora 2012-10-31 10:54:14 UTC
I believe this has been addressed in Spacewalk nightly / 1.8. The bytea_output is not needed (and could actually be harmful).

Comment 3 Jan Pazdziora 2012-11-01 16:17:14 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18


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