IMPORTANT MESSAGE: We are still experiencing some difficulties that will affect your ability work with the RWS AppStore. Our IT team is working to resolve this but for now you may not be able to download or upload apps through the RWS AppStore. We apologise for the inconvenience and will update the community when we have a resolution in place. In the meantime you can take advantage of the Private AppStore if you are using Trados Studio 2021 or 2022.

Multiple tasks failing at "Apply GroupShare TM" stage

We are in need of support with the following issue. Please note, that PS and the DEV team have not been able to resolve the issue and recommend your guidance;

We have a problem with a plugin which communicates to GroupShare API via Studio SDK.

It works in an apparently random way. Sometimes it throws errors when processing files, sometimes it doesn’t. Usually, when we retry the processing, it works OK.
There is also a community post about some of the problems (not all of them):
https://community.sdl.com/developers-more/developers/language-developers/f/sdk_qa/26753/studio-2019-project-automation---licensingexception---license-check-failed---could-not-find-any-licensing-provider-factory-safenetrms

Details
Code is located here in PS TFS:
\\PS\Current\Projects\KION\Sdl.Tms.GroupShareTm\GroupShareHelper.cs
Repro environment:
https://kionstaging.sdlproducts.com
Steps to reproduce:
1. Create a job in this config KION GS POC
a. Test files can be taken from this job https://kionstaging.sdlproducts.com/interface/jobs/items.asp?parentid=2&jobid=87539
b. Use EN-GB > FR, EN-GB > SK language pairs
2. See in logs how slow and unreliable it is – bear in mind that we’ve tried adding some automatic retry logic for it to work, which catches some of the errors and sometimes works – however, it is not performant & reliable enough to be used in production. We need a proper fix.

The most common error that we encounter is:

Error while loading Studio license provider on attempt 1 of 5. Sdl.ProjectAutomation.FileBased.LicensingException: License check failed, with exception: System.ArgumentException: Could not find any licensing provider factory 'SafeNetRMS'. at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.CreateProvider(ILicensingProviderConfiguration config, String preferredProviderId) at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetCurrentLicensingProvider() at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetProductLicense() at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetLicenseWithoutConsumingSeatsOrUsages() at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense() ---> System.ArgumentException: Could not find any licensing provider factory 'SafeNetRMS'. at Sdl.Common.Licensing.Provider.Core.LicensingProviderManager.CreateProvider(ILicensingProviderConfiguration config, String preferredProviderId) at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetCurrentLicensingProvider() at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetProductLicense() at Sdl.Common.Licensing.Manager.ApplicationLicenseManager.GetLicenseWithoutConsumingSeatsOrUsages() at Sdl.ProjectAutomation.FileBased.FileBasedProject.CheckLicense() — End of inner exception stack trace — at Sdl.ProjectAutomation.FileBased.FileBasedProject..ctor(ProjectInfo projectInfo, ProjectTemplateReference templateReference) at Sdl.Tms.GroupShareTm.GroupShareHelper.CreateStudioProject(List`1 allTasks) at Sdl.Tms.GroupShareTm.GroupShareHelper.CreateStudioProject(List`1 updateTasks, TmsCode& updateTmUsingProjectApi). Waiting additionally for 360 seconds

The most significant parts of the code are below:

//creation of studio project (see error above)
this.studioProject = new FileBasedProject(projectInfo, projectTemplate);
//adding credentials
this.studioProject.Credentials.AddCredential(new Uri(groupshareCredentials.GetSetting<string>("Uri")), windowsAuth, username, password);
//applying the TM on the Studio Project
AutomaticTask preTranslateFiles = this.studioProject.RunAutomaticTask(targetFiles.GetIds(), AutomaticTaskTemplateIds.PreTranslateFiles, (s, taskStatusArgs) => this.taskStatusEventArgsList.Add(taskStatusArgs), (s, messageArgs) => this.messageEventArgsList.Add(messageArgs));