Search code examples
debiandatastaxopscenter

DataStax OpCenter Fails to Install


I'm trying to install DataStax OpsCenter onto a fresh Debian 8.2 install and it's erring during installation with the following:

Setting up opscenter (5.2.2) ...
Generating a 1024 bit RSA private key
....................................++++++
......................++++++
writing new private key to '/var/lib/opscenter/ssl/opscenter.key'
-----
keytool error: java.lang.IllegalArgumentException: java.io.IOException: Invalid char:  
dpkg: error processing package opscenter (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (215-17+deb8u3) ...
Errors were encountered while processing:
 opscenter
E: Sub-process /usr/bin/dpkg returned an error code (1)

Oracle's Java 8 (JVM only) is already installed and verified as you can see here:

java -version
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

It seems to be failing during creation of an RSA key, presumably for the SSL site.

I'm installing this using the DataStax APT repo. Any idea how to fix this? I've tried installing from 5.2.4, 5.2.3 and 5.2.2.


Solution

  • found the answer on the link below after diving into the postint files. Short answer : the gnu keytool is being used and not the Oracle-one due to the way "debian/ubuntu" update-alternatives works when installing java.

    I also found that datastax will need to update their code to include the new -genkeypair instead of -genkey to avoid breaking in the future.

    https://groups.google.com/forum/#!topic/android-developers/OYtL7aqj3z0

    Did copy/paste of the answer.

    // look which keytool is first in path

    which keytool

    /usr/bin/keytool

    // this is just a link, so let's look deeper

    ls -al /usr/bin/keytool

    lrwxrwxrwx 1 root root 39 2008-09-24 21:41 /usr/bin/keytool -> /etc/alternatives/keytool

    // again just a link

    ls -al /etc/alternatives/keytool

    lrwxrwxrwx 1 root root 37 2008-06-10 08:27 /etc/alternatives/keytool -> /usr/lib/jvm/java-gcj/jre/bin/keytool

    here is the problem, the keytool in path is the one from the gnu java vm.

    here my solution: rm /etc/alternatives/keytool ln -s /usr/lib/jvm/some-sun-vm/bin/keytool /etc/alternatives/keytool rm -rf /home/myhome/.android eclipse -> and start working...

    I think this is a Ubuntu issue and there is a nicer way to change the keytool alternative, but this worked for me.