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

Return of Arrays in Node.js Action does not return error and return invalid response #5500

Open
emanuelpinho opened this issue Jul 24, 2024 · 1 comment

Comments

@emanuelpinho
Copy link

emanuelpinho commented Jul 24, 2024

Environment details:

Bug description

I am experiencing unexpected behavior when invoking a Node.js action that returns an array with blocking query parameter.

Steps to reproduce the issue:

  1. Create the following Node.js function:
function main(params) {
  return [1,2,3,4];
}

  1. Invoke the action using the endpoint:
<host>:3233/api/v1/namespaces/<namespace>/actions/<action_name>?blocking=true&result=false

Provide the expected results and outputs:

Since openwhisk requires return of dictionaries, the return value should be either an error or should include the complete activation, not just the result.

{
	"activationId": "d5a794ff47d4464fa794ff47d4f64f4f",
	"annotations": [...],
	"duration": 31,
	"end": 1721835003446,
	"logs": [],
	"name": "test-new",
	"namespace": "ns",
	"publish": false,
	"response": {
		"result": [1,2,3,4],
		"size": 2,
		"status": "success",
		"success": true
	},
	"start": 1721835003415,
	"subject": "bb713d3e-278b-4ba9-bfe0-f534283554cc",
	"version": "0.0.24"
}

Provide the actual results and outputs:

  • When blocking=true, the response is containing just the value.
[
  1,
  2,
  3,
  4
]

Additional information you deem important:

Issue is happening with last versions of docker images published.
#2027

@emanuelpinho emanuelpinho changed the title Return of Arrays in Node.js Action is not working Return of Arrays in Node.js Action does not return error and return invalid response Jul 24, 2024
@maurodelazeri
Copy link

I got the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants