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

HTTP Trigger with invalid event returns 500 #1019

Closed
cherrycl opened this issue Jan 19, 2022 · 4 comments · Fixed by #1022
Closed

HTTP Trigger with invalid event returns 500 #1019

cherrycl opened this issue Jan 19, 2022 · 4 comments · Fixed by #1022

Comments

@cherrycl
Copy link
Contributor

cherrycl commented Jan 19, 2022

Set ExecutionOrder = "FilterByDeviceName, Transform, SetResponseData"

Request:

curl -i -X POST http://localhost:59705/api/v2/trigger --header 'Content-Type: application/json' -d 
'{"id": "5bd794de0e36080001f53eab", "origin": 1540855006469, "readings": [{"id": "5bd794de0e36080001f53eac", "origin": 1540855006469, "device": "Random-Float-Device", "name": "RandomValue_Float64", "value": "QAFk2HxRUOo="}]}'

Response:

HTTP/1.1 500 Internal Server Error
Date: Wed, 19 Jan 2022 05:19:05 GMT
Content-Length: 420
Content-Type: text/plain; charset=utf-8

1 error occurred:
	* unable to process payload AddEventRequest.Event.Versionable.ApiVersion field is required; AddEventRequest.Event.Id field is required; AddEventRequest.Event.DeviceName field is required; AddEventRequest.Event.ProfileName field is required; AddEventRequest.Event.SourceName field is required; AddEventRequest.Event.Origin field is required; AddEventRequest.Event.Readings field should greater than 0

Expected result:
UseTargetTypeOfByteArray=false should return status code 400 and UseTargetTypeOfByteArray=true should return status code 422.
Currently, no matter UseTargetTypeOfByteArray=false or true both return 500.

@cherrycl
Copy link
Contributor Author

Is it the same as #702?

@AlexCuse
Copy link
Contributor

Is this running agains main/nexus images or against the Jakarta release @cherrycl - I know of a potential avenue for regression in main that I will look into in the next couple days.

AlexCuse added a commit to AlexCuse/app-functions-sdk-go that referenced this issue Jan 19, 2022
Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes edgexfoundry#1019

Signed-off-by: Alex Ullrich <[email protected]>
@AlexCuse
Copy link
Contributor

@cherrycl @lenny-intel this looks like another regression from trigger refactoring far as I can tell. Needed to give the trigger insight into whether the service target type is *[]byte or not - did this through a new method RawInput on the ServiceBinding interface - let me know if you think name makes sense if it does I can add the relevant doc change.

AlexCuse added a commit to AlexCuse/app-functions-sdk-go that referenced this issue Jan 19, 2022
Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes edgexfoundry#1019

Signed-off-by: Alex Ullrich <[email protected]>
AlexCuse added a commit to AlexCuse/app-functions-sdk-go that referenced this issue Jan 19, 2022
Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes edgexfoundry#1019

Signed-off-by: Alex Ullrich <[email protected]>
AlexCuse added a commit to AlexCuse/app-functions-sdk-go that referenced this issue Jan 19, 2022
Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes edgexfoundry#1019

Signed-off-by: Alex Ullrich <[email protected]>
AlexCuse added a commit to AlexCuse/app-functions-sdk-go that referenced this issue Jan 19, 2022
Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes edgexfoundry#1019

Signed-off-by: Alex Ullrich <[email protected]>
@cherrycl
Copy link
Contributor Author

Is this running agains main/nexus images or against the Jakarta release @cherrycl - I know of a potential avenue for regression in main that I will look into in the next couple days.

@AlexCuse Found this error when using main/nexus image.

lenny-goodell pushed a commit that referenced this issue Jan 20, 2022
Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes #1019

Signed-off-by: Alex Ullrich <[email protected]>

Co-authored-by: Lenny Goodell <[email protected]>
FelixTing pushed a commit to FelixTing/app-functions-sdk-go that referenced this issue Mar 3, 2022
…dry#1022)

Requires the trigger to have insight into whether TargetType is byte
array or not - exposed this on ServiceBinding as RawInput

Fixes edgexfoundry#1019

Signed-off-by: Alex Ullrich <[email protected]>

Co-authored-by: Lenny Goodell <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants