...Does not work with Java 11, as the tarball is now in the format of jdk-11_linux-x64_bin.tar.gz.
The semantic versioning (and action to move the tarball) that expects three digits breaks on this kind of file name.
When the source tarball is renamed (to download from a local artifactory) from jdk-11_linux-x64_bin.tar.gz to jdk-11.0.0_linux-x64_bin.tar.gz, parse_app_dir_name will succeed, but the actual extracted tarball creates a folder of jdk-11, so the mv command (from cache folder to target folder) fails.
(In addition, the bin_cmds for the jdk 11 family probably need to be added).
More details:
Cookbook version
2.2.0
Chef-client version
14.3.37
Platform Details
Oracle Linux 7.5
Scenario:
Trying to install Java 11.
Steps to Reproduce:
To reproduce, create a wrapper cookbook for the java cookbook, I did it with with default attributes for java 11:
With artifact renamed (not pulled from Oracle website), chef-client will download, but will not move the file:
* java_oracle_install[jdk] action install
* directory[/usr/lib/jvm] action create (up to date)
* remote_file[/var/chef/cache/jdk-11.0.0_linux-x64_bin.tar.gz] action create_if_missing
- create new file /var/chef/cache/jdk-11.0.0_linux-x64_bin.tar.gz
- update content in file /var/chef/cache/jdk-11.0.0_linux-x64_bin.tar.gz from none to 246a0e
(file sizes exceed 10000000 bytes, diff output suppressed)
- change mode from '' to '0755'
- restore selinux security context
* yum_package[tar] action install (up to date)
Recipe: base_server::oracle
* file[/tmp/all.deploy] action delete (skipped due to only_if)
Running handlers:
- Chef::Handler::ErrorReport
Running handlers complete
Chef Client failed. 5 resources updated in 30 seconds
Relevant error lines:
[2018-09-26T16:44:52+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-09-26T16:44:52+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-09-26T16:47:14+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2018-09-26T16:47:43+00:00] FATAL: Command ' mv "/var/chef/cache/jdk-11.0.0" "/usr/lib/jvm/jdk-11.0.0" ' failed
(the cookbook expects the extracted folder to match the major.minor.patch version, the actual folder is /var/chef/cache/jdk-11 )
The code for Java >=10: https://github.com/sous-chefs/java/blob/master/resources/oracle_install.rb#L211-L218
Introduced with: https://github.com/sous-chefs/java/commit/c77ffd8dc5e8820a95b91ec4a555be4c2afc106f
...Does not work with Java 11, as the tarball is now in the format of
jdk-11_linux-x64_bin.tar.gz
.The semantic versioning (and action to move the tarball) that expects three digits breaks on this kind of file name.
When the source tarball is renamed (to download from a local artifactory) from
jdk-11_linux-x64_bin.tar.gz
tojdk-11.0.0_linux-x64_bin.tar.gz
, parse_app_dir_name will succeed, but the actual extracted tarball creates a folder of jdk-11, so the mv command (from cache folder to target folder) fails.(In addition, the bin_cmds for the jdk 11 family probably need to be added).
More details:
Cookbook version
2.2.0
Chef-client version
14.3.37
Platform Details
Oracle Linux 7.5
Scenario:
Trying to install Java 11.
Steps to Reproduce:
To reproduce, create a wrapper cookbook for the java cookbook, I did it with with default attributes for java 11:
and node over-rides to download a specific version:
Expected Result:
Install of java
Actual Result:
Install failure.
With default/expected name:
With artifact renamed (not pulled from Oracle website), chef-client will download, but will not move the file:
Relevant error lines:
(the cookbook expects the extracted folder to match the major.minor.patch version, the actual folder is /var/chef/cache/jdk-11 )