GroupShareKit throwing exception from Project.Get("...")

I'm using GroupShareKit (2015 branch) which uses v1 of the GroupShare REST API to communicate with GroupShare 2017. Everything else I've tried so far works fine except for

GroupShareClient.Project.Get("projectGuidAsString");

Which throws the following exception:

   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Sdl.Community.GroupShareKit.Http.JsonHttpPipeline.DeserializeResponse[T](IResponse response) in C:\Work\Git\groupsharekit.net\Sdl.Community.GroupShareKit\Http\JsonHttpPipeline.cs:line 60
   at Sdl.Community.GroupShareKit.Http.Connection.<Run>d__19`1.MoveNext() in C:\Work\Git\groupsharekit.net\Sdl.Community.GroupShareKit\Http\Connection.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Sdl.Community.GroupShareKit.Http.ApiConnection.<Get>d__4`1.MoveNext() in C:\Work\Git\groupsharekit.net\Sdl.Community.GroupShareKit\Http\ApiConnection.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at GroupShareKit.Supertext.GroupShareKitFacade.ProjectFacade.<Get>d__5.MoveNext() in C:\Workspaces\supertext-dev\GroupShareKit.Supertext\GroupShareKitFacade\ProjectFacade.cs:line 151

 

I know that the specified project ID definitely exists.

Can anyone confirm that there is an underlying change in how GroupShare handles this REST request - and that v1 of the REST API now functions slightly differently?

Any workarounds?

  • Former Member
    0 Former Member
    Hi

    Can you send me the full text of the exception which contains also the "ExceptionType"?

    Regards,
    Alexandru-Constantin Pascariu
  • Exception Type: JsonSerializationException
    Exception Message: "Error converting value {null} to type 'System.DateTime'. Path 'DueDate', line 1, position 221."
    Exception Stack Trace:
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
      at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
      at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
      at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
      at Sdl.Community.GroupShareKit.Http.JsonHttpPipeline.DeserializeResponse[T](IResponse response) in C:\Work\Git\groupsharekit.net\Sdl.Community.GroupShareKit\Http\JsonHttpPipeline.cs:line 60
      at Sdl.Community.GroupShareKit.Http.Connection.<Run>d__19`1.MoveNext() in C:\Work\Git\groupsharekit.net\Sdl.Community.GroupShareKit\Http\Connection.cs:line 0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Sdl.Community.GroupShareKit.Http.ApiConnection.<Get>d__4`1.MoveNext() in C:\Work\Git\groupsharekit.net\Sdl.Community.GroupShareKit\Http\ApiConnection.cs:line 0
    --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
      at GroupShareKit.Supertext.GroupShareKitFacade.ProjectFacade.<Get>d__5.MoveNext() in C:\Workspaces\supertext-dev\GroupShareKit.Supertext\GroupShareKitFacade\ProjectFacade.cs:line 151

     

    Inner Exception Type: InvalidCastException
    Inner Exception Message: "Null object cannot be converted to a value type."
    Inner Exception Stack Trace:
      at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
      at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)

     

    Screenshot of Trados Studio exception details showing a JsonSerializationException with message 'Error converting value null to type 'System.DateTime' at path 'DueDate'.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 6:30 AM (GMT 0) on 5 Mar 2024]
  • Former Member
    0 Former Member in reply to Andrew Jameson

    Hello  ,

    The problem occurred because in the GroupShareKit(2015 branch) the "DueDate" was not nullable, you should update to the latest version of GroupShareKit via Nuget, which will fix this issue.
    Hope this helps.




    Regards,
    Alexandru-Constantin Pascariu

  • The latest version of GroupShareKit is for GS 2017 - won't this use v2 of the REST API? I.e., won't it contain "v2" in the URI for each API call, whereas the 2015 branch contained "1.0" in the URIs?

    My concern is that if I were to upgrade to the latest GroupShareKit then there will be even more breaking changes.

    Edit: I've updated my NuGet reference to the latest version but this introduces many more errors - some methods require different parameters, other methods no longer exist. This is why I wanted to remain with "v1" of the API until we have time for a larger rewrite/refactoring.

    Why bother versioning the API if SDL are going to make breaking changes to that version when modifying the API for a newer version? Didn't SDL consider that people were using v1 of the API?

  • Former Member
    0 Former Member in reply to Andrew Jameson
    Hi ,

    There will be an update for GroupShareKit(2015 branch) that will fix the current issue and still use the v1 GroupShare REST API.
    I will let you know when it's ready.

    Regards,
    Alexandru-Constantin Pascariu
  • Hi Alexandru-Constantin Pascariu

     

    is it possible also to include a fix for following issue: https://github.com/sdl/groupsharekit.net/issues/14 into the new version for 2015?

     

    Thanks for your help!

    Heinrich

  • Has there been any progress on this? It has now been two weeks since you said that there would be an update to this show-stopping regression bug. We're paying a lot of money to have someone from SDL upgrade our GroupShare 2015 installation to GroupShare 2017 next Monday but at this point we may have to cancel this unless there is some way of our application integrating with GroupShare 2017.

    We arranged this installation over a month in advance to give ourselves time to test everything. We've tested as much as we can but can go no further until this Get-a-project regression bug has been fixed.
  • Hi ,

    The updates to GroupShare Kit have been in testing this week and should be released for your use today, all being well. The team supporting the GroupShare Kit have no knowledge of your constraints and have to plan their work in line with many priorities. The kit itself is opensource.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji