Under certain circumstances, OpsCenter Lifecycle Manager may fail to install java unless the OpsCenter version being used is at least 6.0.11 in the 6.0.x series, or 6.1.4 in the 6.1.x series. This issue may manifest with the following error message:
Again in text form for searchability:
Event ID: 77f93f21-9330-4e7b-8ab7-13f8f1fac50b Resource: http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/server-jre-8u181-linux-x64.tar.gz Event Type: error- MeldError Changes: No Result/Message: 404 Client Error: Not Found for url: http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/server-jre-8u181-linux-x64.tar.gz?AuthParam=1539811658_c1218317c8ada573336cc3d653d42fe9
LCM is capable of automatically downloading and installing the Java 8 runtime as a prerequisite for DSE. When using the Oracle runtime, downloads will fail when Oracle releases a new version of the Java runtime at a new download URL.
When installing the Oracle Java runtime, LCM has a default URL that it uses to download the software. When Oracle publishes a Java update, the URL changes the previous URL immediately stops working. Furthermore, the new URL cannot be predicted in advance. This means that there is a period during which the LCM default URL is incorrect and Java downloads fail by default.
This can be addressed 4 ways, any one of which is sufficient:
- Install the OpenJDK runtime instead of the Oracle runtime using LCM in OpsCenter 6.7.x, which is not affected by this issue.
- Update the Java Version in Config Profiles
- Self-hosting the Oracle java runtime
- Update Definitions
- OpsCenter 6.1.x is affected by default
- OpsCenter 6.5.x is affected by default
- OpsCenter 6.7.x is not affected by default because it installs the OpenJDK runtime rather than the Oracle Java runtime. However, 6.7.x may experience this issue when it is explicitly configured configured to install the Oracle runtime.
Switch to OpenJDK
A workaround that avoids this issue permanently is switching from the Oracle Java runtime to the OpenJDK runtime, which does not experience issues on upgrade.
Starting with OpsCenter 6.7.0, LCM installs the OpenJDK runtime from operating system vendor packages by default. This method of java deployment is more reliable than downloading the Oracle Java runtime directly from Oracle. Generally, no action is necessary to use OpenJDK from LCM in OpsCenter 6.7.x, but see Choosing a Java vendor in Lifecycle Manager for more details.
Updating the Java Version in Config Profiles
An alternate workaround that allows completing Oracle Java Runtime downloads immediately without waiting for updated definitions/defaults, is to update config-profiles to download the new version of the Oracle Java runtime. You will need to do this each time Oracle updates the Java runtime.
The LCM documentation for Managing Java Installs shows how to download a specific version of Java by updating the
java-setup page of your configuration profile(s). You can set
build-hash according to the current url published by oracle.
An example URL found at that page might be
http://download.oracle.com/otn-pub/java/jdk/8u191-b12/2787e4a523244c269598db4e85c51e0c/server-jre-8u191-linux-x64.tar.gz In this case, the relevant values are:
1.8.0, this never changes for a java 8 release.
Given correct values for each of the above fields, LCM will automatically construct the Oracle Java download URL.
Self-Hosting the Oracle Java Runtime
If you are concerned about future outages caused by Oracle Java updates, you can host Oracle Java yourself on an internally accessible web server. See the LCM offline install kbase for details.
By self-hosting the Oracle Java runtime at a private web-server, you ensure that the url does not expire immediately when Oracle releases an update. You can then update your privately hosted version at any time without experiencing deployment failures in the interim.
When Oracle releases a Java update, the engineering team that develops OpsCenter and LCM try to release updated defaults for the java-setup page as quickly as possible. This often happens within 24 hours of the Oracle Java update.
OpsCenter instances that have outbound HTTPS access to
opscenter.datastax.com will automatically download these updated definitions and once this happens jobs will be successful even if you take no action.
OpsCenter instances with limited outbound connectivity, or that have had definitions updates disabled, can have definitions manually updates as described in Updating and configuring definitions files properties.
Special Considerations for Older Versions of OpsCenter
Older versions of OpsCenter may encounter a second error message related to upgrading Java:
No such file or directory: 'local_policy.jar' because Oracle moved the location of the export-strength JCE policy files. Upgrade OpsCenter to 6.1.4 or a more recent version to resolve this issue, or work around it by unchecking the manage-jce box in the java-setup page of the relevant config-profile(s).