Bug 468153 - Satellite-5.3.0-RHEL4-re20081022.0 installation: Could not connect to the database
Summary: Satellite-5.3.0-RHEL4-re20081022.0 installation: Could not connect to the dat...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Server
Version: 530
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Sayli Karmarkar
URL:
Whiteboard:
Depends On: 502958
Blocks: 456985
TreeView+ depends on / blocked
 
Reported: 2008-10-23 09:29 UTC by Milan Zázrivec
Modified: 2009-09-10 20:29 UTC (History)
5 users (show)

Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-10 20:29:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Milan Zázrivec 2008-10-23 09:29:54 UTC
Description of problem:
Satellite-5.3.0-RHEL4-re20081022.0 s390x installation:
# ./install.pl --disconnected --answer-file=/root/answers.txt
...
** Database: Installation complete.
** Database: Setting up database connection.
Could not connect to the database.  Your connection information may be
incorrect.  Error: DBI connect('rhnsat','rhnsat',...) failed: ORA-01034:
ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory (DBD ERROR: OCISessionBegin) at
/usr/lib/perl5/vendor_perl/5.8.5/Spacewalk/Setup.pm line 1102

Obviously database server is unable to start:
# /sbin/runuser -l oracle -c '/usr/bin/db-control start'
Starting database... Filehandle GEN0 opened only for output at /usr/lib/perl5/site_perl/5.8.5/Dobby/DB.pm line 308.
done.

Version-Release number of selected component (if applicable):
Satellite-5.3.0-RHEL4-re20081022.0 + EmbeddedDB / s390x
spacewalk-web-0.3.2-1.el4

Comment 1 Milan Zázrivec 2008-10-23 11:32:59 UTC
Downgrading to spacewalk-dobby-0.3.1-2.el4 helped (i.e. I was able to start
rhn-database without any errors ...)

Comment 3 Clifford Perry 2008-10-24 17:34:08 UTC
--> Processing Dependency: stringtree-json for package: spacewalk-java
--> Finished Dependency Resolution
Error: Missing Dependency: stringtree-json is needed by package spacewalk-java

Comment 4 Dennis Gilmore 2008-10-24 17:38:01 UTC
cvs diff -u
cvs diff: Diffing .
Index: comps-rhel4-rhnsat53.xml
===================================================================
RCS file: /cvs/devel/comps/comps-rhel4-rhnsat53.xml,v
retrieving revision 1.13
diff -u -r1.13 comps-rhel4-rhnsat53.xml
--- comps-rhel4-rhnsat53.xml    22 Oct 2008 13:41:15 -0000      1.13
+++ comps-rhel4-rhnsat53.xml    24 Oct 2008 17:37:00 -0000
@@ -269,6 +269,7 @@
        <packagereq type="default">SatConfig-generator</packagereq>
        <packagereq type="default">SatConfig-installer</packagereq>
        <packagereq type="default">SatConfig-spread</packagereq>
+       <packagereq type="default">stringtree-json</packagereq>
     </packagelist>
   </group>
 </comps>
Index: comps-rhel5-rhnsat53.xml
===================================================================
RCS file: /cvs/devel/comps/comps-rhel5-rhnsat53.xml,v
retrieving revision 1.14
diff -u -r1.14 comps-rhel5-rhnsat53.xml
--- comps-rhel5-rhnsat53.xml    22 Oct 2008 13:45:11 -0000      1.14
+++ comps-rhel5-rhnsat53.xml    24 Oct 2008 17:37:00 -0000
@@ -206,6 +206,7 @@
        <packagereq type="default">SatConfig-generator</packagereq>
        <packagereq type="default">SatConfig-installer</packagereq>
        <packagereq type="default">SatConfig-spread</packagereq>
+       <packagereq type="default">stringtree-json</packagereq>
     </packagelist>
   </group>
 </comps>
cvs diff: Diffing 6.2
cvs diff: Diffing po

Comment 5 Clifford Perry 2008-10-24 19:10:41 UTC
Satellite-5.3.0-RHEL5-re20081024.1-i386-embedded-oracle.iso 

installs successfully for me. Monitoring has issues, but that was not my main goal here for this ISO. I plan to test the i386 RHEL 4 ISO version as well tonight. I plan to send out email to satellite-devel and satellite-qa lists if these two ISO's look good. I do not have capacity to pre-test ALL arch ISO's. 

Cliff

Comment 6 Clifford Perry 2008-10-24 19:31:13 UTC
Satellite-5.3.0-RHEL4-re20081024.1-i386-embedded-oracle.iso   

Package installation completed without errors. 

Created RHEL 4 Guest on test13-64 with 22 Gig space 
 - gave it 2 gig RAM and 1 gig SWAP
Edited the /etc/sysconfig/rhn/up2date to disable GPG
Registered the system to RHN Hosted
Used Sat 5.3 Cert - redhat-internal-devel.cert
mounted ISO and ran

./install.pl --disconnected

So far setting up DB... expect though for the installation to complete.

Comment 7 Milan Zázrivec 2008-10-25 10:17:21 UTC
I'm seeing the same error on s390x / rhel4  with the latest compose:

# /sbin/runuser -l oracle -c '/usr/bin/db-control start'
Starting database... Filehandle GEN0 opened only for output at 
/usr/lib/perl5/site_perl/5.8.5/Dobby/DB.pm line 308.
done.

Comment 8 Clifford Perry 2008-10-25 13:04:42 UTC
yes - same here. Code change made by Michael recently works fine for RHEL 5, but RHEL 4's perl seems not like the code change. I was looking last night, but this stuff is new to me, so was not getting very far. 

Michael or Milan, my RHEL 4 system is IP:

10.10.77.142

normal root login, if you care to try to test/fix on a RHEL 4 system. 

-bash-3.00$ db-control start
Starting database... Filehandle GEN0 opened only for output at /usr/lib/perl5/site_perl/5.8.5/Dobby/DB.pm line 308.
done.
-bash-3.00$ 

Line 308 is:

      sysread $rds->[0], $buffer, 1024;

Diff to 0.3.1-2 shows:

--- 1/usr/lib/perl5/site_perl/5.8.5/Dobby/DB.pm 2008-10-24 22:30:35.000000000 +0200
+++ 3/usr/lib/perl5/site_perl/5.8.5/Dobby/DB.pm 2008-10-24 22:31:17.000000000 +0200
@@ -19,9 +19,11 @@
 use PXT::Config;
 use Dobby::Log;
 
+use IO::Select ();
+use IPC::Open2 ();
+
 use Carp qw/carp croak/;
 
-use File::Temp qw/tempfile/;
 use File::Spec::Functions;
 use IO::Handle;
 
@@ -288,30 +290,42 @@
 
   $ENV{ORACLE_SID} = $self->config->get("sid");
   $ENV{ORACLE_HOME} = $self->config->get("oracle_home");
-  my ($wr, $tmpfile) = tempfile(DIR => "/tmp", SUFFIX => '.sql');
-
-  $wr->print("CONNECT / AS SYSDBA\n");
-
-  for my $command (@commands) {
-    Dobby::Log->log("    sent: $command");
-    $wr->print("$command\n");
-  }
-
-  $wr->print("EXIT\n");
-  close $wr;
 
   my $sqlplus = catfile($self->config->get("oracle_home"), 'bin', 'sqlplus');
-  my $pid = open(RD, join(" ", $sqlplus, '-S', '/nolog', '@' . $tmpfile, '|'));
-
-  while (<RD>) {
-    Dobby::Log->log("    read: $_");
+  my($chld_out, $chld_in);
+  my $pid = IPC::Open2::open2($chld_out, $chld_in, $sqlplus, '-S', '/nolog');
+  my $s = IO::Select->new($chld_out, $chld_in);
+  $chld_in->print("CONNECT / AS SYSDBA\n");
+  while ($s->handles and my ($rds, $wrs, $errs) = IO::Select->select($s, $s, $s)) {
+    if (defined $errs and @$errs) {
+      for my $e (@$errs) {
+        $s->remove($e);
+        $e->close;
+      }
+    }
+    elsif (defined $rds and @$rds) {
+      my $buffer = '';
+      sysread $rds->[0], $buffer, 1024;
+      if (length($buffer) == 0) {
+        $s->remove($rds->[0]);
+      } else {
+        Dobby::Log->log("    read: $buffer");
+      }
+    }
+    elsif (defined $wrs and @$wrs) {
+      if (@commands) {
+        my $command = shift @commands;
+        Dobby::Log->log("    sent: $command");
+        $wrs->[0]->print("$command\n");
+      } else {
+        $wrs->[0]->print("EXIT\n");
+        $s->remove($wrs->[0]);
+        $wrs->[0]->close;
+      }
+    }
   }
 
-  close RD;
-
   Dobby::Log->log("Completed sqlplus conversation");
-
-  unlink $tmpfile;
 }
 
 sub connect {

Comment 9 Michael Mráka 2008-10-29 13:57:20 UTC
Fixed in git repo

commit 1547f587d39d3fd96f658e78ec0abbeb2c116d94
    468153 - don't mix read and write fds

Comment 10 Michael Mráka 2008-10-29 14:33:48 UTC
Packages spacewalk-dobby-0.3.4-1*.

Comment 11 Sayli Karmarkar 2009-06-15 15:19:09 UTC
verified. No errors in installation.

Comment 12 John Matthews 2009-08-13 14:30:14 UTC
Move to RELEASE_PENDING

We've installed multiple versions of ISO 7/24 on RHEL4/5 and database connections are working.

Comment 13 Brandon Perkins 2009-09-10 20:29:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html


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