local reusable workflow showing "file does not exist" #132

Open
opened 2023-04-19 14:48:28 +00:00 by nephatrine · 9 comments

I am using act_runner v0.1.2 and gitea v1.19 in my personal instance. I have a workflow file .gitea/workflows/push.yaml that looks like this (just to test reusable workflows - it doesn't do anything):

name: Build Container Image
on: [push]
jobs:
  dispatch:
    runs-on: alpine
    steps:
      - name: Run Build Steps
        uses: ./.gitea/workflows/test.yaml

The .gitea/workflows/test.yaml file definitely exists in the repo, but I'm seeing file does not exist in the logs for the build job and the step always fails. I looked through the existing issues and saw #80 which looks very similar, but was apparently resolved already.

[Build Container Image/publish] [DEBUG] Starting container: 5c8980bfc9089e171cab0dec84afce9a92216b8352ece927b1155f23ebcf6033
[Build Container Image/publish] [DEBUG] Started container: 5c8980bfc9089e171cab0dec84afce9a92216b8352ece927b1155f23ebcf6033
[Build Container Image/publish] [DEBUG] Writing entry to tarball workflow/event.json len:4417
[Build Container Image/publish] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[Build Container Image/publish] [DEBUG] Extracting content to '/var/run/act/'
[Build Container Image/publish] [DEBUG] setupEnv => REDACTED
[Build Container Image/dispatch] [DEBUG] evaluating expression ''
[Build Container Image/dispatch] [DEBUG] expression '' evaluated to 'true'
[Build Container Image/dispatch] ⭐ Run Main Run Build Steps
[Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0
[Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0
[Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0
[Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/envs.txt len:0
[Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0
[Build Container Image/dispatch] [DEBUG] Extracting content to '/var/run/act'
[Build Container Image/dispatch]   ❌  Failure - Main Run Build Steps
[Build Container Image/dispatch] file does not exist
[Build Container Image/dispatch] [DEBUG] skipping post step for 'Run Build Steps': no action model available
[Build Container Image/dispatch] [DEBUG] Removed container: 5c8980bfc9089e171cab0dec84afce9a92216b8352ece927b1155f23ebcf6033
[Build Container Image/dispatch] [DEBUG]   🐳  docker volume rm GITEA-ACTIONS-TASK-106_WORKFLOW-Build-Container-Image_JOB-dispatch
[Build Container Image/dispatch] [DEBUG]   🐳  docker volume rm GITEA-ACTIONS-TASK-106_WORKFLOW-Build-Container-Image_JOB-dispatch-env
I am using act_runner v0.1.2 and gitea v1.19 in my personal instance. I have a workflow file `.gitea/workflows/push.yaml` that looks like this (just to test reusable workflows - it doesn't do anything): ```yaml name: Build Container Image on: [push] jobs: dispatch: runs-on: alpine steps: - name: Run Build Steps uses: ./.gitea/workflows/test.yaml ``` The `.gitea/workflows/test.yaml` file definitely exists in the repo, but I'm seeing `file does not exist` in the logs for the build job and the step always fails. I looked through the existing issues and saw #80 which looks very similar, but was apparently resolved already. ``` [Build Container Image/publish] [DEBUG] Starting container: 5c8980bfc9089e171cab0dec84afce9a92216b8352ece927b1155f23ebcf6033 [Build Container Image/publish] [DEBUG] Started container: 5c8980bfc9089e171cab0dec84afce9a92216b8352ece927b1155f23ebcf6033 [Build Container Image/publish] [DEBUG] Writing entry to tarball workflow/event.json len:4417 [Build Container Image/publish] [DEBUG] Writing entry to tarball workflow/envs.txt len:0 [Build Container Image/publish] [DEBUG] Extracting content to '/var/run/act/' [Build Container Image/publish] [DEBUG] setupEnv => REDACTED [Build Container Image/dispatch] [DEBUG] evaluating expression '' [Build Container Image/dispatch] [DEBUG] expression '' evaluated to 'true' [Build Container Image/dispatch] ⭐ Run Main Run Build Steps [Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/outputcmd.txt len:0 [Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/statecmd.txt len:0 [Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/pathcmd.txt len:0 [Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/envs.txt len:0 [Build Container Image/dispatch] [DEBUG] Writing entry to tarball workflow/SUMMARY.md len:0 [Build Container Image/dispatch] [DEBUG] Extracting content to '/var/run/act' [Build Container Image/dispatch] ❌ Failure - Main Run Build Steps [Build Container Image/dispatch] file does not exist [Build Container Image/dispatch] [DEBUG] skipping post step for 'Run Build Steps': no action model available [Build Container Image/dispatch] [DEBUG] Removed container: 5c8980bfc9089e171cab0dec84afce9a92216b8352ece927b1155f23ebcf6033 [Build Container Image/dispatch] [DEBUG] 🐳 docker volume rm GITEA-ACTIONS-TASK-106_WORKFLOW-Build-Container-Image_JOB-dispatch [Build Container Image/dispatch] [DEBUG] 🐳 docker volume rm GITEA-ACTIONS-TASK-106_WORKFLOW-Build-Container-Image_JOB-dispatch-env ```
Member
[Build Container Image/dispatch]   ❌  Failure - Main Run Build Steps
[Build Container Image/dispatch] file does not exist

The error message is not clear enough, I will try to improve it.

> ``` > [Build Container Image/dispatch] ❌ Failure - Main Run Build Steps > [Build Container Image/dispatch] file does not exist > ``` The error message is not clear enough, I will try to improve it.
Member

According to the documentation, if you want to reuse a workflow as a job, your workflow should be like:

jobs:
  Run-Build-Steps:
    uses: ./.gitea/workflows/test.yaml

If you use uses in steps, it means you want to use an action, not a workflow.

Could you please edit the .gitea/workflows/push.yaml workflow file and test again?

According to the [documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iduses), if you want to reuse a workflow as a job, your workflow should be like: ```yml jobs: Run-Build-Steps: uses: ./.gitea/workflows/test.yaml ``` If you use `uses` in `steps`, it means you want to use an action, not a workflow. Could you please edit the .gitea/workflows/push.yaml workflow file and test again?
lunny added the
reviewed
needs feedback
label 2023-04-20 07:19:14 +00:00
Author

Oooooh. I see. That's unfortunate because what I really wanted to do was kick it off conditionally based on a prior step like this:

    steps:
      - name: Check Base Image
        uses: actions/docker-base-image-check@v1.2.1
        id: checkbase
        with:
          base-image: SOME IMAGE
          image: SOME IMAGE
      - name: Run Build Steps
        if: steps.checkbase.outputs.needs-updating == 'true'
        uses: ./.gitea/workflows/test.yaml

I think I can work around that though.

It still doesn't really seem to work with that syntax either though. I changed it to this:

jobs:
  dispatch:
    uses: ./.gitea/workflows/test.yaml

and now the "Set up job" step is seems to just be stuck spinning. There's no output in the web interface. Looking at the logs it seems to be complaining about no steps:

[Build Container Image/dispatch] [DEBUG] evaluating expression 'success()'
[Build Container Image/dispatch] [DEBUG] expression 'success()' evaluated to 'true'
[Build Container Image/dispatch] [DEBUG] No steps found

and no further output for a long time now.

Oooooh. I see. That's unfortunate because what I really wanted to do was kick it off conditionally based on a prior step like this: ```yaml steps: - name: Check Base Image uses: actions/docker-base-image-check@v1.2.1 id: checkbase with: base-image: SOME IMAGE image: SOME IMAGE - name: Run Build Steps if: steps.checkbase.outputs.needs-updating == 'true' uses: ./.gitea/workflows/test.yaml ``` I think I can work around that though. It still doesn't really seem to work with that syntax either though. I changed it to this: ```yaml jobs: dispatch: uses: ./.gitea/workflows/test.yaml ``` and now the "Set up job" step is seems to just be stuck spinning. There's no output in the web interface. Looking at the logs it seems to be complaining about no steps: ``` [Build Container Image/dispatch] [DEBUG] evaluating expression 'success()' [Build Container Image/dispatch] [DEBUG] expression 'success()' evaluated to 'true' [Build Container Image/dispatch] [DEBUG] No steps found ``` and no further output for a long time now.
Author

After almost 15 minutes job fails/times out. Web interface still shows nothing at all to go on. No additional logs on runner container.

image

It's probably still something on my end at fault, but there's very little for me to go on to even determine what might be wrong. I've already changed it to level: debug in the config file in the hopes of increased verbosity.

After almost 15 minutes job fails/times out. Web interface still shows nothing at all to go on. No additional logs on runner container. ![image](/attachments/06bd552a-8ad6-42a0-85b6-15233849e1bb) It's probably still something on my end at fault, but there's very little for me to go on to even determine what might be wrong. I've already changed it to `level: debug` in the config file in the hopes of increased verbosity.
6.9 KiB
Contributor

Do you want to avoid repeating jobs? Otherwise you can write composite actions to avoid repeating steps

action.yml

inputs:
  myinput: {}
runs:
  using: composite
  steps:
  - uses: actions/setup-node@v3
    with:
      node-version: 20
  - run: echo ${{ inputs.myinput }}
    shell: bash # Added bash shell, because it is required in GitHub Actions composite actions while in act it is optional

https://docs.github.com/en/actions/creating-actions/creating-a-composite-action

  • Add an action.yml file to your repo
  • add a checkout step to get the files
  • - uses: ./build-steps (expects to find build-steps/action.yml)

I remember to read somewhere that Gitea maintainer are planning to implement adding reusable worksflows as steps, but that doesn't exists in GitHub Actions

I have never tried to use reusable workflows in gitea/act_runner

Do you want to avoid repeating jobs? Otherwise you can write composite actions to avoid repeating steps action.yml ```yaml inputs: myinput: {} runs: using: composite steps: - uses: actions/setup-node@v3 with: node-version: 20 - run: echo ${{ inputs.myinput }} shell: bash # Added bash shell, because it is required in GitHub Actions composite actions while in act it is optional ``` https://docs.github.com/en/actions/creating-actions/creating-a-composite-action - Add an `action.yml` file to your repo - add a checkout step to get the files - `- uses: ./build-steps` (expects to find `build-steps/action.yml`) _I remember to read somewhere that Gitea maintainer are planning to implement adding reusable worksflows as steps, but that doesn't exists in GitHub Actions_ _I have never tried to use reusable workflows in gitea/act_runner_
Member
[Build Container Image/dispatch] [DEBUG] evaluating expression 'success()'
[Build Container Image/dispatch] [DEBUG] expression 'success()' evaluated to 'true'
[Build Container Image/dispatch] [DEBUG] No steps found

The log looks weird. Since you have already called another reusable workflow in dispatch job, the number of steps won't be checked so there shouldn't be a No steps found log.
Could you please paste the related workflow files here? You could remove all secret info from the workflow files and only keep the code that you think may affect.

After almost 15 minutes job fails/times out. Web interface still shows nothing at all to go on. No additional logs on runner container.

It's a bug related to #126. This bug may cause the errors in Set up job not to be reported to the Gitea instance. It should have been fixed in #126.

> ``` > [Build Container Image/dispatch] [DEBUG] evaluating expression 'success()' > [Build Container Image/dispatch] [DEBUG] expression 'success()' evaluated to 'true' > [Build Container Image/dispatch] [DEBUG] No steps found > ``` The log looks weird. Since you have already called another reusable workflow in `dispatch` job, the number of steps won't be checked so there shouldn't be a `No steps found` log. Could you please paste the related workflow files here? You could remove all secret info from the workflow files and only keep the code that you think may affect. > After almost 15 minutes job fails/times out. Web interface still shows nothing at all to go on. No additional logs on runner container. It's a bug related to #126. This bug may cause the errors in `Set up job` not to be reported to the Gitea instance. It should have been fixed in #126.

Hi.
In the latest build there is more output reported to Gitea but reusing local workflows is still broken. Currently our daemon is restarting when it comes to the point of using the workflow:

Apr 24 09:13:48 pve107 act_runner[13636]: panic: runtime error: invalid memory address or nil pointer dereference
Apr 24 09:13:48 pve107 act_runner[13636]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb86334]
Apr 24 09:13:48 pve107 act_runner[13636]: goroutine 316 [running]:
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.setupWorkflowInputs({0x12411e0, 0xc0005e20c0}, 0xc00018ea78, 0xc000256120)
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/runner/expression.go:383 +0x74
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.getEvaluatorInputs({0x12411e0, 0xc0005e20c0}, 0xc000256120, {0x0, 0x0}, 0xc000465a00)
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/runner/expression.go:344 +0x85
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*RunContext).NewExpressionEvaluatorWithEnv(0xc000256120, {0x12411e0, 0xc0005e20c0}, 0xc0004c07e0)
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/runner/expression.go:69 +0x61b
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*RunContext).NewExpressionEvaluator(0xc00018ef20?, {0x12411e0, 0xc0005e20c0})
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/runner/expression.go:24 +0x3f
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*runnerImpl).newRunContext(0xc0003aa580, {0x12411e0, 0xc0005e20c0}, 0xc0003ff488, 0xc0004c0720)
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/runner/runner.go:208 +0x139
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1({0x12411e0, 0xc0005e20c0})
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/runner/runner.go:156 +0x65f
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/common.Executor.Then.func1({0x12411e0, 0xc0005e20c0})
Apr 24 09:13:48 pve107 act_runner[13636]:         github.com/nektos/act@v0.0.0/pkg/common/executor.go:129 +0x34
Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.newReusableWorkflowExecutor.func1({0x12411e0, 0xc0005e20c0})

Workflows are very simple due to testing. Parent workflow is echoing some text and should then use the second workflow. The second workflow should run when the workflow_call event is triggered and should echo another string.

Hi. In the latest build there is more output reported to Gitea but reusing local workflows is still broken. Currently our daemon is restarting when it comes to the point of using the workflow: ``` Apr 24 09:13:48 pve107 act_runner[13636]: panic: runtime error: invalid memory address or nil pointer dereference Apr 24 09:13:48 pve107 act_runner[13636]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb86334] Apr 24 09:13:48 pve107 act_runner[13636]: goroutine 316 [running]: Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.setupWorkflowInputs({0x12411e0, 0xc0005e20c0}, 0xc00018ea78, 0xc000256120) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/runner/expression.go:383 +0x74 Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.getEvaluatorInputs({0x12411e0, 0xc0005e20c0}, 0xc000256120, {0x0, 0x0}, 0xc000465a00) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/runner/expression.go:344 +0x85 Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*RunContext).NewExpressionEvaluatorWithEnv(0xc000256120, {0x12411e0, 0xc0005e20c0}, 0xc0004c07e0) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/runner/expression.go:69 +0x61b Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*RunContext).NewExpressionEvaluator(0xc00018ef20?, {0x12411e0, 0xc0005e20c0}) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/runner/expression.go:24 +0x3f Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*runnerImpl).newRunContext(0xc0003aa580, {0x12411e0, 0xc0005e20c0}, 0xc0003ff488, 0xc0004c0720) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/runner/runner.go:208 +0x139 Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1({0x12411e0, 0xc0005e20c0}) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/runner/runner.go:156 +0x65f Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/common.Executor.Then.func1({0x12411e0, 0xc0005e20c0}) Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act@v0.0.0/pkg/common/executor.go:129 +0x34 Apr 24 09:13:48 pve107 act_runner[13636]: github.com/nektos/act/pkg/runner.newReusableWorkflowExecutor.func1({0x12411e0, 0xc0005e20c0}) ``` Workflows are very simple due to testing. Parent workflow is echoing some text and should then use the second workflow. The second workflow should run when the `workflow_call` event is triggered and should echo another string.

i've figured out the problem. Maybe it's my fault because i don't read the documentation well...
Segfaults:

name: Blah blah blah
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on: [workflow_call]
jobs:
  local-workflow:
    runs-on: ubuntu-latest
    steps:
      - name: Say something
        run: echo "blah blah blah"

Works but gives no output on the steps (maybe expected?)

name: Blah blah blah
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on:
  workflow_call:
jobs:
  local-workflow:
    runs-on: ubuntu-latest
    steps:
      - name: Say something
        run: echo "blah blah blah"

Difference is the on:part

i've figured out the problem. Maybe it's my fault because i don't read the documentation well... Segfaults: ```yaml name: Blah blah blah run-name: ${{ gitea.actor }} is testing out Gitea Actions on: [workflow_call] jobs: local-workflow: runs-on: ubuntu-latest steps: - name: Say something run: echo "blah blah blah" ``` Works but gives no output on the steps (maybe expected?) ```yaml name: Blah blah blah run-name: ${{ gitea.actor }} is testing out Gitea Actions on: workflow_call: jobs: local-workflow: runs-on: ubuntu-latest steps: - name: Say something run: echo "blah blah blah" ``` Difference is the ```on:```part
Member

In the latest build there is more output reported to Gitea but reusing local workflows is still broken.

Hi @dwillbrandt , thanks for your bug report. It's a bug caused by an unchecked nil pointer. I'll send a PR to fix it.

Since the bug you commented is different from this issue, I opened a new issue (#138) to discuss the bug. Please comment anything related to the bug in the new issue :)

> In the latest build there is more output reported to Gitea but reusing local workflows is still broken. Hi @dwillbrandt , thanks for your bug report. It's a bug caused by an unchecked nil pointer. I'll send a PR to fix it. Since the bug you commented is different from this issue, I opened a new issue (#138) to discuss the bug. Please comment anything related to the bug in the new issue :)
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/act_runner#132
No description provided.