dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
358 stars 224 forks source link

Install SQL DB Engine only but failed to connect to Analysis Service #1746

Open hungtran84 opened 2 years ago

hungtran84 commented 2 years ago

Problem description

I'm trying to install SQL server 2019 in Windows Server 2019 but failed to execute Test Target resource because of Analysis Service. Actually I don't have a plan to install AS in this instance.

Verbose logs

Failed to invoke DSC Test method: PowerShell DSC resource DSC_SqlSetup  failed to execute Test-TargetResource functionality with error message: System.InvalidOperationException: Failed to connect to Analysis Services instance 'xxxx'. (SQLCOMMON0021) ---> System.Management.Automation.MethodInvocationException: Exception calling "Connect" with "1" argument(s): "A connection cannot be made. Ensure that the server is running." ---> Microsoft.AnalysisServices.ConnectionException: A connection cannot be made. Ensure that the server is running. ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:2383

DSC configuration

- name: Install SQL server
  win_dsc:
    resource_name: SQLSetup
    Action: Install
    SourcePath: "{{ src_dir }}"
    InstanceName: "{{ instance_name }}"
    InstallSharedDir: "{{ install_shared_dir }}"
    InstallSharedwowDir: "{{ install_shared_wow_dir }}"
    InstanceDir: "{{ instance_dir }}"
    SQLUserDBDir: "{{ sql_userdb_dir }}"
    SQLUserDBLogDir: "{{ sql_userdb_logdir }}"
    SQLTempDBDir: "{{ sql_tempdb_dir }}"
    SQLTempDBLogDir: "{{ sql_tempdb_logdir }}"
    SqlTempdbFileCount: "{{ sql_tempdb_file_count }}"
    SqlTempdbFileSize: "{{ sql_tempdb_file_size }}"
    SqlTempdbFileGrowth: "{{ sql_tempdb_file_growth }}"
    SqlTempdbLogFileSize: "{{ sql_tempdb_logfile_size }}"
    SqlTempdbLogFileGrowth: "{{ sql_tempdb_logfile_growth }}"
    SQLBackupDir: "{{ sql_backup_dir }}"
    Features: "{{ features }}"
    SQLCollation: "{{ sql_collation }}"
    AgtSvcStartupType: "{{ agent_svc_startup_type }}"
    BrowserSvcStartupType: "{{ browser_svc_startup_type }}"
    SQLSvcAccount_username: "{{ sql_svc_acc_username }}"
    SQLSvcAccount_password: "{{ sql_svc_acc_password }}"
    AgtSvcAccount_username: "{{ agent_svc_acc_username }}"
    AgtSvcAccount_password: "{{ agent_svc_acc_password }}"
    SQLSysadminAccounts: "{{ sql_sa }}"
    UpdateEnabled: "{{ update_enabled }}"

Suggested solution

Have no idea

SQL Server edition and version

I'm going to install SQL Server 2019 and fail so no SQL version available yet

SQL Server PowerShell modules

Name      Version    Path
----      -------    ----
SqlServer 21.1.18256 C:\Program Files\WindowsPowerShell\Modules\SqlServer\21.1.18256\SqlServer.psd1

Operating system

OsName               : Microsoft Windows Server 2019 Datacenter 
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434 
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version

Name                           Value
----                           -----
PSVersion                      5.1.17763.2867
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2867
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

SqlServerDsc version

Name         Version Path
----         ------- ----
SqlServerDsc 15.1.1  C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\15.1.1\SqlServerDsc.psd1
johlju commented 2 years ago

Trying to figure out what is going on. Is there an analysis service already installed on the node? It should only try to connect to a Analysis Service if there is a Windows service present. But it probably should make sure the desired state has 'AS' in the parameter Features. 🤔

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 40 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.