Replies: 7 comments 2 replies
|
Hello @agunapal Here's what you can do to troubleshoot this: Wait for the Current Workflow to Finish: The error message indicates that the workflow is still running. You cannot rerun it until the current execution completes. You should wait for the ongoing workflow to finish before attempting to rerun it. Check Workflow Status: Go to the Actions tab of your GitHub repository and check the status of the workflow you're trying to rerun. Make sure it has either completed or failed before attempting to rerun it. Verify Workflow Run ID: Ensure that the github.run_id you're using in your workflow is correct. It should correspond to the specific run you want to rerun. Double-Check Trigger Conditions: Make sure that the conditions set for rerunning the workflow are met. In your case, you're using if: ${{ failure() }}, which means the workflow should rerun only if it fails. Ensure that the previous run did indeed result in a failure. Use the Correct API Endpoint: You're using the /rerun-failed-jobs endpoint, which is correct for rerunning failed jobs. If you want to rerun the entire workflow, you can use /rerun instead. Make sure you're using the appropriate endpoint for your use case. Review the Workflow Configuration: Check your workflow configuration file to ensure there are no issues with the way the rerun step is defined. Verify that you're not inadvertently triggering the rerun under conditions that you didn't intend. |
|
Hi @xxFREESHROUDxx Thanks for getting back. I am deliberately trying to rerun the same workflow when I see that it has failed. I guess technically the workflow is still running because the cleanup is not complete yet. I also attempted this with jobs. I am getting the same error with jobs as well Here is the workflow file https://github.com/pytorch/serve/actions/runs/6243287777/workflow and here is the run https://github.com/pytorch/serve/actions/runs/6243287777 I created a job called retry and passing the job id from the main job to this to rerun. However it still says I am not able to figure out how to re-run a failed job or workflow automatically. Could you please help? |
|
I recently stumbled upon the same problem and was able to "solve" it using the following workaround:
example:test.yml: on: push
jobs:
fail:
runs-on: ubuntu-latest
steps:
- run: false
re-run:
needs: fail
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yml -F run_id=${{ github.run_id }}rerun.yml: on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed |
|
Why I'm getting unknown flag on running |
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
|
They probably have not added it as you can either do it via the website for a single rerun or I made this a while back which essentially does what I needed with a few customisations. https://github.com/userdocs/gh-cli-workflow-reruns The principle is the same as most would have figured out when trying to do this. You cannot do it from the workflow you need to rerun, you have to call separate workflow, that manages the reruns of the failed workflow. So you pass it the info call it via For example, you cannot do this in a reusable workflow with My project essentially does that and is easy to implement in your repo. It has some options to play with and does stuff like activate debug mode on if it reruns more than once. It can run in a local or remote repo, accepts some inputs like retry attempts. You could add notifications and more but really, if you do this via cli using So I guess that's why, they consider gh cli to be the solution I think I got it from here https://gist.github.com/philip-gai/e3c02e68a32e8964fa3df2167b15cbff |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Select Topic Area
Question
Body
I am using the following in my workflow file to rerun the workflow if there is a failure
However I get the message
I get the same error for both
/rerunand/rerun-failed-jobsHow do I rerun this workflow?
This is an example run that I am trying
https://github.com/pytorch/serve/actions/runs/6242336118
All reactions