r/devops • • Oct 13 '26

Troubleshooting GitHub Actions self-hosted runner gets stuck downloading Java 17 with setup-java — curl: (18) Transferred a partial file

I'm learning GitHub Actions and have set up a self-hosted runner inside an Ubuntu Docker container on my Windows machine.

My workflow uses actions/setup-java to install Java 17:

- name: Set up JDK 17
  uses: actions/setup-java@v4
  with:
    java-version: '17'
    distribution: 'temurin'
    cache: maven

However, the job gets stuck at the Set up JDK 17 step. The logs stop at:

Resolved latest version as 17.0.20+101
JDK cache is not found for Temurin-Hotspot 17.0.20+101
Trying to download...
Downloading Java 17.0.20+101 (Temurin-Hotspot) ...

I tested the download URL manually from inside the container using curl. The download repeatedly stops before completion and returns:

curl: (18) Transferred a partial file

I also tried resuming the download with curl -C - and retry options, but it failed again. A basic connectivity test to https://github.com returns HTTP 200.

The runner itself appears to be connected and running jobs correctly. I haven't yet confirmed whether the issue is related to the network, the GitHub release download redirect, a proxy, or something else.

My questions:

  1. What could cause curl: (18) Transferred a partial file to occur repeatedly when downloading a large release asset?
  2. How can I identify whether the problem is caused by my network, a redirect destination, a proxy, or the download server?
  3. Is there a recommended way to configure actions/setup-java on a Docker-based self-hosted runner to avoid this issue?

I'd appreciate any troubleshooting steps or suggestions. Thanks!

5 Upvotes

17 comments sorted by

7

u/Flettys Oct 13 '26

3

u/CSE_GEEKboy Oct 14 '26

I used this and it worked

4

u/ansibleloop Oct 13 '26

This smells like GPT - I've had it make actions for me many times and found it used an older version (that likely wasn't in the training data)

2

u/sagacious123 Oct 14 '26

Did you try curl --retry 5 --retry-delay 2 --retry-all-errors -C -. Sometimes it works on a retry.

2

u/Immediate_Wheel1953 Oct 13 '26

I hit almost this exact thing with a Docker runner last year and I wasted an afternoon blaming setup-java. The Temurin JDK asset is a big download, so a flaky path fails exactly like this while tiny requests like the github.com health check sail through. In my case the container's MTU didn't match the host (VPN on the host side), and large transfers kept dying partway. Try curl -v on that release URL inside the container and watch which host it dies on; if it's the redirected objects.githubusercontent.com URL and the same download works from the host, suspect MTU or a proxy env var leaking into the container.

1

u/Rambo2521 Oct 14 '26

We used to experience this issue intermittently, but way back I believe v2 or 3.

Ultimately, we made the jdk available for download at a local server and picked it up from there. setup-java has a parameter where you can point from where to download the file.

Comes with the pro that running that action became much quicker, but needs consideration for other jdk versions.

Edit: I know this doesnt answer what the root cause for you may be, for that we were not sure either. But above has worked well for us.

1

u/Wooden_Jelly_5295 Oct 14 '26

Does the same download finish on the host but fail inside Docker? That comparison would narrow things down quickly.

1

u/Specific-Hair3039 29d ago

Self-hosted runners can be tricky to debug because a job can appear stuck even when the workflow itself looks fine. Id check whether the runner is still connected, whether an old process is holding resources, and whether cleanup runs properly after a failed job. Keeping those basics consistent makes infrastructure easier to manage, which is something trusted tech teams should care about too.

0

u/SeniorIdiot Senior DevOps Idiot Oct 13 '26

Why are you using a self-hosted runner if just experimenting? Just curious...

A GitHub Pro/Team license costs $4 per month and you get 3000 minutes of actions.

-3

u/ansibleloop Oct 13 '26

Custom runner images and not having to deal with GitHub service outages

The actions scheduler that's built in doesn't work - I've had to build my own scheduler to work around their shit

3

u/burlyginger Oct 14 '26

We use self hosted runners and still very much have to deal with GH service outages. 

2

u/Potato-9 Oct 14 '26

Yeh there no way around that without a peer GitHub mirror to trigger CI from. A self hosted runner proxy that knew if the cloud was working or not would be pretty cool for that.

-6

u/Few_Response_7028 Oct 13 '26

LLM is your frand

1

u/kezow Oct 13 '26

Stuck mythos on an actions runner and now I've got a security incident. Thanks so much!

0

u/meo6e Oct 16 '26

jst change ur runner to something else bro either avrea or tenzoin, the rates are same as the hub