Bug 855119 - Corrupted config file / kickstart script data on postgresql
Corrupted config file / kickstart script data on postgresql
Product: Spacewalk
Classification: Community
Component: WebUI (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jan Pazdziora
Red Hat Satellite QA List
Depends On:
Blocks: space18
  Show dependency treegraph
Reported: 2012-09-06 14:14 EDT by Stephen Herr
Modified: 2012-11-01 12:17 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-11-01 12:17:14 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stephen Herr 2012-09-06 14:14:06 EDT
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 14:15:29 EDT
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 06:54:14 EDT
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 12:17:14 EDT
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.