Apply Pnp Provisioning : List workflow

%3CLINGO-SUB%20id%3D%22lingo-sub-37157%22%20slang%3D%22en-US%22%3EApply%20Pnp%20Provisioning%20%3A%20List%20workflow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37157%22%20slang%3D%22en-US%22%3E%3CP%3ESource%20sub%20site%20contains%201.%20A%20list%26nbsp%3Bbased%20workflow%20(2013%20version)%3C%2FP%3E%3CP%3E1.%20create%20using%20SPD%20and%20works%20successfully%20-%20when%20using%20Get-PnPProvisioningTemplate%20it%20creates%20a%20%7BGUID%7D.xaml%20file%20in%20the%20output%20directory%20along%20with%20the%20template%20defintion%20file.%20I%20have%20reviewed%20these%20and%20all%20xml%20tags%2Fformatting%20appear%20to%20be%20correct.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20using%20Apply-PnpProvisioningTemplate%20(with%20debuggin%20on)%20it%20receive%20the%20following%20out%20put.%3C%2FP%3E%3CP%3EPowerShell_ISE.exe%20Information%3A%200%20%3A%202016-12-29%2012%3A22%3A13.7871%26nbsp%3B%5BLookup%20Fields%5D%26nbsp%3B%5B13%5D%26nbsp%3B%5BDebug%5D%26nbsp%3BCode%20execution%20scope%20started%26nbsp%3B0ms%26nbsp%3Ba1f33407-1bac-4feb-9e7a-9d7d182e894d%3CBR%20%2F%3EPowerShell_ISE.exe%20Information%3A%200%20%3A%202016-12-29%2012%3A22%3A17.9701%26nbsp%3B%5BLookup%20Fields%5D%26nbsp%3B%5B13%5D%26nbsp%3B%5BDebug%5D%26nbsp%3BCode%20execution%20scope%20ended%26nbsp%3B4183ms%26nbsp%3Ba1f33407-1bac-4feb-9e7a-9d7d182e894d%3CBR%20%2F%3EPowerShell_ISE.exe%20Information%3A%200%20%3A%202016-12-29%2012%3A22%3A17.9701%26nbsp%3B%5BWorkflows%5D%26nbsp%3B%5B13%5D%26nbsp%3B%5BDebug%5D%26nbsp%3BCode%20execution%20scope%20started%26nbsp%3B0ms%26nbsp%3Ba1f33407-1bac-4feb-9e7a-9d7d182e894d%3CBR%20%2F%3EPowerShell_ISE.exe%20Information%3A%200%20%3A%202016-12-29%2012%3A22%3A17.9701%26nbsp%3B%5BOfficeDevPnP.Core%5D%26nbsp%3B%5B0%5D%26nbsp%3B%5BInformation%5D%26nbsp%3BFile%20859710e9-c3c5-447e-9789-6606c27fe302.xaml%20retrieved%20from%20folder%20%26nbsp%3B0ms%26nbsp%3B%3CBR%20%2F%3EPowerShell_ISE.exe%20Information%3A%200%20%3A%202016-12-29%2012%3A22%3A18.4169%26nbsp%3B%5BWorkflows%5D%26nbsp%3B%5B13%5D%26nbsp%3B%5BDebug%5D%26nbsp%3BCode%20execution%20scope%20ended%26nbsp%3B452ms%26nbsp%3Ba1f33407-1bac-4feb-9e7a-9d7d182e894d%3CBR%20%2F%3EPowerShell_ISE.exe%20Information%3A%200%20%3A%202016-12-29%2012%3A22%3A18.4169%26nbsp%3B%5BProvisioning%5D%26nbsp%3B%5B13%5D%26nbsp%3B%5BDebug%5D%26nbsp%3BCode%20execution%20scope%20ended%26nbsp%3B119730ms%26nbsp%3Ba1f33407-1bac-4feb-9e7a-9d7d182e894d%3CBR%20%2F%3EApply-PnpProvisioningTemplate%20%3A%20Operation%20is%20not%20valid%20due%20to%20the%20current%20state%20of%20the%20object.%3CBR%20%2F%3EAt%20line%3A2%20char%3A1%3CBR%20%2F%3E%2B%20Apply-PnpProvisioningTemplate%20-Web%20%24site%20-Path%20%22.%5CAAAProvision.xml%22%3B%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20CategoryInfo%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3A%20WriteError%3A%20(%3A)%20%5BApply-PnPProvisioningTemplate%5D%2C%20ServerException%3CBR%20%2F%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2B%20FullyQualifiedErrorId%20%3A%20EXCEPTION%2CSharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20Assumption%20is%20around%20the%20workflow%2C%20as%20removing%20this%20appears%20to%20work%20successfully.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20pointers%2Fideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-37157%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1267539%22%20slang%3D%22en-US%22%3ERe%3A%20Apply%20Pnp%20Provisioning%20%3A%20List%20workflow%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1267539%22%20slang%3D%22en-US%22%3EHi%20Rod%2C%3CBR%20%2F%3EI%20know%2C%20this%20topic%20is%20more%20than%20three%20years%20old%2C%20but%20I'm%20running%20into%20the%20same%20issue.%3CBR%20%2F%3EDid%20you%20ever%20find%20out%20what%20was%20causing%20this%20error%20or%20even%20how%20to%20circumvent%20it%3F%3CBR%20%2F%3E%3CBR%20%2F%3EGreetings%2C%3CBR%20%2F%3EFrank%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Source sub site contains 1. A list based workflow (2013 version)

1. create using SPD and works successfully - when using Get-PnPProvisioningTemplate it creates a {GUID}.xaml file in the output directory along with the template defintion file. I have reviewed these and all xml tags/formatting appear to be correct.

 

When using Apply-PnpProvisioningTemplate (with debuggin on) it receive the following out put.

PowerShell_ISE.exe Information: 0 : 2016-12-29 12:22:13.7871 [Lookup Fields] [13] [Debug] Code execution scope started 0ms a1f33407-1bac-4feb-9e7a-9d7d182e894d
PowerShell_ISE.exe Information: 0 : 2016-12-29 12:22:17.9701 [Lookup Fields] [13] [Debug] Code execution scope ended 4183ms a1f33407-1bac-4feb-9e7a-9d7d182e894d
PowerShell_ISE.exe Information: 0 : 2016-12-29 12:22:17.9701 [Workflows] [13] [Debug] Code execution scope started 0ms a1f33407-1bac-4feb-9e7a-9d7d182e894d
PowerShell_ISE.exe Information: 0 : 2016-12-29 12:22:17.9701 [OfficeDevPnP.Core] [0] [Information] File 859710e9-c3c5-447e-9789-6606c27fe302.xaml retrieved from folder  0ms 
PowerShell_ISE.exe Information: 0 : 2016-12-29 12:22:18.4169 [Workflows] [13] [Debug] Code execution scope ended 452ms a1f33407-1bac-4feb-9e7a-9d7d182e894d
PowerShell_ISE.exe Information: 0 : 2016-12-29 12:22:18.4169 [Provisioning] [13] [Debug] Code execution scope ended 119730ms a1f33407-1bac-4feb-9e7a-9d7d182e894d
Apply-PnpProvisioningTemplate : Operation is not valid due to the current state of the object.
At line:2 char:1
+ Apply-PnpProvisioningTemplate -Web $site -Path ".\AAAProvision.xml";
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
    + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.ApplyProvisioningTemplate

 

My Assumption is around the workflow, as removing this appears to work successfully.

 

Any pointers/ideas?

 

1 Reply
Highlighted
Hi Rod,
I know, this topic is more than three years old, but I'm running into the same issue.
Did you ever find out what was causing this error or even how to circumvent it?

Greetings,
Frank