37
Views
3
Comments
Solved
[Action Info] Index and length must refer to a location within the string. Parameter name: length
action-info
Service icon
Forge asset by Caio Santana Magalhães
Application Type
Traditional Web

We use the GetActionInfo for many of our applications when we try to log something in Kibana. The GetActionInfo then returns the correct Action.

However for one specific REST API that we expose, we get the following error returned when trying to log an error:

Index and length must refer to a location within the string.
Parameter name: length
   at System.String.Substring(Int32 startIndex, Int32 length)
   at OutSystems.NssActionInfo.CssActionInfo._getActionInfoStack()
   at OutSystems.NssActionInfo.CssActionInfo.MssGetActionInfo(Int32 ssDepth, RCActionInfoRecord& ssResult)
   at ssTAP_Flexibiliseringskeuzes_API.RssExtensionActionInfo.MssGetActionInfo(HeContext heContext, Int32 inParamDepth, IRecord& outParamResult) 

When debugging the API the debugger stops at the GetActionInfo action and does not continue.

Since the action is working in most of our cases and since the GetActionInfo does not have an input parameter other than depth (which we leave at the default) this seems to be a problem in the code of this extension?

2019-10-27 01-32-56
Caio Santana Magalhães
 
MVP
Solution

Hey all, I somehow completely missed this post, sorry about that.


There was indeed an error in the way the substring function was being handled. I'll upload a new version that fixes this.



2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Daan,

I know nothing of this component, but checked the _getActionInfoStack function that triggers the exception. Unfortunately, it's a very long, complex function with 12 different Substrings, so it's for me impossible to tell what goes wrong and why. So I'll leave it to @Caio Santana Magalhães to say something about it.

2020-09-01 10-42-42
Stefano Valente

I have had the same issue. After analyzing we found that the GetActionInfo function cannot handle a REST-API name of more than 24 characters.

In our situation we got the error when using the function in the OnAuthentication event of the API.

Solution:

Keep your API names under 24 characters.


Ofcourse it would be great if @Caio Santana Magalhães could fix the bug.

2019-10-27 01-32-56
Caio Santana Magalhães
 
MVP
Solution

Hey all, I somehow completely missed this post, sorry about that.


There was indeed an error in the way the substring function was being handled. I'll upload a new version that fixes this.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.