Issue with 10.1.2. OnSite release - Null error when retrieving system info

lock
push_pin
done
Answered
8

Hello,

We upgraded our OnSite environment to 10.1.2. last night, but now get an error in our apps when retrieving the systeminfo.

10.1.2:

10.0.6:

 

Sample code:

SuperOffice.SoSystemInfo sosysteminfo = SuperOffice.SoSystemInfo.GetCurrent();

string serialNr = sosysteminfo.License.SerialNr;

This is using NuGet package 9.1.7543.1033.

24 May 2022 | 10:28 AM

All Replies (8)

Also tried this with the latest NuGet 10.1.2 packages now that they are out, same issue occurs.

24 May 2022 | 08:42 PM

Hi David!

I'm unable to reproduce this... I'm using the latest published nuget packages too - new project, no other dependencies (just SuperOffice.NetServer.Services).

25 May 2022 | 07:28 AM

I think I forgot to mention an important detail here, I am trying this using Remote mode, not Local.

Full code sample for 10.1.2:

  internal class Program
    {
        public static string RemoteBaseUrl => "https://crm.company.local/superoffice/remote/services88";

        public static string CrmUserName => "";

        public static string CrmPassword => "";

        static void Main(string[] args)
        {
            var services = new ServiceCollection();
            services
                .AddNetServerCore()
                .AddSoDatabase()
                .AddSingleton<Microsoft.Extensions.Logging.ILogger, SuperOffice.Logging.SoLogger>()
                .AddSingleton<SuperOffice.Security.Principal.IContextInitializer, ContextInitializer>();

            var provider = services.BuildServiceProvider(true);
            provider.RegisterWithNetServer();


            using (SuperOffice.SoSession soSession = SuperOffice.SoSession.Authenticate(CrmUserName, CrmPassword))
            {
                SuperOffice.SoSystemInfo systemInfo = SuperOffice.SoSystemInfo.GetCurrent();

                using (SuperOffice.CRM.Services.ContactAgent contactAgent = new SuperOffice.CRM.Services.ContactAgent())
                {
                    SuperOffice.CRM.Services.ContactEntity contactEntity = contactAgent.GetMyContact();
                }
            }
        }
    }

    internal class ContextInitializer : SuperOffice.Security.Principal.IContextInitializer
    {
        public void InitializeContext(string contextIdentifier)
        {
            ConfigureSettings();
        }

        private static void ConfigureSettings()
        {
            ConfigFile.WebServices.RemoteBaseURL = Program.RemoteBaseUrl;
            ConfigFile.Services.DefaultMode = SuperOffice.CRM.Services.ServiceMode.Remote;
            ConfigFile.Data.Session.Mode = "Process";

            ConfigFile.Diagnostics.LogToFile = true;
            ConfigFile.Diagnostics.LogFolder = @"C:\Temp";
            ConfigFile.Diagnostics.EnableScaffolding = true;
            ConfigFile.Diagnostics.LogDebug = true;
        }
    }

EDIT: Strange, the code example above display's wrong, the AddSingleton method contains the following:

Error:

25 May 2022 | 08:01 AM
Investigating...
25 May 2022 | 11:33 AM

Hi David,

I was able to reproduce your error using Remote mode towards an online tenant.

 

Do you get any additional exception information if you run this after authentication?

var tmp =  new SuperOffice.CRM.Services.WcfProxy.Services88.SoPrincipalAgentWcfProxy();
var temp2 = tmp.GetSystemInfo();

Before I tried that, I saw this error:

After adding the ApplicationToken setting, things worked as expected:

 

Another thing to check, but shouldn't be required client site, is the serviceHostingEnvironment setting. 

Best regards.

 

25 May 2022 | 12:58 PM

Hi Tony,

I'm trying this towards OnSite 10.1.2, our apps that run towards online tenants also using 'SuperOffice.SoSystemInfo.GetCurrent()' don't experience any issue.

Trying your code:

The web . config of the onsite environment has the following:

 

25 May 2022 | 01:09 PM

Hi David, 

Now registered as BUG 29182, actively being worked on.

Best regards.

31 May 2022 | 01:33 PM
Thanks for the update Tony! Hopefully a patch will be available soon.
31 May 2022 | 01:34 PM

Another issue reported in this release is an error observed when running ServerSetup.exe.

Kasper Rosenlund, a SuperOffice consultant, has reported a workaround is to run DbSetup.exe located in the ServerSetup folder.

Best regards.

 

1 Jun 2022 | 01:55 PM
We didn't experience this error when upgrading our own environment or at a customer which doesn't have any external integrations.

Do note that upgrading using DBSetup instead of serversetup still has a difference related to document templates being updated.
3 Jun 2022 | 08:04 AM
@David: Coudl you elaborate a bit regarding the difference related to document templates?

I have in many cases used DBSetup as most of my upgrades onsite have been between major versions, so we have gone from an old server to a new server with a completly new installation. But most of my customers haven't been using templates to any larger extent. So that hasn't been a part of the upgrade that I have given any major thought or research. I have only gotten the standard new templates with the new install, made a backup of that folder and then added the old ones in. I might have done some diff-checks on specific templates. What kind of updates are we talking about, like replacing old template variable format with new one in existing templates? Standard templates using a newer Office-format?

I'm just curious about what I may have missed. :)
3 Jun 2022 | 08:35 AM
Hi Marcus,

Pre-CDD era the DBSetup would not perform/execute imp files, so things like functionrights, new lists, etc would not be populated.

Since CDD this is done both by ServerSetup and DBSetup since it is part of the whole DictionarySteps upgrade process.

What DBSetup does not do is update the template folder, for example when the default mailappnt template or the ICS files where updated. Another example would be when PocketCRM was renamed/updated to Mobile CRM, the templates for this also changed, but where only updated when you do a migration/upgrade using ServerSetup.
3 Jun 2022 | 09:46 AM
@David: Ok! Thanks for the clarification!
3 Jun 2022 | 02:29 PM

Can confirm that with the hotfix that was released today (v10.1.2.1565) this issue is solved!

8 Jun 2022 | 01:55 PM
Thanks for the follow up!
9 Jun 2022 | 06:31 AM

Add reply