Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal: [default]: FAILED! => {"changed": false, "dest": "/tmp/jdk-8u112-linux-x64.tar.gz", "failed": true, "msg": "Request failed", "response": "HTTP Error 404: Not Found", "state": "absent", "status_code": 404, "url": "http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz"} #62

Open
javahas opened this issue May 22, 2017 · 11 comments

Comments

@javahas
Copy link

javahas commented May 22, 2017

started getting this error today, it worked last week but now it doesn't

fatal: [default]: FAILED! => {"changed": false, "dest": "/tmp/jdk-8u112-linux-x64.tar.gz", "failed": true, "msg": "Request failed", "response": "HTTP Error 404: Not Found", "state": "absent", "status_code": 404, "url": "http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz"}

@manjitkumar
Copy link

manjitkumar commented May 23, 2017

I am also facing the same error.

fatal: [10.0.225.94]: FAILED! => {
    "changed": false,
    "dest": "/tmp/jdk-8u91-linux-x64.tar.gz",
    "failed": true,
    "invocation": {
        "module_args": {
            "backup": false,
            "checksum": "",
            "content": null,
            "delimiter": null,
            "dest": "/tmp/jdk-8u91-linux-x64.tar.gz",
            "directory_mode": null,
            "follow": false,
            "force": false,
            "force_basic_auth": false,
            "group": null,
            "headers": "Cookie:oraclelicense=accept-securebackup-cookie",
            "http_agent": "ansible-httpget",
            "mode": null,
            "owner": null,
            "regexp": null,
            "remote_src": null,
            "selevel": null,
            "serole": null,
            "setype": null,
            "seuser": null,
            "sha256sum": "",
            "src": null,
            "timeout": 10,
            "tmp_dest": "",
            "unsafe_writes": null,
            "url": "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz",
            "url_password": null,
            "url_username": null,
            "use_proxy": true,
            "validate_certs": true
        },
        "module_name": "get_url"
    },
    "msg": "Request failed",
    "response": "HTTP Error 404: Not Found",
    "state": "absent",
    "status_code": 404,
    "url": "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz"
}

for now I have added a workaround in my copy of role

- name: get JDK tarball (as tar.gz file)
  command: "<wget path of your s3>"
  args:
    chdir: "/tmp"
  when: ansible_pkg_mgr != "yum" and ansible_pkg_mgr != "zypper" and ansible_os_family != 'Darwin'

cc: @akshita27

@savishy
Copy link

savishy commented May 23, 2017

This is probably because the URL structure has changed:

When I download JDK using the UI, I see an additional hash.

http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz

@gbergere
Copy link

gbergere commented May 23, 2017

I think this PR would solve the issue : #60

How can we speed up the merge of it ? @William-Yeh

@javahas
Copy link
Author

javahas commented May 23, 2017

I manually changed one of the files, which fixed issue for me, until the fix will be in:
replace the context of
williamyeh.oracle-java/defaults/main.yml
with::

java_version: 8
java_subversion: 131
java_build_custom: 11
jdk_version_detail_custom: "{{ java_version }}u{{ java_subversion }}-b{{ java_build_custom }}"
jdk_tarball_hash: d54c1d3a095b4ff2b6607d096fa80163
jdk_tarball_url: "http://download.oracle.com/otn-pub/java/jdk/{{ jdk_version_detail_custom }}/{{ jdk_tarball_hash }}/{{ jdk_tarball_file }}"
java_download_path: /tmp
java_download_from_oracle: true
java_remove_download: true
java_install_jce: false
java_set_javahome: false

@savishy
Copy link

savishy commented May 24, 2017

While that does seem to be unique for JDK 8u131, older versions have different hashes:

http://download.oracle.com/otn/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz

savishy added a commit to savishy/ansible-roles that referenced this issue May 24, 2017
- moved to openjdk due to issue William-Yeh/ansible-oracle-java#62
- making port configurable
@afeld
Copy link

afeld commented May 24, 2017

Duplicate of #58, I believe.

@madhead
Copy link

madhead commented May 25, 2017

The issue is not with hashes (they are not used for older distributions (like 112, in this issue), but the URL is different (second is copied from Oracle's site):

http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz
http://download.oracle.com/otn/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz

I've changed that in /etc/ansible/roles/williamyeh.oracle-java/tasks/set-role-variables.yml, and now I get different error:

{"changed": false, "dest": "/tmp/jdk-8u112-linux-x64.rpm", "failed": true, "msg": "Request failed", "response": "HTTP Error 401: Authorization Required", "state": "absent", "status_code": 401, "url": "http://download.oracle.com/otn/java/jdk/8u112-b15/jdk-8u112-linux-x64.rpm"}

accept-securebackup-cookie is not working anymore? Damn, Oracle! Why do you hate us?

@niravradia
Copy link

Anyone found some work around for this? I change the URL to http://download.oracle.com/otn/java/jdk/8u91-b14/jdk-8u91-linux-i586.rpm but still, it fails with authentication error. If anyone know any other ansible role, then also please let me know. Thanks !

@avivys
Copy link

avivys commented Jul 24, 2017

same with mac users. currently not working...

@cunneen
Copy link

cunneen commented Oct 12, 2017

After playing around using wget, I think I have a (hacky, non-ansible) solution that could be made into a role.

First, from @ianhattendorf's comment on #58 , I did the equivalent for 8u144b01 on Mac OS using bash and wget. But I also needed to send a cookie with the current timestamp to Oracle to get around auth errors:

#!/usr/bin/env bash

jdk_platform=macosx-x64
jdk_file_extension=dmg
java_version=8
java_subversion=144
java_build_custom=01
jdk_version_detail_custom="${java_version}u${java_subversion}-b${java_build_custom}"
jdk_tarball_hash="090f390dda5b47b9b721c7dfaa008135"
jdk_tarball_file="jdk-${java_version}u${java_subversion}-${jdk_platform}.${jdk_file_extension}"
jdk_tarball_url="http://download.oracle.com/otn-pub/java/jdk/${jdk_version_detail_custom}/${jdk_tarball_hash}/${jdk_tarball_file}"

# substitute current date into the cookies file
now=`date`
epoch=`date -j -f "%a %b %d %T %Z %Y" "${now}" "+%s"`
inHalfAnHour=`expr ${epoch} \+ 1800`
tomorrow=`expr ${epoch} \+ 86400`
nextmonth=`expr ${epoch} \+ 2592000`
epochmillis="${epoch}000"


cat <<EOF > cookies.txt
www.oracle.com FALSE /technetwork/java/javase/downloads FALSE 0 testSessionCookie Enabled
.oracle.com TRUE / FALSE ${tomorrow} oraclelicense accept-securebackup-cookie
.oracle.com TRUE / FALSE ${inHalfAnHour} s_nr ${epochmillis}
EOF

# replace spaces with tabs
tempfile=`mktemp`
sed -e "s/ /    /g" cookies.txt > "${tempfile}" && mv -f "${tempfile}" cookies.txt

wget --load-cookies cookies.txt "${jdk_tarball_url}"

@cunneen
Copy link

cunneen commented Oct 12, 2017

You'll need to replace the replacement expression in that sed to be a tab character, as github has converted it to whitespace:

sed -e "s/ /TAB_CHAR_HERE/g"  ... 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants