GitHub Actions step logs endpoint returns 404 while job-level logs download successfully #211923
Replies: 3 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. ⭐ |
|
I can reproduce this on a public repo too. For a completed job in Until it works, the run logs ZIP has the same thing. After the run finishes, on:
workflow_run:
workflows: ["Terraform"] # the name of the workflow that fails
types: [completed]
jobs:
step-log:
if: github.event.workflow_run.conclusion == 'failure'
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- env:
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.workflow_run.id }}
run: |
gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/logs" > logs.zip
unzip -p logs.zip "Terraform Format and Validate/4_*.txt"If it has to happen inside the same run, like your step 6, the job log is the only source for now. Each |
|
Works now. I retested the mdn/browser-compat-data job from comment above (run 41591314160, job 125768456918, step 1) today, it gives 302 to the log. Also works for finished steps of running jobs. More here: https://github.com/orgs/community/discussions/75518#discussioncomment-19562148 |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
API
Body
6_Retrieve Failed Step Logs.txt
Summary
I'm experiencing an issue with the GitHub Actions REST API endpoint for downloading individual workflow step logs.
The following endpoint consistently returns
404 Not Foundfor a completed workflow job:However, the job metadata endpoint and the job-level logs endpoint work successfully using the same repository, authentication token, job ID, and API version.
Environment
JoyForCode/aws-terraform-configs2026-03-10GITHUB_TOKEN/ fine-grained PATActions: readReproduction steps
This returns
200 OK, including the job's step metadata.stepsarray. For example:{ "name": "Check Terraform Formatting", "conclusion": "failure", "number": 4 }Actual result:
404 Not Found, with the response body:{ "message": "Not Found", "status": "404" }Actual result:
200 OKafter the redirect is followed. The complete job log is successfully downloaded.Actual result:
200 OK. The response is a ZIP archive containing workflow logs.Expected behaviour
According to the REST API documentation, the individual step-logs endpoint should return
302 Foundwith a redirect URL to download the plain-text logs for that specific step.I would expect the endpoint to return the redirect URL for a valid job ID and step number when the job has completed and its logs are available.
Actual behaviour
200 OK200 OK200 OK404 Not FoundThe same authentication credentials and API version are used for these requests.
I have also verified that the requested step number matches the
numberfield returned by the job metadata endpoint.Questions
References
I can provide additional request IDs, timestamps, and sanitized API responses if needed.
Thank you!
All reactions