Open JenTonUg opened 2 years ago
The next run, it ran fine. I've had this happen before when starting out fresh. Might this be an issue with the visio resource creation starting before the snapin is loaded?
This issue has been reported before, #372 and #790. Unfortunately we were unable to solve the issue in those cases because we were unable to reproduce and the issue creator didn't respond anymore.
This issue has something to do with timing: The code is loading the snap-in, but still can't find the cmdlet. Are you able to reproduce the issue when deploying a new farm?
I was just about to do a fresh deploy overnight, I'll let you know tomorrow.
Great! Just another quick question: Are you using SQLServerDsc in the same config by any chance?
Oh and another request if you are able to reproduce, could you please do another fresh deployment and test the following:
Adding a Start-Sleep -Seconds 3
in front of line 111 in MSFT_SPVisioServiceApp.psm1? Just to see if this is a timing issue.
No SQLServerDsc in use. I am using these, though:
The reason why I was rolling out a fresh deploy, is that I refactored my config. Of course this results in a failed deploy because of dependencies, which I'm currently trying to fix first. I'll get back here once I have that fixed. Bear with me...
And we're back. I've added the sleep to the code, and the issue persists. Once finished, the second time the dsc config is applied, the issue is fixed. I've just missed it this time. If you want me to test some more, just let me know, happy to help! I'll add some extra time to the sleep and will initiate another run on clean servers, in the hope to catch the issue and provide debug logging.
Upped the sleep time to 120 seconds, which is clearly visible in the log, yet the commandlet is still unavailable:
{"time": "2022-03-09T13:16:22.061+01:00", "type": "verbose", "message": "[APP01]: LCM: [ Start Resource ] [[SPVisioServiceApp]VisioServiceApp] "},
{"time": "2022-03-09T13:16:22.061+01:00", "type": "verbose", "message": "[APP01]: LCM: [ Start Test ] [[SPVisioServiceApp]VisioServiceApp] "},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Testing Visio Graphics service app 'Visio Graphics Service Application'"},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Getting Visio Graphics service app 'Visio Graphics Service Application'"},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Executing as the local run as user UGENT\\SA-Setup"},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Leaving BeginProcessing Method of Get-SPServiceApplication."},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Leaving ProcessRecord Method of Get-SPServiceApplication."},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Leaving EndProcessing Method of Get-SPServiceApplication."},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Current Values: ApplicationPool=SharePoint Web Services Default; Ensure=Absent; Name=Visio Graphics Service Application"},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Target Values: ApplicationPool=SharePoint Web Services Default; Ensure=Present; Name=Visio Graphics Service Application; ProxyName=Visio Graphics Service Application Proxy; Verbose=True"},
{"time": "2022-03-09T13:16:22.482+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Test-TargetResource returned False"},
{"time": "2022-03-09T13:16:22.498+01:00", "type": "verbose", "message": "[APP01]: LCM: [ End Test ] [[SPVisioServiceApp]VisioServiceApp] in 0.4370 seconds."},
{"time": "2022-03-09T13:16:22.498+01:00", "type": "verbose", "message": "[APP01]: LCM: [ Start Set ] [[SPVisioServiceApp]VisioServiceApp] "},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Setting Visio Graphics service app 'Visio Graphics Service Application'"},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Getting Visio Graphics service app 'Visio Graphics Service Application'"},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Executing as the local run as user UGENT\\SA-Setup"},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Leaving BeginProcessing Method of Get-SPServiceApplication."},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Leaving ProcessRecord Method of Get-SPServiceApplication."},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Leaving EndProcessing Method of Get-SPServiceApplication."},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Creating Visio Graphics Service Application Visio Graphics Service Application"},
{"time": "2022-03-09T13:16:23.207+01:00", "type": "verbose", "message": "[APP01]: [[SPVisioServiceApp]VisioServiceApp] Executing as the local run as user UGENT\\SA-Setup"},
{"time": "2022-03-09T13:18:22.889+01:00", "type": "verbose", "message": "[APP01]: LCM: [ End Set ] [[SPVisioServiceApp]VisioServiceApp] in 120.3910 seconds."},
{"time": "2022-03-09T13:18:22.889+01:00", "type": "error", "message": "PowerShell DSC resource MSFT_SPVisioServiceApp failed to execute Set-TargetResource functionality with error message: The term 'New-SPVisioServiceApplication' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. "},
same problem as https://github.com/dsccommunity/SharePointDsc/issues/990 The loaded Powershell can not load New-SPVisioServiceApplication.
A Remove- & Add-PsSnapin not solve this... The CmdLet New-SPVisioServiceApplication not available. The Remove-PsSnapin Microsoft.SharePoint.PowerShell not working. PsSnapin still loaded and available.
In a new fresh startet powershell, the CmdLet New-SPVisioServiceApplication are available
Problem description
When creating a new Visio Service application, I'm getting that the command new-SPVisioServiceApplication is not found. This is a fresh rollout of SP2019 on Windows 2019 servers. I believe line 111 in the MSFT_SPVisioServiceApp resource generates the issue. Just to make sure, I checked if something was off with my Sharepoint snapin, but the New-SPVisioServiceApplication cmdlet is there. Other webapplications are getting created succesfully.
DSC Operational log:
Verbose logs
DSC configuration
Suggested solution
Checking for the command in memory, if not, adding sharepoint pssnapin?
SharePoint version and build
Operating system the target node is running
PowerShell version and build the target node is running
SharePointDsc version