Unable to create MCS machine catalog due to large number of Provisioning Tasks

Unable to create MCS machine catalog due to large number of Provisioning Tasks

book

Article ID: CTX331240

calendar_today

Updated On:

Description

In rare cases, MCS machine catalog may fail to create with the following error --

Action Name: MC_CreateMachineCatalogInitialzation
Exception:
    DesktopStudio_ErrorId : UnknownError
    ErrorCategory : ResourceUnavailable
    DesktopStudio_PowerShellHistory : Create Machine Catalog 'XXXXXXX'


On analyzing the CDF traces from the Delivery Controller, you may find a similar exception being recorded --

"GetSdkProvisioningTasksScript(6100): Citrix.Orchestration.Base.LogicModels.Exceptions.CommunicationErrorException: Could not connect to the Machine Creation service.
at Citrix.Orchestration.Base.PowerShellInteraction.CmdletExecutionMethods.Execute[T](ISdkCmdlet`1 sdkCmd, ICmdletExecutionHost host, Boolean allowFailover)
at Citrix.Orchestration.Base.PowerShellSdk.ProvisioningSchemeService.Scripts.GetSdkProvisioningTasksScript.RunScript()
at Citrix.Orchestration.Base.PowerShellInteraction.PowerShellScript`1.Run()
Script history:
GetCatalogTaskScript
10/19/2021 11:20:25 AM
Get-ProvTask -AdminAddress ""localhost:9097"" -BearerToken ******** -MaxRecordCount 2147483647
Get-ProvTask : The maximum message size quota for incoming messages (41943040) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
+ CategoryInfo : NotSpecified: (:) [Get-ProvTask], CommunicationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.MachineCreation.Sdk.Task.Commands.GetProvTaskCommand
"
"GetCatalogTaskScript(6097): Citrix.Orchestration.Base.LogicModels.Exceptions.CommunicationErrorException: Could not connect to the Machine Creation service.
at Citrix.Orchestration.Base.PowerShellInteraction.CmdletExecutionMethods.Execute[T](ISdkCmdlet`1 sdkCmd, ICmdletExecutionHost host, Boolean allowFailover)
at Citrix.Orchestration.Base.PowerShellSdk.ProvisioningSchemeService.Scripts.GetSdkProvisioningTasksScript.RunScript()
at Citrix.Orchestration.Base.PowerShellInteraction.PowerShellScript`1.Run()
at Citrix.Orchestration.Base.PowerShellSdk.ProvisioningSchemeService.Scripts.GetCatalogTaskScript.RunScript()
at Citrix.Orchestration.Base.PowerShellInteraction.PowerShellScript`1.Run()
Script history:
GetCatalogTaskScript
10/19/2021 11:20:25 AM
Get-ProvTask -AdminAddress ""localhost:9097"" -BearerToken ******** -MaxRecordCount 2147483647
Get-ProvTask : The maximum message size quota for incoming messages (41943040) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
+ CategoryInfo : NotSpecified: (:) [Get-ProvTask], CommunicationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.MachineCreation.Sdk.Task.Commands.GetProvTaskCommand
"
"BackgroundTaskRepetitiveLoaderScript(362): Error retrieving background tasks: Citrix.Orchestration.Base.LogicModels.Exceptions.CommunicationErrorException: Could not connect to the Machine Creation service.
at Citrix.Orchestration.Base.PowerShellInteraction.CmdletExecutionMethods.Execute[T](ISdkCmdlet`1 sdkCmd, ICmdletExecutionHost host, Boolean allowFailover)
at Citrix.Orchestration.Base.PowerShellSdk.ProvisioningSchemeService.Scripts.GetSdkProvisioningTasksScript.RunScript()
at Citrix.Orchestration.Base.PowerShellInteraction.PowerShellScript`1.Run()
at Citrix.Orchestration.Base.PowerShellSdk.ProvisioningSchemeService.Scripts.GetCatalogTaskScript.RunScript()
at Citrix.Orchestration.Base.PowerShellInteraction.PowerShellScript`1.Run()
at Citrix.Orchestration.Base.PowerShellSdk.BackgroundTaskService.Scripts.BackgroundTaskRepetitiveLoaderScript.ExecuteIteration()
Script history:
GetCatalogTaskScript
10/19/2021 11:20:25 AM
Get-ProvTask -AdminAddress ""localhost:9097"" -BearerToken ******** -MaxRecordCount 2147483647
Get-ProvTask : The maximum message size quota for incoming messages (41943040) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
+ CategoryInfo : NotSpecified: (:) [Get-ProvTask], CommunicationException
+ FullyQualifiedErrorId : Citrix.XDPowerShell.Status.CommunicationError,Citrix.MachineCreation.Sdk.Task.Commands.GetProvTaskCommand

 

Resolution

To resolve this issue, clean up the completed provisioning task using PowerShell --

1.) Launch PowerShell
2.) Run asnp Citrix*
3.) Run Get-ProvTask -active $false | Remove-ProvTask (This command will remove entries for all completed tasks from the Machine Creation Service)

Problem Cause

This issue can occur if you have large number of provisioning tasks in the environment.