GitHub Actions Job cancelled

The job was manually cancelled or automatically due to a failure in a previous step.

Understanding GitHub Actions

GitHub Actions is a powerful CI/CD tool integrated into GitHub, allowing developers to automate their workflows directly from their repositories. It enables the automation of tasks such as testing, building, and deploying code, enhancing productivity and efficiency in software development.

Identifying the Symptom: Job Cancelled

One common issue developers encounter when using GitHub Actions is the 'Job cancelled' message. This symptom indicates that a job within a workflow was halted before completion. This can be observed in the GitHub Actions logs, where the job status will be marked as 'Cancelled'.

Exploring the Issue: Why Was the Job Cancelled?

The 'Job cancelled' message typically arises when a job is manually stopped by a user or automatically terminated due to a failure in a preceding step. This can happen if a previous job in the workflow fails and the workflow is configured to cancel subsequent jobs upon failure.

Manual Cancellation

Users can manually cancel a job by navigating to the Actions tab in their GitHub repository, selecting the running workflow, and clicking the 'Cancel workflow' button. This is often done when a mistake is identified, or an update is needed before proceeding.

Automatic Cancellation

Automatic cancellation occurs when a job is set to depend on the success of previous jobs. If a prior job fails, subsequent jobs may be automatically cancelled to prevent unnecessary resource usage.

Steps to Resolve the 'Job Cancelled' Issue

To address a 'Job cancelled' issue, follow these steps:

Step 1: Review Workflow Logs

Begin by reviewing the logs of the cancelled job and any preceding jobs. Navigate to the Actions tab in your repository, select the workflow run, and examine the logs for any errors or failures.

Step 2: Identify the Cause

If the job was manually cancelled, determine if it was intentional or accidental. If it was automatic, identify the failed step that led to the cancellation. Look for error messages or failed commands in the logs.

Step 3: Fix Errors in Preceding Steps

If a preceding step failed, address the root cause of the failure. This may involve fixing syntax errors, updating dependencies, or adjusting configuration files. For example, if a test script failed, ensure all dependencies are correctly installed and the script is error-free.

Step 4: Rerun the Workflow

Once the issue is resolved, rerun the workflow to verify that the problem is fixed. You can do this by clicking the 'Re-run jobs' button in the Actions tab.

Additional Resources

For more information on troubleshooting GitHub Actions, refer to the official GitHub Actions documentation. Additionally, the GitHub Community Forum is a valuable resource for seeking help from other developers.

Never debug

GitHub Actions

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Book Demo
Automate Debugging for
GitHub Actions
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid