dsccommunity / SqlServerDsc

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

SqlSetup: DSC_SqlSetup.psd1 not found #1596

Closed mKenfenheuer closed 4 years ago

mKenfenheuer commented 4 years ago

Details of the scenario you tried and the problem that is occurring

Tried installing SQL 2017 with DSC, receiving error:

Importing the DSC_SqlSetup module with error The Windows PowerShell DSC_SqlSetup.psd1 data file cannot be found in
directory "C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\14.1.0\DscResources\DSC_SqlSetup\en-US\" or a parent directory.

Verbose logs showing the problem

WARNUNG: Von der Konfiguration "SQLInstall" wird mindestens eine integrierte Ressource heruntergeladen, ohne die zugehörigen 
Module explizit zu importieren. Fügen Sie Ihrer Konfiguration "Import-DscResource –ModuleName 'PSDesiredStateConfiguration'" 
hinzu, damit diese Meldung nicht mehr angezeigt wird.

    Verzeichnis: C:\DSC-Config\Config

Mode                LastWriteTime         Length Name                                                                       
----                -------------         ------ ----                                                                       
-a----       17.07.2020     11:29           3430 localhost.mof                                                              
AUSFÜHRLICH: Vorgang "CIM-Methode aufrufen" mit den folgenden Parametern durchführen, "'methodName' = SendConfigurationApply,
'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration".
AUSFÜHRLICH: Vom Computer 'WIN-T85G1FQQ5AN' mit Benutzer-SID 'S-1-5-21-3859010636-3025912086-3338911287-500' ist ein LCM-Meth
odenaufruf eingegangen.
AUSFÜHRLICH: [WIN-T85G1FQQ5AN]: LCM:  [ StartenFestlegen]
AUSFÜHRLICH: [WIN-T85G1FQQ5AN]: LCM:  [ BeendenFestlegen]
Importieren des Moduls DSC_SqlSetup mit Fehler Die Windows PowerShell-Datendatei "DSC_SqlSetup.psd1" kann nicht im 
Verzeichnis "C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\14.1.0\DscResources\DSC_SqlSetup\en-US\" oder einem 
übergeordneten Verzeichnis gefunden werden. fehlgeschlagen.
    + CategoryInfo          : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
    + FullyQualifiedErrorId : ImportModuleFailed
    + PSComputerName        : localhost

AUSFÜHRLICH: Vorgang "CIM-Methode aufrufen" wurde abgeschlossen.
AUSFÜHRLICH: Die Ausführung des Konfigurationsauftrags hat 4.837 Sekunden gedauert.
Importing the DSC_SqlSetup module with error The Windows PowerShell DSC_SqlSetup.psd1 data file cannot be found in
directory "C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\14.1.0\DscResources\DSC_SqlSetup\en-US\" or a parent directory.

Suggested solution to the issue

I've tried to rename the file from DSC_SqlSetup.strings.psd1 to DSC_SqlSetup.psd1 and the setup gets at least past the installation but fails with Test-DscConfiguration.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Confirm:$false
Install-Module -Name SqlServerDsc -Repository PSGallery -SkipPublisherCheck -Confirm:$false

Configuration SQLInstall
{
     Import-DscResource -ModuleName SqlServerDsc

     node localhost
     {
          WindowsFeature 'NetFramework45'
          {
               Name   = 'NET-Framework-45-Core'
               Ensure = 'Present'
          }

          SqlSetup 'InstallDefaultInstance'
          {
               SecurityMode        = 'SQL'
               SQLUserDBDir        = 'D:\SQL\UserDB\'
               SQLUserDBLogDir     = 'D:\SQL\UserDB\'
               SQLTempDBDir        = 'D:\SQL\TempDB\'
               SQLTempDBLogDir     = 'D:\SQL\TempDB\'
               SQLBackupDir        = 'D:\SQL\Backup\'
               InstanceName        = 'MSSQLSERVER'
               Features            = 'SQLENGINE'
               SourcePath          = 'C:\DSC-Config\SQL2017'
               SQLSysAdminAccounts = @('Administratoren')
               DependsOn           = '[WindowsFeature]NetFramework45'
          }
     }
}
SQLInstall -OutputPath .\Config
Start-DscConfiguration -Path .\Config -Wait -Force -Verbose

SQL Server edition and version the target node is running

SQL Server 2017 Enterprise

SQL Server PowerShell modules present on the target node

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

The operating system the target node is running

OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture       : 64-Bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : de-DE
OsMuiLanguages       : {de-DE}

Version and build of PowerShell the target node is running

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

Version of the DSC module that was used

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

Sound similar to the issue https://github.com/dsccommunity/NetworkingDsc/issues/464

johlju commented 4 years ago

@mKenfenheuer are you installing the OS with a German Windows Server 2019 (1809) ISO or is it installed using en-US ISO and using language pack similar to the issue in the previous comment?I'm gonna try to repro this.

johlju commented 4 years ago

@mKenfenheuer I have repro the problem in issue https://github.com/dsccommunity/DscResource.Common/issues/50. Thanks for reporting!

mKenfenheuer commented 4 years ago

@mKenfenheuer are you installing the OS with a German Windows Server 2019 (1809) ISO or is it installed using en-US ISO and using language pack similar to the issue in the previous comment?I'm gonna try to repro this.

Its a german iso, yes. Ive installed the language pack en-US and this works. I think its related to the current culture as only changing the current culture of the ps thread to en-us also works.

mKenfenheuer commented 4 years ago

@mKenfenheuer I have repro the problem in issue dsccommunity/DscResource.Common#50. Thanks for reporting!

Great! Thx for looking into this!

LeoSpyke commented 4 years ago

Same problem with the italian version

johlju commented 4 years ago

This is being fixed in PR https://github.com/dsccommunity/DscResource.Common/pull/51

johlju commented 4 years ago

I will release a new version tomorrow that will fix this. That version will contain a new version of the common module DscResource.Common that have a fix for this issue.

johlju commented 4 years ago

Pushed a full release now, if the test passes it will be deployed within 3 hours. There have recently been some intermittent issues when running integration tests which makes me need to re-run them manually. :/

Closing this at this time. If you see any problems with the new release, please comment on this issue or reopen the issue.