setup-jdk icon indicating copy to clipboard operation
setup-jdk copied to clipboard

Sporadic HTTP 403 responses, but only on Mac OS

Open dmlloyd opened this issue 3 years ago • 6 comments

For some reason, our actions often fail spuriously with the following output:

Run joschi/setup-jdk@v2
  with:
    java-version: [1](https://github.com/qbicc/qbicc/runs/6614106260?check_suite_focus=true#step:3:1)7
    architecture: x64
    release_type: ga
    java-package: jdk
    openjdk_impl: hotspot
    heap_size: normal
    release: latest
    server-id: github
    server-username: GITHUB_ACTOR
    server-password: GITHUB_TOKEN
  env:
    CC: gcc
    LLVM_PATH: /Users/runner/work/_temp/llvm-install
    LD_LIBRARY_PATH: /Users/runner/work/_temp/llvm-install/lib:
    DYLD_LIBRARY_PATH: /Users/runner/work/_temp/llvm-install/lib:
Error: Unexpected HTTP response: 40[3](https://github.com/qbicc/qbicc/runs/6614106260?check_suite_focus=true#step:3:3)

I would think that this is an infrastructure problem, however it only happens with this action, and only on Mac OS.

dmlloyd avatar May 27 '22 13:05 dmlloyd

@dmlloyd Thanks for reporting this!

Could you please try to re-run the failed workflow with debug logging enabled?

➡️ https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging

joschi avatar May 27 '22 18:05 joschi

Sure, we'll try that for next time. One tricky detail is that it is usually the case that the problem does not recur when we rerun the job, so it might be tricky to catch it.

I'll also look at enabling debug logging for all actions in the affected repositories.

dmlloyd avatar May 27 '22 18:05 dmlloyd

My theory is that the GitHub Actions runner might be causing too many requests to the AdoptOpenJDK API and it's blocking it temporarily which is causing the HTTP 403 response.

Unfortunately this is just a theory without any debug logs. 😞

This being said, I'm in the process to deprecate this GitHub Action because the official https://github.com/actions/setup-java supports AdoptOpenJDK and Eclipse Temurin nowadays: https://github.com/actions/setup-java/tree/v3.3.0#basic

Maybe you want to give it a try. 😄

joschi avatar May 27 '22 19:05 joschi

Yeah that probably makes sense; I started using this plugin because (IIRC) it had support for installing multiple JDKs before the official one did. But I guess it's best to stick with standards when possible...

dmlloyd avatar May 27 '22 19:05 dmlloyd

I started using this plugin because (IIRC) it had support for installing multiple JDKs before the official one did.

The functionality of this GitHub Action has been contributed back to the official one. 😄

joschi avatar May 27 '22 20:05 joschi

Haha, and of course I ran into the exact same issue while publishing the last release of this GitHub Action. 😅

joschi avatar May 27 '22 20:05 joschi