Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions has encountered an internal error when running your job. #3495

Open
omerap12 opened this issue Oct 9, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@omerap12
Copy link

omerap12 commented Oct 9, 2024

Describe the bug
While running a github actions workflow we got the following error: GitHub Actions has encountered an internal error when running your job. . After searching online, I found a relevant discussion: actions/runner-images#2579 (comment)

It turned out that the issue was caused by this line of code:
if: (inputs.pushToAllEnvs && inputs.pushImage && ((contains(fromJSON('[\"master\", \"main\"]'), needs.devops-setmatrix.outputs.branchName) || startsWith(needs.devops-setmatrix.outputs.branchName, 'hotfix')))) || (github.event.repository.name == 'workflow-docker-build')

We resolved the issue by updating the condition to:
if: (inputs.pushToAllEnvs && inputs.pushImage && (needs.devops-setmatrix.outputs.branchName == 'main' || needs.devops-setmatrix.outputs.branchName == 'master' || startsWith(needs.devops-setmatrix.outputs.branchName, 'hotfix'))) || (github.event.repository.name == 'workflow-docker-build')
To Reproduce
Steps to reproduce the behavior:
Have a multi jobs pipeline with a similiar if.

Expected behavior
First, I don't fully understand why the initial approach is failing. I'd like to understand what's wrong with the original condition and why it's not working as expected.

Secondly, if there is a syntax problem, I would expect a more helpful error message. The generic internal error message was misleading, as I initially thought it was related to our self-hosted runners.

Runner Version and Platform

2.320.0 ( self hosted on k8s)

OS of the machine running the runner? linux/amd

What's not working?

image

Job Log Output

Nothing useful.

Runner and Worker's Diagnostic Logs

Nothing useful.

@omerap12 omerap12 added the bug Something isn't working label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant