Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling an exported configuration silently fails #3178

Closed
leitzler opened this issue Apr 19, 2023 · 6 comments
Closed

Compiling an exported configuration silently fails #3178

leitzler opened this issue Apr 19, 2023 · 6 comments

Comments

@leitzler
Copy link

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

I tried to convert a configuration exported from a clean developer tenant (https://developer.microsoft.com/en-us/microsoft-365/dev-program).

The configuration was exported using certificate thumbprint and default mode, without any errors:

Export-M365DSCConfiguration -CertificateThumbprint $Cert.Thumbprint -TenantId <redacted>.onmicrosoft.com -ApplicationId 01234567-890a-bcde-f012-34567890abcd -Path Output -MaxProcesses 64

Then, when I try to compile it it silently fail w/o producing any .mof-file:

⌛ Export took {1349 seconds}
Directory "Output" doesn't exist; creating...
PS C:\> cd output
PS C:\output> .\M365TenantConfig.ps1
PS C:\output> dir

    Directory: C:\output


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        4/19/2023   8:55 AM                M365TenantConfig
-a----        4/19/2023   8:54 AM           2078 ConfigurationData.psd1
-a----        4/19/2023   8:54 AM        2723000 M365TenantConfig.ps1


PS C:\output> dir .\M365TenantConfig\
PS C:\output>

Verbose logs showing the problem

The issue is that there are no verbose logs. Running with -Verbose doesn't make any change. Enabling Enable-DscDebug -BreakAll didn't do any difference either.

Suggested solution to the issue

Break on errors by default. Print logs when things fail.

What did finally work was to set $ErrorActionPreference = 'Stop' ; before running, then it breaks with a detailed message.

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

Install-PackageProvider -Name NuGet -Force
Install-Module Microsoft365DSC -Force
Update-M365DSCDependencies

The operating system the target node is running

I'm running inside a Windows Server Core container, mcr.microsoft.com/windows/servercore:1809-amd64.

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

Version of the DSC module that was used ('dev' if using current dev branch)

1.23.412.1 Microsoft365DSC                     PSGallery            This DSC module is used to configure and monitor Microsoft tenants, including SharePoint Online, Exchange, Teams, etc.
@andikrueger
Copy link
Collaborator

What PS Version are you using? Icould you share the detailed error message?

@leitzler
Copy link
Author

The default version in the docker image:

$PSVersionTable

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

could you share the detailed error message?

I don't quite follow, from where? The issue is that there are no error messages.

@andikrueger
Copy link
Collaborator

What did finally work was to set $ErrorActionPreference = 'Stop' ; before running, then it breaks with a detailed message.

I was referring to this sentence above. Did you try to get the $Error variable?

@leitzler
Copy link
Author

Gotcha, apologies. The first error I get with 'Stop' is detailed in #3179 (I didn't check the $Error variable).

@leitzler
Copy link
Author

And the second/third error is detailed in #3181.

@NikCharlebois
Copy link
Collaborator

Let's continue to work on the individual issues listed above. Will close this one for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants