Skip to content

Instantly share code, notes, and snippets.

@wvega
Created March 21, 2014 02:20
Show Gist options
  • Save wvega/9678244 to your computer and use it in GitHub Desktop.
Save wvega/9678244 to your computer and use it in GitHub Desktop.
My solution to an issue that was already [fixed](https://github.com/socrata-cookbooks/java/pull/146) :(

I'm getting the following error when I try to install Oracle's Java 6 or 7:

ERROR: java_ark[jdk] (java::oracle line 49) had an error: SystemExit: exit

I think is caused by this other error:

FATAL: Failed to extract file jdk-6u45-linux-x64.bin!

Chef output related to java recipe appears below:

[serverdomain.com] out: Recipe: java::set_java_home
[serverdomain.com] out:   * ruby_block[set-env-java-home] action run
[serverdomain.com] out:     - execute the ruby block set-env-java-home
[serverdomain.com] out:   * directory[/etc/profile.d] action create (up to date)
[serverdomain.com] out:   * file[/etc/profile.d/jdk.sh] action create
[serverdomain.com] out:     - update content in file /etc/profile.d/jdk.sh from 582633 to b17f19
[serverdomain.com] out:         --- /etc/profile.d/jdk.sh    2014-03-21 00:07:31.755003000 +0000
[serverdomain.com] out:         +++ /tmp/.jdk.sh20140321-20472-1f0amjn   2014-03-21 00:08:42.303003000 +0000
[serverdomain.com] out:         @@ -1,2 +1,2 @@
[serverdomain.com] out:         -export JAVA_HOME=/usr/lib/jvm/java-8-oracle-amd64
[serverdomain.com] out:         +export JAVA_HOME=/usr/lib/jvm/java-6-oracle-amd64
[serverdomain.com] out: Recipe: java::oracle
[serverdomain.com] out:   * java_ark[jdk] action installRecipe: <Dynamically Defined Resource>
[serverdomain.com] out:   * package[curl] action install (up to date)
[serverdomain.com] out:
[serverdomain.com] out:     - download oracle tarball straight from the server[2014-03-21T00:08:42+00:00] FATAL: Failed to extract file jdk-6u45-linux-x64.bin!
[serverdomain.com] out:
[serverdomain.com] out: ================================================================================
[serverdomain.com] out: Error executing action `install` on resource 'java_ark[jdk]'
[serverdomain.com] out: ================================================================================
[serverdomain.com] out:
[serverdomain.com] out: SystemExit
[serverdomain.com] out: ----------
[serverdomain.com] out: exit
[serverdomain.com] out:
[serverdomain.com] out: Cookbook Trace:
[serverdomain.com] out: ---------------
[serverdomain.com] out: /tmp/supportvine/chef/cookbooks/java/providers/ark.rb:143:in `block (2 levels) in class_from_file'
[serverdomain.com] out: /tmp/supportvine/chef/cookbooks/java/providers/ark.rb:133:in `block in class_from_file'
[serverdomain.com] out:
[serverdomain.com] out: Resource Declaration:
[serverdomain.com] out: ---------------------
[serverdomain.com] out: # In /tmp/supportvine/chef/cookbooks/java/recipes/oracle.rb
[serverdomain.com] out:
[serverdomain.com] out:  49: java_ark "jdk" do
[serverdomain.com] out:  50:   url tarball_url
[serverdomain.com] out:  51:   checksum tarball_checksum
[serverdomain.com] out:  52:   app_home java_home
[serverdomain.com] out:  53:   bin_cmds bin_cmds
[serverdomain.com] out:  54:   alternatives_priority 1062
[serverdomain.com] out:  55:   action :install
[serverdomain.com] out:  56: end
[serverdomain.com] out:  57:
[serverdomain.com] out:
[serverdomain.com] out: Compiled Resource:
[serverdomain.com] out: ------------------
[serverdomain.com] out: # Declared in /tmp/supportvine/chef/cookbooks/java/recipes/oracle.rb:49:in `from_file'
[serverdomain.com] out:
[serverdomain.com] out: java_ark("jdk") do
[serverdomain.com] out:   action [:install]
[serverdomain.com] out:   supports {:report=>true, :exception=>true}
[serverdomain.com] out:   retries 0
[serverdomain.com] out:   retry_delay 2
[serverdomain.com] out:   cookbook_name :java
[serverdomain.com] out:   recipe_name "oracle"
[serverdomain.com] out:   url "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin"
[serverdomain.com] out:   checksum "6b493aeab16c940cae9e3d07ad2a5c5684fb49cf06c5d44c400c7993db0d12e8"
[serverdomain.com] out:   app_home "/usr/lib/jvm/java-6-oracle-amd64"
[serverdomain.com] out:   bin_cmds ["appletviewer", "apt", "ControlPanel", "extcheck", "HtmlConverter", "idlj", "jar", "jarsigner", "java", "javac", "javadoc", "javah", "javap", "javaws", "jconsole", "jcontrol", "jdb", "jhat", "jinfo", "jmap", "jps", "jrunscript", "jsadebugd", "jstack", "jstat", "jstatd", "jvisualvm", "keytool", "native2ascii", "orbd", "pack200", "policytool", "rmic", "rmid", "rmiregistry", "schemagen", "serialver", "servertool", "tnameserv", "unpack200", "wsgen", "wsimport", "xjc"]
[serverdomain.com] out:   alternatives_priority 1062
[serverdomain.com] out:   default true
[serverdomain.com] out: end
[serverdomain.com] out:
[serverdomain.com] out:
[serverdomain.com] out: Running handlers:
[serverdomain.com] out: [2014-03-21T00:08:42+00:00] ERROR: Running exception handlers
[serverdomain.com] out: Running handlers complete
[serverdomain.com] out: [2014-03-21T00:08:42+00:00] ERROR: Exception handlers complete
[serverdomain.com] out: [2014-03-21T00:08:42+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[serverdomain.com] out: Chef Client failed. 4 resources updated in 19.667188728 seconds
[serverdomain.com] out: [2014-03-21T00:08:42+00:00] ERROR: java_ark[jdk] (java::oracle line 49) had an error: SystemExit: exit
[serverdomain.com] out: [2014-03-21T00:08:43+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[serverdomain.com] out:


Fatal error: sudo() received nonzero return code 1 while executing!

Requested: chef-solo --no-color -c chef/solo.rb -j chef/solo.json
Executed: sudo -S -p 'sudo password:'  /bin/bash -l -c "cd /tmp/supportvine && chef-solo --no-color -c chef/solo.rb -j chef/solo.json"

Aborting.
Disconnecting from serverdomain.com... done.

I downloaded the referenced tar.gz file and tried to extract it manually:

# tar xvzf jdk-7u51-linux-x64.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

This is the cURL command used to download the .tar.gz file:

curl --create-dirs -L --cookie "oraclelicensejdk-7u51-b13-oth-JPR=accept-securebackup-cookie;gpw_e24=http://edelivery.oracle.com" http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz -o jdk-7u51-linux-x64.tar.gz

I believe the cookie used is invalid. I was able to download the tar.gz file using this cURL command:

curl --create-dirs -L --cookie "oraclelicense=accept-securebackup-cookie; gpw_e24=http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html" http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz -o jdk-7u51-linux-x64.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment