apache / apache/openwhisk

Not able to run any function in Openwhisk after running an empty action

Open
#5,321 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
6.8k
Forks
1.2k
Avg merge
2d 14h
Merged PRs (30d)
2

Description

## Environment details:

* **Kubernetes** v1.22.6
* **Ubuntu** 20.04.4 LTS
* **Docker** 20.10.12, build 20.10.12-0ubuntu2~20.04.1

## Steps to reproduce the issue:

I had an Openwhisk setup deployed on Kubernetes which was working well. For experimentation, I created an action called `empty `with an empty file named `empty.js` just to see what will happen. When I invoked it with `wsk -i action invoke empty --result`, it gave the following output:
```
{
"error": "Missing main/no code to execute."
}
```
which is the correct and expected output. Till here everything is fine. After this, when I try to invoke any other actions which have the function code and were working fine before I tried the empty action, they also give the same error as the empty action. Now, when I try the `hello.js` function:
```
function main(params) {
var name = params.name || 'World';
return {payload: 'Hello, ' + name + '!'};
}
```
Instead of returning the expected payload, it outputs:
```
{
"error": "Missing main/no code to execute."
}
```
Same for other nodejs actions which were working before but stopped working after I tried the empty action.
I tried a python based action (name: `prime`, calculates nth prime number) which used to work before as expected. But now, it throws the following error:
```
{
"error": "Error unmarshaling request: json: cannot unmarshal object into Go struct field initBodyRequest.value.code of type string"
}
```

In the invoker logs, I see the following messages:
```
[2022-08-31T07:28:00.090Z] [ERROR] [#tid_sid_unknown] [ContainerProxy] Failed during init of cold container Some(ContainerId(wskowdev-invoker-00-11-guest-prime)), queued activations will be aborted.
[2022-08-31T07:28:00.090Z] [INFO] [#tid_sid_invokerNanny] [KubernetesClient] Deleting pod wskowdev-invoker-00-11-guest-prime [marker:invoker_kubeapi.delete_start:2767737]
```

For the nodejs actions, the invoker logs show:
```
[2022-08-30T17:53:48.891Z] [ERROR] [#tid_sid_unknown] [ContainerProxy] Failed during init of cold container Some(ContainerId(wskowdev-invoker-00-68-prewarm-nodejs14)), queued activations will be aborted.
[2022-08-30T17:53:48.892Z] [INFO] [#tid_sid_invokerNanny] [KubernetesClient] Deleting pod wskowdev-invoker-00-68-prewarm-nodejs14 [marker:invoker_kubeapi.delete_start:34393634]
```

I have tried to uninstall and re-install the `owdev` cluster which removed all the functions. I performed `kubeadm reset` as well.
Still the same error.

The issue is discussed here: https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1661878664234569

Is this a bug?

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the reported `wsk` invocations for the empty, Node.js, and Python actions, then inspect the corresponding invoker and ContainerProxy logs. Compare the failed initialization and request payloads; done means valid actions continue to invoke successfully after an empty action is run.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, kubernetes, nodejs, python
Domain
backend, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.