oracle / vagrant-projects

Vagrant projects for Oracle products and other examples
Universal Permissive License v1.0
930 stars 473 forks source link

Listener Configuration fails with /etc/init.d/oracle-xe-18c configure #491

Open CMacFly opened 10 months ago

CMacFly commented 10 months ago

Hello, I try to configure a vagrantbox with oracle linux 7 and oracle database 18c XE. Host system is Ubuntu 22.04, vagrant runs with virtualbox 6.1.38. But every attempt I made failed, the listener configuration stops with an error:

oracle18c-xe-vagrant: /opt/oracle/product/18c/dbhomeXE/bin/netca: line 182: 31310 Aborted $JRE $JRE_OPTIONS -classpath $CLASSPATH oracle.net.ca.NetCA $*

oracle18c-xe-vagrant: Listener configuration failed. Check log '/opt/oracle/cfgtoollogs/netca/netca_configure_out.log' for more details.

The log says:

Oracle Net Services Configuration:

# A fatal error has been detected by the Java Runtime Environment:

# SIGSEGV (0xb) at pc=0x00007f71e467a88c, pid=31310, tid=0x00007f722889f700

# JRE version: Java(TM) SE Runtime Environment (8.0_171-b11) (build 1.8.0_171-b11) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.171-b11 mixed mode linux-amd64 compressed oops) # Problematic frame: # C [libclntsh.so.18.1+0x63588c] snlinGetAddrInfo+0x9dc

# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

This error was also reported here: https://community.oracle.com/tech/developers/discussion/4180595/etc-init-d-oracle-xe-18c-configure-fails . As suggested in the error message I tried

ulimit -c unlimited

with no effect. Also a reboot of the vagrantbox and the suggested double execution of

/etc/init.d/oracle-xe-18c configure

does not help. The installation of 18c XE breaks with the failing listener configuration at every attempt. Has anyone an idea how to solve this problem? Thanks & regards Christoph

PaulNeumann commented 10 months ago

@CMacFly Listener configuration for Oracle Database 18c XE requires specific hostname and network configuration.

The OracleDatabase/18.4.0-XE project in this repository avoids the "Listener configuration failed" problem by explicitly setting the VM's hostname to "localhost" in the Vagrantfile.

("localhost" is the default hostname, but it can be overridden if another Vagrantfile that specifies a hostname is merged with your project's Vagrantfile, so it's safer to set it explicitly.)

I recommend destroying the VM, then adding the following line to your Vagrantfile to explicitly set the hostname:

config.vm.hostname = "localhost"

Also, comment out or remove any config.vm.network statements in your Vagrantfile, except for forwarded_port(s).

After these changes, listener configuration should succeed when you build the VM again.

I hope this helps.

CMacFly commented 10 months ago

@PaulNeumann I copied the repository from github and did'nt modify the Vagrantfile. The vm hostname is set to "localhost". Prior to post the incident here (if it is one) I found and read your suggestions on the listener related problem with the vm hostname. So this is not the case here. vagrantbox-hostname

PaulNeumann commented 10 months ago

@CMacFly I misread your initial post to mean that you had built your own Vagrantfile, rather than using the one from this repository. My apologies.

I can't reproduce the error on an Ubuntu 22.04.3 LTS host (fully patched, 6.2.0-31-generic kernel) with VirtualBox 7.0.10 r158379 and Vagrant 2.3.7. Both VirtualBox and Vagrant were downloaded from the vendors' sites, not from the Ubuntu repositories. VM provisioning succeeded with no errors.

The error messages you posted seem to be from the second (or later) run of /etc/init.d/oracle-xe-18c configure. This doesn't provide information about the initial error.

I'd suggest destroying the VM (vagrant destroy -f) and trying the build again. In my experience, it's not worth trying to fix the VM when listener configuration fails, because it's so easy to start over.

When you build the VM again, please use vagrant up | tee provision.log to capture the output of vagrant up in a file. If provisioning fails, please post the contents of this file, along with the netca logs from the VM and the contents of the /etc/hosts file on the VM.

CMacFly commented 9 months ago

@PaulNeumann Thank you for your answer. I also have to apologize: 1st of answering so late (I only have a small amount of time to experiment with future versions of our oracle database) and 2nd of writing "try to configure". That leads to misunderstandings, I now see.

Okay, back to our topic: I followed your recommendations, but the installation of oracle database 18.4.0-XE failed again with the same error.

According to the log files I may have a java problem, but I admit: those logs arent't helpful to me. I hope, they tell you, what's going on and how to fix it ...

I don't think that it is helpful to copy and paste all logs to this posting, instead I attached them:

netca_OraHomeXE-2309188PM5107.log trace_OraHomeXE-2309188PM5107.log provision.log hs_err_pid30730.log netca_configure_out.log

PaulNeumann commented 9 months ago

@CMacFly No need to apologize for the delay. It's no problem. Thanks for posting the logs.

I don't think this is a Java issue. The netca_configure_out.log file contains a line saying, "The crash happened outside the Java Virtual Machine in native code." The error occurs in the Oracle client library libclntsh.so, in snlinGetAddrInfo, which is network-related. The /etc/hosts file that you posted looks fine.

Unfortunately, I'm still not able to reproduce the error, and I don't see an obvious cause in the logs. I saw that you're using the vagrant-vbguest plugin, so I installed that, and I changed the character set to WE8MSWIN1252. The build still succeeded on my machine.

So, apparently I'm missing something. A couple of questions:

CMacFly commented 9 months ago

@PaulNeumann No plugins despite vagrant-vbguest and the recommended vagrant-env.

Output of vagrant plugin list: vagrant-env (0.0.3, global) vagrant-vbguest (0.31.0, global)

I installed vagrant-vbguest, because my first attempt to install 18c XE after your first answer to my issue was stopped, because of the wrong version of virtualbox guestadditions (virtualbox 7.0 with guestadditions 6.3???).

No Vagrantfile in ~/.vagrant.d: boxes bundler data gems insecure_private_key plugins.json rgloader setup_version tmp

Meanwhile (just not to do nothing ...) I installed ora 19.3.0 without any problems. I don't konw if this helps in any way. I just wanted to know if an other version of Oracle database would run on my system.

PaulNeumann commented 9 months ago

@CMacFly I apologize for the delay in getting back to you.

I still think the issue is network-related, but I don't know what's different about our machines. I'm glad to hear that the 19.3.0 project works for you. The relevant difference between that project and the 18.4.0-XE project is that 19.3.0 creates the Oracle Database network configuration files (sqlnet.ora, listener.ora and tnsnames.ora) directly, without calling netca. Which got me thinking about a workaround...

I've attached a modified version of the 18.4.0-XE install.sh script that creates the Oracle Database network configuration files, and temporarily modifies the oracle-xe-18c script inside the VM to bypass the call to netca. Since this is where you're seeing the issue, I think the modified script might work for you.

To use the modified script:

  1. Destroy the VM (vagrant destroy -f).
  2. Optional, but recommended: Uninstall the vagrant-vbguest plugin (vagrant plugin uninstall vagrant-vbguest). It's not necessary for any of the projects in this repository. You'll see a message during provisioning that the Guest Additions versions don't match, but everything will work fine. Using the plugin won't actually hurt anything, but it uses unnecessary time and network bandwidth.
  3. Back up the install.sh script in the ~/vagrant-projects/OracleDatabase/18.4.0-XE/scripts directory on your host.
  4. Copy the attached install.txt file into the ~/vagrant-projects/OracleDatabase/18.4.0-XE/scripts directory on your host and rename it to install.sh.
  5. Run vagrant up | tee provision.log.

The script worked correctly on my machine, but that's the only host I've tested it on. Obviously, it isn't officially supported.

I hope this helps. Please let me know how it goes.

Modified script: install.txt