Workflow jobs endpoint returns 404 for an existing run after dispatch (regression) #213196
Replies: 5 comments 1 reply
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Hi, I'm not aware of any documentation saying this endpoint returns 404 for a run that exists, so I can't say whether it's intended. Here is how I'd handle it and report it. 1. Likely explanation (unconfirmed) The run record is created first, and its jobs are created a short time later by the scheduler. Reading the run succeeds, but the jobs listing may be served from a different backend or cache that doesn't know about the run yet. If that is what's happening, the 404 is a short-lived consistency gap. Earlier, it returned an empty list, so something changed on GitHub's side, which fits your "regression" suspicion. I can't confirm either. 2. Workaround: treat the 404 as "not ready yet" and retry Right after dispatch, retry with a short backoff for a bounded time, and only fail if it persists: import time, requests
def get_jobs(owner, repo, run_id, headers, timeout=120):
url = f"https://api.github.com/repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
deadline = time.time() + timeout
delay = 1
while True:
r = requests.get(url, headers=headers)
if r.status_code == 200:
return r.json()["jobs"]
if r.status_code != 404 or time.time() > deadline:
r.raise_for_status()
time.sleep(delay)
delay = min(delay * 2, 10)Two cautions:
3. Check that it isn't an access problem A 404 on GitHub can also mean "no permission". If the run belongs to another repository or the token lacks 4. Report it with evidence To help GitHub confirm a regression, capture for a failing case:
gh api -i repos/OWNER/REPO/actions/runs/RUN_ID/jobsPost these in this thread, and also in a support ticket (https://support.github.com/contact, Actions or API) so the request IDs can be traced. Please redact tokens in anything you share. |
|
I also found another project that is affected by this change: fullsend-ai/fullsend#9124 |
|
Small update: I just got a case where fetching the "run" itself would error out with 404 and not just the jobs endpoint. So it seems there are two error windows. https://github.com/msys2/msys2-autobuild/actions/runs/43765083155/job/132968260007#step:6:590 |
|
I've now had a case where I successfully fetched a workflow run via the API, and some milliseconds later I fetched again and got 404. This suggests that depending on the server you hit you get different responses. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
API
Body
Over the past 1–2 weeks, we’ve started seeing intermittent 404 responses from:
GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs
This happens shortly after dispatching a workflow. The dispatch returns a run ID, and fetching that same run succeeds, but listing its jobs returns:
From what I see previously it would just return an empty result, now it fails with 404 sometimes.
Is this expected while a run is queued and jobs haven’t been created yet, or could it be a recent regression? The endpoint documentation doesn’t mention this behavior.
example error: https://github.com/msys2/msys2-autobuild/actions/runs/43695931957/job/132756340945#step:6:136
All reactions