joschi / setup-jdk

(DEPRECATED) Set up your GitHub Actions workflow with a specific version of AdoptOpenJDK
https://github.com/marketplace/actions/setup-adoptopenjdk
MIT License
30 stars 1 forks source link

Sporadic HTTP 403 responses, but only on Mac OS #28

Open dmlloyd opened 2 years ago

dmlloyd commented 2 years ago

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.

joschi commented 2 years ago

@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

dmlloyd commented 2 years ago

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.

joschi commented 2 years ago

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. 😄

dmlloyd commented 2 years ago

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...

joschi commented 2 years ago

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 commented 2 years ago

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