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

Multiple failures uploading to github recently #86

Closed
sxa opened this issue Mar 31, 2022 · 8 comments
Closed

Multiple failures uploading to github recently #86

sxa opened this issue Mar 31, 2022 · 8 comments
Labels

Comments

@sxa
Copy link
Member

sxa commented Mar 31, 2022

Seems to always be failing when it hits the mac x64 package on all versions. Rate limit? Something specific to that artifact? (Looks ok, not zero-bytes)
Excluding **/*_x64_mac_* seems to progress ok (Based on one run)

Exception in thread "main" org.kohsuke.github.HttpException: Server returned HTTP response code: -1, message: 'null' for URL: https://uploads.github.com/repos/adoptium/temurin19-binaries/releases/63237181/assets?name=OpenJDK-jdk_x64_mac_hotspot_2022-03-31-03-30.pkg
	at org.kohsuke.github.GitHubClient.interpretApiError(GitHubClient.java:494)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:414)
	at org.kohsuke.github.GitHubClient.sendRequest(GitHubClient.java:358)
	at org.kohsuke.github.Requester.fetch(Requester.java:76)
	at org.kohsuke.github.GHRelease.uploadAsset(GHRelease.java:249)
	at org.kohsuke.github.GHRelease.uploadAsset(GHRelease.java:224)
	at net.adoptium.release.UploadAdoptReleaseFiles$_uploadFiles_closure2.doCall(UploadFiles.groovy:89)
	at net.adoptium.release.UploadAdoptReleaseFiles$_uploadFiles_closure2.call(UploadFiles.groovy)
@sxa
Copy link
Member Author

sxa commented Mar 31, 2022

It definately happens if you're only uploading the pkg files - if you filter on those it still fails.

@sophia-guo
Copy link
Contributor

Issue happened on Mar 30th. Before that worked well. https://github.com/adoptium/temurin11-binaries/releases/tag/jdk11u-2022-03-29-19-34-beta

@sxa
Copy link
Member Author

sxa commented Mar 31, 2022

Note to whoever picks this up: It is not a problem if you upload a file manually to the release via the github web interface, so this is something related to the automated upload process.

@sophia-guo
Copy link
Contributor

sophia-guo commented Mar 31, 2022

#86 (comment)

Does that mean it's jenkins server related?
Source code didn't change, job configuration didn't change. The only thing changed around the failure time is jenkins server has been updated. Job is running on jenkins master.

@karianna karianna added the bug label Apr 1, 2022
@sxa
Copy link
Member Author

sxa commented Apr 7, 2022

It's only happening with files that have a .pkg extension. If I rename a .pkg to have a .tar.gz extension it works ok, and if I take a .tar.gz and rename it to end in .pkg it fails

@sxa
Copy link
Member Author

sxa commented Apr 7, 2022

If I give a smaller (sha256.txt) file a .pkg extension it also fails, but with an HTTP/422 which kinda points to an issue with the API call:

Uploading OpenJDK18U-jdk_x64_mac_hotspot_2022-04-07-06-28.tar.gz.sha256.txt.pkg

Exception in thread "main" org.kohsuke.github.HttpException: {"message":"Validation Failed","request_id":"E072:2BF5:A6F2D4:B338F2:624EB72D","documentation_url":"https://docs.github.com/rest","errors":[{"resource":"ReleaseAsset","code":"custom","field":"content_type","message":"content_type can't be application/x-www-form-urlencoded"}]}
Caused by: java.io.IOException: Server returned HTTP response code: 422 for URL: https://uploads.github.com/repos/adoptium/temurin18-binaries/releases/63826236/assets?name=OpenJDK18U-jdk_x64_mac_hotspot_2022-04-07-06-28.tar.gz.sha256.txt.pkg

So I think we need to get some debug output from the github calls that are made to be able to progress this

@sxa
Copy link
Member Author

sxa commented Apr 7, 2022

OK So java11 is return null for the the probeContentType() method on files with a pkg extension. it should be returning a valid mime-type. java 8 works as expected and returns applicaiton/x-xar. It is unclear why this has only started happening, and it appears unrelated to the difference in OS level (Unless some fix was applied to the old one).

To replicate the problem, run this code with args[0] as one of our .pkg files: System.out.println(java.nio.file.Files.probeContentType((new java.io.File(args[0])).toPath())); (Note, it returns application/vnd.apple.installer+xml on a RHEL7 system I have access to, but everywhere else it gives null with JDK11+)

The release process is running with the JVM in /home/jenkins/.jenkins/tools/hudson.model.JDK/jdk-11.0.13_8. If I force JAVA_HOME to be a JDK8 the job works correctly. For now, I'm going to override that in script section of the the release tool jenkins job when it invokes sbin/Release.sh

Potentially related to adoptium/infrastructure#2477 which I think whatever caused that will be what put that JDK in place.

@sxa sxa closed this as completed Apr 7, 2022
@sxa
Copy link
Member Author

sxa commented Apr 7, 2022

It looks like JDK11 is looking exclusively at /etc/mime.types (preceded by a check in $HOME/.mime.types if present) whereas java 8 is looking in multiple locations but primarily /usr/share/mime/mime.cache. CentOS/RHEL provide an entry for pkg files in /etc/mime.types which comes from the mailcap package. On Ubuntu the file comes from the mime-support package.

The failure can therefore also be worked around by adding this line to /etc/mime.types but since that's somewhat more cyptic I don't really want to rely on this:

application/vnd.apple.installer+xml             pkg

Another option would be to add that single line to $HOME/.mime.types but i feel the forcing to JDK8 may be the less obtuse solution at the moment so i'll stick with that.

NOTE: The change that made java explicitly look at /etc/mime.types was openjdk/jdk11u@00ad290

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

No branches or pull requests

3 participants