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

Export for SPOApp Fails #5810

Open
pluethi1 opened this issue Feb 20, 2025 · 1 comment
Open

Export for SPOApp Fails #5810

pluethi1 opened this issue Feb 20, 2025 · 1 comment

Comments

@pluethi1
Copy link

Description of the issue

When trying to export SPOApp with service principal and certificate thumbprint, it fails with the following output:

Exporting Microsoft 365 configuration for Components: SPOApp

Authentication methods specified:
- Service Principal with Certificate Thumbprint

Connecting to {PnP}...✅
[1/1] Extracting [SPOApp] using {CertificateThumbprint}...

    |---[1/2] pnp-modern-search-parts-v4.sppkg✅
    |---[2/2] ❌
Error Log created at {file://C:/Windows/system32/34904-M365DSC-ErrorLog.log}
⌛ Export took {3 seconds} for {1 instances}
Join-Path : Cannot find path 'C:\Users\<MY_USER>\AppData\Local\Temp\pnp-modern-search-parts-v4.sppkg' because it does not
exist.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1:858 char:37
+ ...             $filePath = Join-Path $env:Temp $fileToCopy.Name -Resolve
+                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Users\<MY_USER>\A...-parts-v4.sppkg:String) [Join-Path], ItemNotFoundExce
   ption
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.JoinPathCommand

Partial Export file was saved at: C:\Users\<MY_USER>\AppData\Local\Temp\1fd37a79-2825-4650-9729-b55c3ad5c2cb.partial.ps1
Copy-Item : Cannot bind argument to parameter 'Path' because it is null.
At C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1:860 char:41
+                         Copy-Item -Path $filePath -Destination $destP ...
+                                         ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Copy-Item], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CopyItemCom
   mand

Could it be that something is configured in a wierd way on our SharePoint? Or is this an issue with the PS module?

Microsoft 365 DSC Version

1.25.212.2

Which workloads are affected

SharePoint Online

The DSC configuration

n.A.

Verbose logs showing the problem

[2025/02/20 12:07:56]
{InvalidOperation}
System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\DSCResources\MSFT_SPOApp\MSFT_SPOApp.psm1: line 413
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 1491
at <ScriptBlock>, <No file>: line 1
TenantId: <MY_COMPANY>.onmicrosoft.com

Environment Information + PowerShell Version

OsName               : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Name                           Value
----                           -----
PSVersion                      5.1.19041.5486
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.5486
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
@Franky709
Copy link

Franky709 commented Feb 21, 2025

+1 I'm facing the same issue.

Same version of DSC: 1.25.212.2

Tested in PowerShell 5.1

PSVersion 5.1.20348.2652
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.2652
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

- App registration

Authentication methods specified:

  • Service Principal with Certificate Thumbprint

Connecting to {PnP}...✅
[1/1] Extracting [SPOApp] using {CertificateThumbprint}...

|---[1/4] pnp-modern-search-parts-v4.sppkg✅
|---[2/4] pnp-react-search-refiners.sppkg✅
|---[3/4] customlearning.sppkg✅
|---[4/4] ❌

LOGFILE:

[2025/02/21 10:25:25]
{InvalidOperation}
System.Management.Automation.RuntimeException: You cannot call a method on a null-valued expression.
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
"Error during Export:"
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\DSCResources\MSFT_SPOApp\MSFT_SPOApp.psm1: line 413
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 1512

- Managed Identity

Connecting to {PnP}...✅
[1/1] Extracting [SPOApp] using {ManagedIdentity}...Error Log created at {file://C:/Users/admin.vancaef/Desktop/VANCAEF-debug/Scripts/Baseline/9552-M365DSC-ErrorLog.log}

⌛ Export took {214 seconds} for {0 instances}
Error Log created at {file://C:/Users/admin/Desktop/debug/Scripts/Baseline/9552-M365DSC-ErrorLog.log}
PS C:\Users\admin.vancaef\Desktop\VANCAEF-debug\Scripts\Baseline>

LOGFILE:
[2025/02/21 10:32:05]
{WriteError}
System.ArgumentException: The specified list was not found
at PnP.PowerShell.Commands.Files.FindFile.ExecuteCmdlet()
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord()
"The specified list was not found"
at Get-AllSPOPackages, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 2884
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\DSCResources\MSFT_SPOApp\MSFT_SPOApp.psm1: line 391

[2025/02/21 10:32:06]
{WriteError}
System.ArgumentException: The specified list was not found
at PnP.PowerShell.Commands.Files.FindFile.ExecuteCmdlet()
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord()
"The specified list was not found"
at Get-AllSPOPackages, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 2884
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1: line 849
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 1512

Tested in PowerShell 7:

PSVersion 7.4.6
PSEdition Core
GitCommitId 7.4.6
OS Microsoft Windows 10.0.20348
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

- App registration
Authentication methods specified:

  • Service Principal with Certificate Thumbprint

Connecting to {PnP}...✅
[1/1] Extracting [SPOApp] using {CertificateThumbprint}...Error Log created at {file://C:/Users/admin.vancaef/Desktop/VANCAEF-debug/Scripts/Baseline/10804-M365DSC-ErrorLog.log}

⌛ Export took {115 seconds} for {0 instances}

LOGFILE:
[2025/02/21 10:24:38]
{WriteError}
System.ArgumentException: The specified list was not found
at PnP.PowerShell.Commands.Files.FindFile.ExecuteCmdlet() in c:\build\src\Commands\Files\FindFile.cs:line 31
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 51
"The specified list was not found"
at Get-AllSPOPackages, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 2884
at Export-TargetResource, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\DSCResources\MSFT_SPOApp\MSFT_SPOApp.psm1: line 391
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1: line 689
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 1512

[2025/02/21 10:24:39]
{WriteError}
System.ArgumentException: The specified list was not found
at PnP.PowerShell.Commands.Files.FindFile.ExecuteCmdlet() in c:\build\src\Commands\Files\FindFile.cs:line 31
at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 51
"The specified list was not found"
at Get-AllSPOPackages, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 2884
at Start-M365DSCConfigurationExtract, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCReverse.psm1: line 849
at Export-M365DSCConfiguration, C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.25.212.2\Modules\M365DSCUtil.psm1: line 1512

- Managed Identity
Same as with the app registration

So the testing in 4 cases is 3 times the same result, only PS5.1 with app registration, there is a different result

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

No branches or pull requests

2 participants