runner icon indicating copy to clipboard operation
runner copied to clipboard

Missing GITHUB_EVENT_PATH GITHUB Self_hosted_runner

Open avinashsi opened this issue 3 years ago • 10 comments

I am observing the following error with one in self hosted runner using docker in docker.

Describe the bug The /github/workflow folder exists, but whatever process is supposed to be adding the event.json event data doesn't appear to be happening.

To Reproduce Steps to reproduce the behavior: The issue is specifically with the following actions: mb2dev/[email protected]

It ends up giving this following error GITHUB_EVENT_PATH /github/workflow/event.json does not exist Error: No pull request found.

Expected behavior The task runs without error and generates my env variables

Runner Version and Platform

GH_RUNNER_VERSION=2.286.1

OS of the machine running the runner? ubuntu:20.04

What's not working?

Please include error messages and screenshots.

Job Log Output

Run mb2dev/[email protected] with: message: Docker image created for this PR: UL-10353_gh-self-hosted-f8dfd51GITHUB_TOKEN: *** env: IMAGE_NAME: eu.gcr.io/XXXXXXXX[2](https://github.com/XXXXXX/XXXXXXX/runs/XXXXXXXX?check_suite_focus=true#step:7:2)14/XXXXXXX-XXXXXXX /usr/bin/docker run --name e5d445f1dcbebb98b4f48bf55458[3](https://github.com/XXXXXXX/XXXXXXX-XXXXXXX/runs/XXXXXXX?check_suite_focus=true#step:7:3)a83d7a6[4](https://github.com/XXXXXXX/XXXXXXX-XXXXXXX/runs/XXXXXXX?check_suite_focus=true#step:7:4)_0[5](https://github.com/XXXXXXX/XXXXXXX-XXXXXXX/runs/XXXXXXX?check_suite_focus=true#step:7:5)e183 --label 7e5d44 --workdir /github/workspace --rm -e IMAGE_NAME -e INPUT_MESSAGE -e INPUT_GITHUB_TOKEN -e INPUT_REACTIONS -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e ACTIONS_ID_TOKEN_REQUEST_URL -e ACTIONS_ID_TOKEN_REQUEST_TOKEN -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/actions/_work/_temp/_github_home":"/github/home" -v "/home/actions/_work/_temp/_github_workflow":"/github/workflow" -v "/home/actions/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/actions/_work/XXXXXXX-XXXXXXX/XXXXXXX-XXXXXXX":"/github/workspace" 7e5d44:5f1dcbebb98b4f48bf554583a83d7a[6](https://github.com/XXXXXXX/XXXXXXX-XXXXXXX/runs/6291362735?check_suite_focus=true#step:7:6)4 "Docker image created for this PR: XXXXXXX-branch-self-hosted-f8dfd51" "***" "" [@octokit/rest] const Octokit = require("@octokit/rest")is deprecated. Useconst { Octokit } = require("@octokit/rest") instead GITHUB_EVENT_PATH /github/workflow/event.json does not exist Error: No pull request found.

.

avinashsi avatar May 17 '22 12:05 avinashsi

Hey @avinashsi,

Can you please provide an example workflow, so we can reproduce this issue?

nikola-jokic avatar Oct 24 '22 07:10 nikola-jokic

I'm experiencing this also, but to be clear, it only happens on my self-hosted runners that use a remote docker daemon. Here's a workflow that reproduces it: https://github.com/daos-stack/daos/blob/aef3e986b0f123bb46384c365c94c3780947b228/.github/workflows/ci2.yml and it's the Build-and-test job that does it, specifically in the Publish NLT test results step using EnricoMi/publish-unit-test-result-action@v1. You can see how it fails here: https://github.com/daos-stack/daos/actions/runs/3385239884/jobs/5623975314

brianjmurrell avatar Nov 03 '22 12:11 brianjmurrell

So in my case, this is precisely because I am using a remote docker daemon with my runners. Bind mounts (i.e. -v "/lcl_home/gha_runner/actions-runner/_work/_temp/_github_home":"/github/home" -v "/lcl_home/gha_runner/actions-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/lcl_home/gha_runner/actions-runner/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/lcl_home/gha_runner/actions-runner/_work/daos/daos":"/github/workspace") simply don't work to bind mount from the GH runner across the network to the remote docker daemon. What the remote docker daemon actually does is bind mounts those dirs on it's machine into the container.

The TL;DR: of all of this is that you probably cannot for all practical purposes run your GHA runners and docker deamon on separate hosts, right? Seems awfully wasteful that each runner host has to self-contain it's docker daemon and it's cache and the entire runner farm cannot benefit from a single global docker cache on a remote docker daemon. Am I misunderstanding?

brianjmurrell avatar Nov 03 '22 20:11 brianjmurrell

i got the same issue on self-hosted runner. my workflow as below

name: autoupdate
on:
  push: {}
jobs:
  autoupdate:
    name: autoupdate
    runs-on: [self-hosted, small-mem2]
    steps:
      - name: Inspect Environment Variables
        run: env

      - name: Auto update
        uses: docker://chinthakagodawita/autoupdate-action:v1

        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DRY_RUN: 'false'
          PR_FILTER: 'auto_merge'
          PR_READY_STATE: 'ready_for_review'
          MERGE_MSG: 'Branch was auto-updated.'
          MERGE_CONFLICT_ACTION: 'fail'

i got below error

/usr/bin/docker run --name chinthakagodawitaautoupdateactionv1_fe197c --label c3f261 --workdir /github/workspace --rm -e "GITHUB_TOKEN" -e "DRY_RUN" -e "PR_FILTER" -e "PR_READY_STATE" -e "MERGE_MSG" -e "MERGE_CONFLICT_ACTION" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/_temp/_github_home":"/github/home" -v "/home/_temp/_github_workflow":"/github/workflow" -v "/home/_temp/_runner_file_commands":"/github/file_commands" -v "/home/sol-project/sol-project":"/github/workspace" chinthakagodawita/autoupdate-action:v1
GITHUB_EVENT_PATH /github/workflow/event.json does not exist
GITHUB_EVENT_PATH /github/workflow/event.json does not exist
Error: ENOENT: no such file or directory, open '/github/workflow/event.json'

i inspected my env and i found my GITHUB_EVENT_PATH which is different. GITHUB_EVENT_PATH=/home/_temp/_github_workflow/event.json

please help me to resolve this issue.

charujain12 avatar Dec 09 '22 00:12 charujain12

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Dec 11 '23 00:12 github-actions[bot]

Same issue here on self-hosted runners. Only difference is that I'm using superlinter. But I'm getting the same results: 2023-12-18 12:26:55 [INFO] Successfully found:[GITHUB_WORKSPACE], value:[/github/workspace] 2023-12-18 12:26:55 [INFO] Successfully found:[GITHUB_EVENT_PATH], value:[/github/workflow/event.json] /action/lib/linter.sh: line 550: /github/workflow/event.json: No such file or directory 2023-12-18 12:26:55 [ERROR] Failed to get [GITHUB_ORG]! 2023-12-18 12:26:55 [FATAL] []

koen-venly avatar Dec 18 '23 13:12 koen-venly

Other actions to that use this... Like for the slack notifications: cat: can't open '//workflow/event.json': No such file or directory cat: can't open '//workflow/event.json': No such file or directory Message is required

koen-venly avatar Dec 21 '23 12:12 koen-venly

Same issue here on self-hosted runners. Only difference is that I'm using superlinter. But I'm getting the same results: 2023-12-18 12:26:55 [INFO] Successfully found:[GITHUB_WORKSPACE], value:[/github/workspace] 2023-12-18 12:26:55 [INFO] Successfully found:[GITHUB_EVENT_PATH], value:[/github/workflow/event.json] /action/lib/linter.sh: line 550: /github/workflow/event.json: No such file or directory 2023-12-18 12:26:55 [ERROR] Failed to get [GITHUB_ORG]! 2023-12-18 12:26:55 [FATAL] []

I am also seeing this same problem with Super-linter.

Lance-DC avatar Feb 06 '24 04:02 Lance-DC

I'm also struggling with this even with the latest version. There are tons of actions which are unable to run in a dind container.

Is there any workaround?

4szt4l avatar May 09 '24 18:05 4szt4l