Bug 1172541 - The migration from PostgreSQL to Oracle: Error messages
Summary: The migration from PostgreSQL to Oracle: Error messages
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Upgrades
Version: 570
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Dobes
QA Contact: Martin Korbel
URL:
Whiteboard:
Depends On:
Blocks: sat570-upgrades
TreeView+ depends on / blocked
 
Reported: 2014-12-10 10:44 UTC by Martin Korbel
Modified: 2015-01-13 10:25 UTC (History)
3 users (show)

Fixed In Version: spacewalk-setup-2.3.0-12
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-13 10:25:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Korbel 2014-12-10 10:44:52 UTC
Description of problem:
We get errors, when we try to reconfigure DB settings during migration process. If we have got enable selinux, the migration process fails without any message in audit.log.  

Version-Release number of selected component (if applicable):
Satellite-5.7.0-RHEL6-re20141203.0
  oracle-config-1.1-7.el6sat.noarch
  oracle-instantclient-selinux-10.2.0.19-6.el6sat.noarch
  oracle-nofcontext-selinux-0.1.23.36-1.el6sat.noarch
  spacewalk-backend-sql-oracle-2.3.3-22.el6sat.noarch
  Oracle-XE-CoreOS-Oracle-XE-util-oracle-user-1.0-4.noarch
  quartz-oracle-1.8.4-5.el6sat.noarch
  oracle-instantclient-sqlplus-10.2.0-47.el6sat.x86_64
  spacewalk-java-oracle-2.3.8-84.el6sat.noarch
  oracle-instantclient-sqlplus-selinux-10.2.0.19-6.el6sat.noarch
  oracle-instantclient-basic-10.2.0-47.el6sat.x86_64
  spacewalk-oracle-2.3.0-1.5.el6sat.noarch

Oracle 10g:
  oracle-server-x86_64-10.2.0.4-76.el6sat.x86_64
  oracle-config-1.1-7.el6sat.noarch
  oracle-server-scripts-10.2.0.51-6.el6sat.noarch
  oracle-nofcontext-selinux-0.1.23.25-3.el6sat.noarch


How reproducible:
100%

Steps to Reproduce:
1. We have got a Satellite 5.7 with embPG DB + a machine with Oracle DB
2. Follow these steps:
# Preparing of the satellite
> yum upgrade -y
> /usr/bin/spacewalk-schema-upgrade
> yum install spacewalk-utils
> yum remove rhn-upgrade -y  # bz1171675
> rhn-satellite stop
> service postgresql start
# make a dump
> spacewalk-dump-schema --to=oracle  > /tmp/spacewalk-postgresql.dump
# disable postgresql
> service postgresql stop
> chkconfig postgresql off
> yum remove spacewalk-postgresql
> yum install spacewalk-oracle # You should be sure, the dependencies are installed from the correct channel.
# Configure DB
> setenforce 0 # problem with selinux
> spacewalk-setup --db-only --external-oracle
* Setting up SELinux..
* Setting up Oracle environment.
* Setting up database.
** Database: Setting up database connection for Oracle backend.
'' is not a valid response
Database hostname [localhost]? nec-em29.rhts.eng.bos.redhat.com
'' is not a valid response
Database (listener) port [1521]? 1522
*** Database connection error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)
Database service name (SID)? xrhnsatx.world
Database hostname [localhost]? nec-em29.rhts.eng.bos.redhat.com
Database (listener) port [1521]? 1522
*** Database connection error: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin)
Username? spaceuser
Password? 
** Database: Testing database connection.
** Database: Populating database.
** Database: --clear-db option used.  Clearing database.
** Database: Shutting down spacewalk services that may be using DB.
** Database: Services stopped.  Clearing DB.
*** Progress: ##############################################################

Actual results:
If we have enabled a enforce selinux, spacewalk-setup fails with ORA-12546: TNS:permission denied in populate_db.log.

We can see some baffling errors in the output of script:
'' is not a valid response
*** Database connection error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor (DBD ERROR: OCIServerAttach)
*** Database connection error: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin)

and another baffling thing:
Why the script wants to get hostname and port twice? 

Expected results:
The migration process can work with a enabled selinux.

Expected output of spacewalk-setup:
* Setting up SELinux..
* Setting up Oracle environment.
* Setting up database.
** Database: Setting up database connection for Oracle backend.
Database hostname [localhost]? nec-em29.rhts.eng.bos.redhat.com
Database (listener) port [1521]? 1522
Database service name (SID)? xrhnsatx.world
Username? spaceuser
Password? 
** Database: Testing database connection.
** Database: Populating database.
** Database: --clear-db option used.  Clearing database.
** Database: Shutting down spacewalk services that may be using DB.
** Database: Services stopped.  Clearing DB.
*** Progress: ##############################################################

Additional info:

Comment 4 Jan Dobes 2014-12-14 22:48:13 UTC
fixed in spacewalk master:

8e15326284976b992f01bfb4eccf0d01765ec039
442c0fa91ad6a2f3ad241dd0be9cc1b10aaadc96

Comment 7 Martin Korbel 2014-12-22 10:05:13 UTC
VERIFIED on spacewalk-setup-2.3.0-12.el6sat.

Reproducer via comment 0.

Output:
spacewalk-setup --db-only --external-oracle --clear-db
* Setting up SELinux..
* Setting up Oracle environment.
* Setting up database.
** Database: Setting up database connection for Oracle backend.
Database service name (SID)? xrhnsatx.world
Database hostname [localhost]? nec-em29.rhts.eng.bos.redhat.com
Database (listener) port [1521]? 1522
Username? spaceuser
Password?
** Database: Testing database connection.
** Database: Populating database.
** Database: --clear-db option used.  Clearing database.
** Database: Shutting down spacewalk services that may be using DB.
** Database: Services stopped.  Clearing DB.
*** Progress: ####################################################

Comment 8 Clifford Perry 2015-01-13 10:25:07 UTC
With the release of Red Hat Satellite 5.7 on January 12th 2015 this bug is
being moved to a Closed Current Release state. 

The Satellite 5.7 GA Errata:
 - https://rhn.redhat.com/errata/RHSA-2015-0033.html 

Satellite 5.7 Release Notes:
 -
https://access.redhat.com/documentation/en-US/Red_Hat_Satellite/5.7/html-single/Release_Notes/index.html

Satellite Customer Portal Blog announcement for release:
 - https://access.redhat.com/blogs/1169563/posts/1315743 

Cliff

NOTE: This bug has not been re-verified (moved to RELEASE_PENDING) prior to release. We assume that the bug has indeed been fixed and not regressed since we initially verified it. Please re-open in the future if needed.


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