Nil pointer when reusing local workflows #138

Open
opened 2023-04-24 07:48:07 +00:00 by Zettat123 · 3 comments
Member

Copy from #132 (comment)


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.

Copy from https://gitea.com/gitea/act_runner/issues/132#issuecomment-739199 --- 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.
Author
Member

There is a workaround. Could you please add the inputs keyword and test again? @dwillbrandt


Sorry, I didn't see your comment #132 (comment)
This is a bug, but changing the format of on: part is a workaround and could avoid the nil pointer.

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

You should see the output in the Set up job section.

~~There is a workaround. Could you please add the `inputs` keyword and test again? @dwillbrandt~~ --- Sorry, I didn't see your comment https://gitea.com/gitea/act_runner/issues/132#issuecomment-739201 This is a bug, but changing the format of `on:` part is a workaround and could avoid the nil pointer. > Works but gives no output on the steps (maybe expected?) You should see the output in the `Set up job` section.
Contributor

The mentioned crash has been fixed upstream d70b225e85, you can cherry pick / update the fork.

The mentioned crash has been fixed upstream https://github.com/nektos/act/commit/d70b225e85b44efdcd97452959a3bbabec5eb6ed, you can cherry pick / update the fork.
Owner

The mentioned crash has been fixed upstream d70b225e85, you can cherry pick / update the fork.

I would merge it when upstream has released a tag containing it.

> The mentioned crash has been fixed upstream https://github.com/nektos/act/commit/d70b225e85b44efdcd97452959a3bbabec5eb6ed, you can cherry pick / update the fork. I would merge it when upstream has released a tag containing it.
Sign in to join this conversation.
No Milestone
No Assignees
3 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#138
No description provided.