Skip to content

Setup action fails without clearr error #793

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

Open
2 of 5 tasks
daan-flore opened this issue Apr 11, 2025 · 12 comments
Open
2 of 5 tasks

Setup action fails without clearr error #793

daan-flore opened this issue Apr 11, 2025 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@daan-flore
Copy link

daan-flore commented Apr 11, 2025

Description:
We are running self hosted runners of github and somethimes the setup-java actions fails without any clear error or warning. Even when running the scripts in debug mode we are just seeing that the sripts stops with exit code 1 and trying to list the versions. To be able to further investigate it we would need to see on with the actions fails.
Is it a connection timout, rejection, non valid http code returned, ...

2025-04-11T12:05:11.9410487Z Download action repository 'actions/setup-java@v4' (SHA:c5195efecf7bdfc987ee8bae7a71cb8b11521c00)
2025-04-11T12:05:12.6967746Z ##[debug]Download 'https://api.github.com/repos/actions/setup-java/tarball/c5195efecf7bdfc987ee8bae7a71cb8b11521c00' to '/runner/_work/_actions/_temp_585fd9f9-c3c9-4d04-b439-256fd8714e89/3e672265-6749-4484-8cfa-85e3449c9de0.tar.gz'
2025-04-11T12:05:12.7951388Z ##[debug]Unwrap 'actions-setup-java-c5195ef' to '/runner/_work/_actions/actions/setup-java/v4'
2025-04-11T12:05:12.8426656Z ##[debug]Archive '/runner/_work/_actions/_temp_585fd9f9-c3c9-4d04-b439-256fd8714e89/3e672265-6749-4484-8cfa-85e3449c9de0.tar.gz' has been unzipped into '/runner/_work/_actions/actions/setup-java/v4'.
2025-04-11T12:05:12.8571771Z ##[debug]action.yml for action: '/runner/_work/_actions/actions/setup-java/v4/action.yml'.
2025-04-11T12:05:12.9310731Z ##[debug]Set step '__actions_setup-java' display name to: 'Setup Java JDK'
2025-04-11T12:05:12.9313643Z Complete job name: setup-jdk
2025-04-11T12:05:12.9351234Z ##[debug]Collect running processes for tracking orphan processes.
2025-04-11T12:05:12.9469090Z ##[debug]Finishing: Set up job
2025-04-11T12:05:12.9600174Z ##[debug]Evaluating condition for step: 'Set up runner'
2025-04-11T12:05:12.9641019Z ##[debug]Evaluating: always()
2025-04-11T12:05:12.9647599Z ##[debug]Evaluating always:
2025-04-11T12:05:12.9658614Z ##[debug]=> true
2025-04-11T12:05:12.9668059Z ##[debug]Result: true
2025-04-11T12:05:12.9696427Z ##[debug]Starting: Set up runner
2025-04-11T12:05:12.9718096Z A job started hook has been configured by the self-hosted runner administrator
2025-04-11T12:05:12.9861375Z ##[group]Run '/etc/arc/hooks/job-started.sh'
2025-04-11T12:05:12.9874966Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2025-04-11T12:05:12.9876591Z ##[endgroup]
2025-04-11T12:05:12.9967036Z ##[debug]/usr/bin/bash -e /etc/arc/hooks/job-started.sh
2025-04-11T12:05:13.0137453Z �[0;37m2025-04-11 12:05:13.003  DEBUG --- Running ARC Job Started Hooks�[0m
2025-04-11T12:05:13.0139944Z �[0;37m2025-04-11 12:05:13.004  DEBUG --- Running hook: /etc/arc/hooks/job-started.d/update-status�[0m
2025-04-11T12:05:13.0196053Z ##[debug]Finishing: Set up runner
2025-04-11T12:05:13.0219466Z ##[debug]Evaluating condition for step: 'Setup Java JDK'
2025-04-11T12:05:13.0226172Z ##[debug]Evaluating: success()
2025-04-11T12:05:13.0227700Z ##[debug]Evaluating success:
2025-04-11T12:05:13.0237149Z ##[debug]=> true
2025-04-11T12:05:13.0238564Z ##[debug]Result: true
2025-04-11T12:05:13.0240395Z ##[debug]Starting: Setup Java JDK
2025-04-11T12:05:13.0319126Z ##[debug]Register post job cleanup for action: actions/setup-java@v4
2025-04-11T12:05:13.0343190Z ##[debug]Loading inputs
2025-04-11T12:05:13.0386491Z ##[debug]Evaluating: job.status
2025-04-11T12:05:13.0388033Z ##[debug]Evaluating Index:
2025-04-11T12:05:13.0390784Z ##[debug]..Evaluating job:
2025-04-11T12:05:13.0392489Z ##[debug]..=> Object
2025-04-11T12:05:13.0399609Z ##[debug]..Evaluating String:
2025-04-11T12:05:13.0401021Z ##[debug]..=> 'status'
2025-04-11T12:05:13.0406495Z ##[debug]=> 'success'
2025-04-11T12:05:13.0408272Z ##[debug]Result: 'success'
2025-04-11T12:05:13.0417615Z ##[debug]Evaluating: (((github.server_url == 'https://github.com') && github.token) || '')
2025-04-11T12:05:13.0419017Z ##[debug]Evaluating Or:
2025-04-11T12:05:13.0421863Z ##[debug]..Evaluating And:
2025-04-11T12:05:13.0424851Z ##[debug]....Evaluating Equal:
2025-04-11T12:05:13.0426741Z ##[debug]......Evaluating Index:
2025-04-11T12:05:13.0427608Z ##[debug]........Evaluating github:
2025-04-11T12:05:13.0428578Z ##[debug]........=> Object
2025-04-11T12:05:13.0429414Z ##[debug]........Evaluating String:
2025-04-11T12:05:13.0430286Z ##[debug]........=> 'server_url'
2025-04-11T12:05:13.0431798Z ##[debug]......=> 'https://github.com'
2025-04-11T12:05:13.0432720Z ##[debug]......Evaluating String:
2025-04-11T12:05:13.0433581Z ##[debug]......=> 'https://github.com'
2025-04-11T12:05:13.0437961Z ##[debug]....=> true
2025-04-11T12:05:13.0439007Z ##[debug]....Evaluating Index:
2025-04-11T12:05:13.0439852Z ##[debug]......Evaluating github:
2025-04-11T12:05:13.0440732Z ##[debug]......=> Object
2025-04-11T12:05:13.0441634Z ##[debug]......Evaluating String:
2025-04-11T12:05:13.0442471Z ##[debug]......=> 'token'
2025-04-11T12:05:13.0444128Z ##[debug]....=> '***'
2025-04-11T12:05:13.0445093Z ##[debug]..=> '***'
2025-04-11T12:05:13.0446365Z ##[debug]=> '***'
2025-04-11T12:05:13.0452010Z ##[debug]Expanded: ((('https://github.com' == 'https://github.com') && '***') || '')
2025-04-11T12:05:13.0453372Z ##[debug]Result: '***'
2025-04-11T12:05:13.0458572Z ##[debug]Loading env
2025-04-11T12:05:13.0484532Z ##[group]Run actions/setup-java@v4
2025-04-11T12:05:13.0485523Z with:
2025-04-11T12:05:13.0486224Z   distribution: adopt
2025-04-11T12:05:13.0486968Z   java-version: 21
2025-04-11T12:05:13.0487715Z   java-package: jdk
2025-04-11T12:05:13.0488452Z   check-latest: false
2025-04-11T12:05:13.0489200Z   server-id: github
2025-04-11T12:05:13.0490098Z   server-username: GITHUB_ACTOR
2025-04-11T12:05:13.0490937Z   server-password: GITHUB_TOKEN
2025-04-11T12:05:13.0491751Z   overwrite-settings: true
2025-04-11T12:05:13.0492556Z   job-status: success
2025-04-11T12:05:13.0493690Z   token: ***
2025-04-11T12:05:13.0494496Z ##[endgroup]
2025-04-11T12:05:13.2930482Z ::group::Installed distributions
2025-04-11T12:05:13.2932273Z ##[group]Installed distributions
2025-04-11T12:05:13.2938363Z Trying to resolve the latest version from remote
2025-04-11T12:05:13.2946614Z ##[debug]Gathering available versions from 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&os=linux&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
2025-04-11T12:05:15.4642078Z ##[debug]Node Action run completed with exit code 1

Task version:
actions/setup-java@v4 => SHA:c5195efecf7bdfc987ee8bae7a71cb8b11521c00

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
We just have a setup-java action running on a schedule and every x time it just fails

Expected behavior:
An error that can help with investigating the problem.

Actual behavior:
We just see action run completed with exit code 1

@daan-flore daan-flore added bug Something isn't working needs triage labels Apr 11, 2025
@priya-kinthali
Copy link

Hello @daan-flore👋,
Thank you for reporting this issue. We will investigate it and get back to you as soon as we have some feedback.

@gowridurgad gowridurgad self-assigned this Apr 14, 2025
@gowridurgad
Copy link

Hi @daan-flore, We've reviewed your logs and tested the setup-java@v4 action on our self-hosted runners. So far, we’re unable to reproduce the issue the action completes successfully without any errors. Attached is a screenshot for your reference.
It looks like the issue is related to a timeout or network connectivity problem while trying to fetch Java versions. This can happen if the runner temporarily loses internet access or cannot reach the AdoptOpenJDK API. Please try re-running the workflow, as these types of issues are often temporary and resolve on rerun.
If the problem persists, please share a link to a public repository or workflow run where the issue can be reproduced. This will help us investigate more thoroughly.
Let us know how it goes!

Image

@daan-flore
Copy link
Author

Hi @gowridurgad,

Most runs are not a problem it just happens sometimes. So my question is are we able to get more info about why it fails there is no error written in the logs by the action so it makes it difficult for me to see if it is connection problem, ssl error, ...

As the runners are linked to github enterprise I can't share a public repo to reproduce the issue.

Kind regards,
Daan

@gowridurgad
Copy link

Hi @daan-flore, We understand that intermittent failures without clear error messages can be difficult to troubleshoot. To address this, enhanced error handling has been implemented in the action to provide more explicit and helpful error 
Messages when failures occur. Since the issue could not be reproduced on our end, we kindly request you to test the changes using the branch and let us know if it helps identify the root cause of the problem.
To use the branch, you can update your workflow file as follows:

- name: Setup JDK
  uses: actions/setup-java@error-handling
  with:
    distribution: 'adopt'
    java-version: '21'

 Kindly test it at your earliest convenience and provide your feedback. Your input will help us improve and 
refine this further!

@daanflore
Copy link

Hi @gowridurgad,

I have updated my test branch.
So the moment I see that it fails again I will add my findings to the issue.

Kind regards,
Daan

@gowridurgad
Copy link

Hi @daan-flore, Just a quick reminder—when you get a chance, could you please share the findings you mentioned? It would help us move forward with resolving the issue.

@daanflore
Copy link

Hi @gowridurgad,

Just checked the log of some recent builds and it failed again with the following log:

##[debug]Evaluating condition for step: 'Setup Java JDK'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Setup Java JDK
##[debug]Register post job cleanup for action: actions/setup-java@error-handling
##[debug]Loading inputs
##[debug]Evaluating: job.status
##[debug]Evaluating Index:
##[debug]..Evaluating job:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'status'
##[debug]=> 'success'
##[debug]Result: 'success'
##[debug]Evaluating: (((github.server_url == 'https://github.com/') && github.token) || '')
##[debug]Evaluating Or:
##[debug]..Evaluating And:
##[debug]....Evaluating Equal:
##[debug]......Evaluating Index:
##[debug]........Evaluating github:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'server_url'
##[debug]......=> 'https://github.com/'
##[debug]......Evaluating String:
##[debug]......=> 'https://github.com/'
##[debug]....=> true
##[debug]....Evaluating Index:
##[debug]......Evaluating github:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'token'
##[debug]....=> '***'
##[debug]..=> '***'
##[debug]=> '***'
##[debug]Expanded: ((('https://github.com/' == 'https://github.com/') && '***') || '')
##[debug]Result: '***'
##[debug]Loading env
Run actions/setup-java@error-handling
::group::Installed distributions
Installed distributions
  Trying to resolve the latest version from remote
  ##[debug]Gathering available versions from 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&os=linux&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
  Error: Failed to set up Java due to a network issue or timeout: 
  ##[debug]AggregateError [ETIMEDOUT]: 
  ##[debug]    at internalConnectMultiple (node:net:1122:18)
  ##[debug]    at internalConnectMultiple (node:net:1190:5)
  ##[debug]    at Timeout.internalConnectMultipleTimeout (node:net:1716:5)
  ##[debug]    at listOnTimeout (node:internal/timers:583:11)
  ##[debug]    at process.processTimers (node:internal/timers:519:7)
  ##[debug]Node Action run completed with exit code 1
  ##[debug]Finishing: Setup Java JDK

Kind regards,
Daan

@daanflore
Copy link

daanflore commented May 7, 2025

Hi @gowridurgad,

Checked a different run we had today and it gave the same error:

Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating condition for step: 'Setup Java JDK'
Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating: success()
Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating success:
Wed, 07 May 2025 08:37:12 GMT ##[debug]=> true
Wed, 07 May 2025 08:37:12 GMT ##[debug]Result: true
Wed, 07 May 2025 08:37:12 GMT ##[debug]Starting: Setup Java JDK
Wed, 07 May 2025 08:37:12 GMT ##[debug]Register post job cleanup for action: actions/setup-java@error-handling
Wed, 07 May 2025 08:37:12 GMT ##[debug]Loading inputs
Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating: job.status
Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating Index:
Wed, 07 May 2025 08:37:12 GMT ##[debug]..Evaluating job:
Wed, 07 May 2025 08:37:12 GMT ##[debug]..=> Object
Wed, 07 May 2025 08:37:12 GMT ##[debug]..Evaluating String:
Wed, 07 May 2025 08:37:12 GMT ##[debug]..=> 'status'
Wed, 07 May 2025 08:37:12 GMT ##[debug]=> 'success'
Wed, 07 May 2025 08:37:12 GMT ##[debug]Result: 'success'
Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating: (((github.server_url == 'https://github.com/') && github.token) || '')
Wed, 07 May 2025 08:37:12 GMT ##[debug]Evaluating Or:
Wed, 07 May 2025 08:37:12 GMT ##[debug]..Evaluating And:
Wed, 07 May 2025 08:37:12 GMT ##[debug]....Evaluating Equal:
Wed, 07 May 2025 08:37:12 GMT ##[debug]......Evaluating Index:
Wed, 07 May 2025 08:37:12 GMT ##[debug]........Evaluating github:
Wed, 07 May 2025 08:37:12 GMT ##[debug]........=> Object
Wed, 07 May 2025 08:37:12 GMT ##[debug]........Evaluating String:
Wed, 07 May 2025 08:37:12 GMT ##[debug]........=> 'server_url'
Wed, 07 May 2025 08:37:12 GMT ##[debug]......=> 'https://github.com/'
Wed, 07 May 2025 08:37:12 GMT ##[debug]......Evaluating String:
Wed, 07 May 2025 08:37:12 GMT ##[debug]......=> 'https://github.com/'
Wed, 07 May 2025 08:37:12 GMT ##[debug]....=> true
Wed, 07 May 2025 08:37:12 GMT ##[debug]....Evaluating Index:
Wed, 07 May 2025 08:37:12 GMT ##[debug]......Evaluating github:
Wed, 07 May 2025 08:37:12 GMT ##[debug]......=> Object
Wed, 07 May 2025 08:37:12 GMT ##[debug]......Evaluating String:
Wed, 07 May 2025 08:37:12 GMT ##[debug]......=> 'token'
Wed, 07 May 2025 08:37:12 GMT ##[debug]....=> '***'
Wed, 07 May 2025 08:37:12 GMT ##[debug]..=> '***'
Wed, 07 May 2025 08:37:12 GMT ##[debug]=> '***'
Wed, 07 May 2025 08:37:12 GMT ##[debug]Expanded: ((('https://github.com/' == 'https://github.com/') && '***') || '')
Wed, 07 May 2025 08:37:12 GMT ##[debug]Result: '***'
Wed, 07 May 2025 08:37:12 GMT ##[debug]Loading env
Wed, 07 May 2025 08:37:12 GMT
Run actions/setup-java@error-handling
Wed, 07 May 2025 08:37:12 GMT ::group::Installed distributions
Wed, 07 May 2025 08:37:12 GMT
Installed distributions
Wed, 07 May 2025 08:37:12 GMT   Trying to resolve the latest version from remote
Wed, 07 May 2025 08:37:12 GMT   ##[debug]Gathering available versions from 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&os=linux&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
Wed, 07 May 2025 08:37:12 GMT   Error: Failed to set up Java due to a network issue or timeout: 
Wed, 07 May 2025 08:37:12 GMT   ##[debug]AggregateError [ETIMEDOUT]: 
Wed, 07 May 2025 08:37:12 GMT   ##[debug]    at internalConnectMultiple (node:net:1122:18)
Wed, 07 May 2025 08:37:12 GMT   ##[debug]    at internalConnectMultiple (node:net:1190:5)
Wed, 07 May 2025 08:37:12 GMT   ##[debug]    at Timeout.internalConnectMultipleTimeout (node:net:1716:5)
Wed, 07 May 2025 08:37:12 GMT   ##[debug]    at listOnTimeout (node:internal/timers:583:11)
Wed, 07 May 2025 08:37:12 GMT   ##[debug]    at process.processTimers (node:internal/timers:519:7)
Wed, 07 May 2025 08:37:12 GMT   ##[debug]Node Action run completed with exit code 1
Wed, 07 May 2025 08:37:12 GMT   ##[debug]Finishing: Setup Java JDK

Kind regards,
Daan

@gowridurgad
Copy link

Hi @daanflore, Thank you for testing the error-handling branch and sharing the updated logs.
As you previously highlighted the difficulty in troubleshooting due to unclear error messages. Based on that feedback, we implemented enhanced error handling, which now provides clearer logs such as the ETIMEDOUT error shown in this case, indicating a network issue or timeout when fetching Java versions from the AdoptOpenJDK API.
Since the logs are now showing specific failure reasons, If this resolves your concern, we’re ready to raise a PR and merge the improvements.
Let us know if this provides the clarity you were hoping for, or If you need any further modifications or additional details in the logs.

@gowridurgad
Copy link

Hi @daanflore, just following up to check if the enhanced error-handling updates resolve your concerns. Please let us know if we can proceed with the PR.

@daanflore
Copy link

Hi @gowridurgad,

With the new error handling I can take this up with our internal team.

Thanks for your effort.

Kind regards,
Daan

@gowridurgad
Copy link

Hi @daanflore, Thank you for your update and for taking this forward with your internal team.
We’ll wait for your feedback before proceeding with a pull request. Please let us know once you have any updates or suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants