Exception thrown while querying GroupShare API for project details

I've now found several GroupShare-based projects where the GroupShare API returns a 500 (Internal Server Error) response containing "An error has occurred."

The API method being called is /api/projectserver/v2/projects (GET)

At a guess I'd say that this has happened for approximately 1 in 10 projects. We mainly use GroupShareKit when consuming the API but GroupShareKit frequently doesn't bubble up the exception messages so for a clearer picture of the error I then tried calling the GroupShare REST API directly (using Postman) and it's from here that I receive the message "An error has occurred." (I think GroupShareKit threw an exception with the message "An API error occurred" or something similar.)

The project and its details are visible in the GroupShare web UI and in Trados, the problem only occurs when I ask for the details via the API.

I've found that the log file at C:\ProgramData\SDL\Service\Logs\Sdl.Application.log contains the following message each time this happens:

2018-07-23 13:34:22.167#Rest Api#GET groupshare.supertext.com:41234/.../aea5347e-eb18-4781-bb80-d13dc08ecf4c 2018-07-23 13:34:22.261#Rest Api#An unexpected error occurred: System.InvalidOperationException: An exception occured while reading a database value for property 'AnalysisStatisticsPerProject.ExactMatchedCharacters'. The expected type was 'System.Int32' but the actual value was null. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.EntityFrameworkCore.Metadata.Internal.EntityMaterializerSource.TryReadValue[TValue](ValueBuffer valueBuffer, Int32 index, IPropertyBase property) --- End of inner exception stack trace --- at Microsoft.EntityFrameworkCore.Metadata.Internal.EntityMaterializerSource.ThrowReadValueException[TValue](Exception exception, Object value, IPropertyBase property) at Microsoft.EntityFrameworkCore.Metadata.Internal.EntityMaterializerSource.TryReadValue[TValue](ValueBuffer valueBuffer, Int32 index, IPropertyBase property) at lambda_method(Closure , ValueBuffer ) at Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.UnbufferedEntityShaper`1.Shape(QueryContext queryContext, ValueBuffer valueBuffer) at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__3`1.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.<_TrackEntities>d__15`2.MoveNext() at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Sdl.ProjectServer.Data.Services.StatisticsService.GetAnalysisStatisticsOnProjectLevel(Guid projectId) at Sdl.StudioServer.Services.ProjectServer.RestApi.Adapter.Adapters.ProjectStatisticsAdapter.GetStatisticsOnProjectLevel(Guid projectId) at Sdl.StudioServer.Services.ProjectServer.RestApi.Controllers.V2.ProjectsV2Controller.Get(Guid id) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.<GetExecutor>b__c(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.<ExecuteAsync>b__4() at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)

Might this exception be caused by something that we've done? Is there anything we can do to prevent this fro happening? Is this a known error?

Parents Reply
  • Hi Raphael,

    We create the projects using the Studio API and then publish them to GroupShare. We do currently have an ongoing problem with the analysis when run via the Studio API but I don't think that's connected.

    Looking in the database and finding the record in proj.AnalysisStatistics, there are two entries for the file: the first record (with the lower ID, therefore recorded earlier) has no NULLs at all; the second record has only the Total... fields populated and the rest are NULL.

    There are actually two source files in this project and the records for both files exhibit the same - one fully populated record and another containing mostly NULLs.

    Screenshot of Trados Studio database records showing two entries for a file analysis. The first entry has all fields populated, while the second has only 'Total...' fields filled and the rest are NULL.



    Generated Image Alt-Text
    [edited by: Trados AI at 4:03 AM (GMT 0) on 5 Mar 2024]
Children