Microsoft.AnalysisServices 19.86.2.1 is not adapted to work on Linux.

Oleksandr Demianchuk 0 Reputation points
2024-10-29T14:04:51.6566667+00:00

Hi,

When I try to connect to Server from Microsoft.AnalysisServices.Tabular on my local machine which is on Windows, it works correctly. While in Kubernetes cluster I get the error

The type initializer for 'Microsoft.AnalysisServices.Hosting.ClientHostingManager' threw an exception. Value cannot be null. (Parameter 'path1')

my class stack trace

Inner exception System.ArgumentNullException handled at Microsoft.AnalysisServices.Hosting.ClientHostingManager.get_IsProcessWithUserInterface: at System.ArgumentNullException.Throw (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.IO.Path.Combine (System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at Microsoft.AnalysisServices.Configuration.ClientConfigLoader.AddDefaultConfigurationValues (Microsoft.AnalysisServices.Runtime.Core, Version=19.86.2.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91) at Microsoft.AnalysisServices.Configuration.ClientConfigLoader.LoadClientConfiguration (Microsoft.AnalysisServices.Runtime.Core, Version=19.86.2.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91) at Microsoft.AnalysisServices.Hosting.ClientHostingManager.InitializeRuntimeAndClientConfiguration (Microsoft.AnalysisServices.Runtime.Core, Version=19.86.2.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91) at Microsoft.AnalysisServices.Hosting.ClientHostingManager.InitializeConfiguration (Microsoft.AnalysisServices.Runtime.Core, Version=19.86.2.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91) at Microsoft.AnalysisServices.Hosting.ClientHostingManager.Initialize (Microsoft.AnalysisServices.Runtime.Core, Version=19.86.2.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91) at Microsoft.AnalysisServices.Hosting.ClientHostingManager..cctor (Microsoft.AnalysisServices.Runtime.Core, Version=19.86.2.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91)

Digging deeper led me to ClientConfigLoader in Microsoft.AnalysisServices.Runtime.Core namespace. In AddDefaultConfigurationValues method it has this

  if (!config.ContainsKey(262145))    {        
config.Add(262145,Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "ASClientDiagnostics"));    
}

Environment.SystemDirectory for Windows is C:\WINNT\System32. But for Linux, it will be "". As a result Path.GetPathRoot(Environment.SystemDirectory) returns null and Path.Combine fails with null for path1.

How to workaround this (except running a windows pool in Kubernetes) or how to create bug report to the team owning it?

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,300 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Oleksandr Demianchuk 0 Reputation points
    2024-11-12T11:36:24.12+00:00

    I don't know if MSFT saw this question or if it was an already known issue, but it was fixed in latest update. Thanks. Code in question was updated to this:

    if (!config.ContainsKey(262145))
    {
        string text = Environment.SystemDirectory;
        if (string.IsNullOrEmpty(text))
        {
            text = AppContext.BaseDirectory;
        }
        if (string.IsNullOrEmpty(text))
        {
            text = Assembly.GetEntryAssembly().Location;
        }
        if (string.IsNullOrEmpty(text))
        {
            text = Environment.CurrentDirectory;
        }
        config.Add(262145, Path.Combine(Path.GetPathRoot(text), "ASClientDiagnostics"));
    }
    

    So resolution - update Microsoft.AnalysisServices to version 19.86.6 (at least).

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.