Good morning. Hoping someone has some insights on this issue we are experiencing. Per Epicor documentation:
An unpublished library, meaning a new library that contains functions that are still under development or a previously published library that has been demoted from production for an update, can still be called via REST by developers for testing purposes. To do this, use a special staging segment in the request URL:
https://[KineticServer]/[KineticInstance]/api/v2/efx/staging/[Company]/[Library]/[Function]/
This works as documented in 2022.1.13. It does not work in 2023.1 or 2023.2. Using Postman to test the unpublished function, I get an error 500. The logging on the server is System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter ‘length’)
I have tried a function with parms and a totally blank function with no parms and the error message is the same.
Full error here:
<Exception act="unknown" machine="xxxxxxx" pid="6676" tid="154"><![CDATA[System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
at System.String.Substring(Int32 startIndex, Int32 length)
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService.ParseRestSharedNames(ReadOnlySpan`1 pathParts) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 158
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService.ParseRestV2Names(String[] pathParts) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 147
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService.GetNames(HttpRequest request, CallRouteType callType) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 101
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService..ctor(IHttpContextAccessor contextAccessor) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 39
at ResolveService(ILEmitResolverBuilderRuntimeContext , ServiceProviderEngineScope )
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.GetService(IServiceProvider sp, Type type, Type middleware)
at lambda_method563(Closure , Object , HttpContext , IServiceProvider )
at Ice.Hosting.AspNetCore.Middleware.CallHeaderMiddleware.InvokeAsync(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\CallHeaderMiddleware.cs:line 52
at Ice.Hosting.AspNetCore.Middleware.OperationDisposerMiddleware.InvokeAsync(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\OperationDisposerMiddleware.cs:line 34
at Epicor.RESTApi.Middleware.ApiKeyEnforcerMiddleware.Invoke(HttpContext context) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\ApiKeyEnforcerMiddleware.cs:line 79
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)]]></Exception>
System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter 'length')
at System.String.Substring(Int32 startIndex, Int32 length)
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService.ParseRestSharedNames(ReadOnlySpan`1 pathParts) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 158
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService.ParseRestV2Names(String[] pathParts) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 147
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService.GetNames(HttpRequest request, CallRouteType callType) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 101
at Ice.Hosting.AspNetCore.Services.CurrentCallInformationService..ctor(IHttpContextAccessor contextAccessor) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Services\CurrentCallInformationService.cs:line 39
at ResolveService(ILEmitResolverBuilderRuntimeContext , ServiceProviderEngineScope )
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.GetService(IServiceProvider sp, Type type, Type middleware)
at lambda_method563(Closure , Object , HttpContext , IServiceProvider )
at Ice.Hosting.AspNetCore.Middleware.CallHeaderMiddleware.InvokeAsync(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\CallHeaderMiddleware.cs:line 52
at Ice.Hosting.AspNetCore.Middleware.OperationDisposerMiddleware.InvokeAsync(HttpContext httpContext) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\OperationDisposerMiddleware.cs:line 34
at Epicor.RESTApi.Middleware.ApiKeyEnforcerMiddleware.Invoke(HttpContext context) in C:\_releases\ICE\ICE4.2.400.4\Source\Server\Hosting\AspNetCore\Ice.Hosting.AspNetCore\Middleware\ApiKeyEnforcerMiddleware.cs:line 79
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)