Error: -'Cannot create a diagnostic bundle' when attempting to export logs from vCenter Server using the PowerCLI Get-Log cmdlet.
search cancel

Error: -'Cannot create a diagnostic bundle' when attempting to export logs from vCenter Server using the PowerCLI Get-Log cmdlet.

book

Article ID: 320775

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

To assist in successfully generating and downloading the log bundle from the vCenter Server using PowerCLI.

Symptoms -

  • When trying to export the log bundle from vCenter Server using the PowerCLI cmdlet "Get-Log -Bundle," the operation fails with the error message: "Cannot create a diagnostic bundle," for example - 

PS C:\Users\Administrator> Get-Log -Bundle -DestinationPath C:\temp
Get-Log : 9/12/2023 9:15:00 AM  Get-Log         The request channel timed out while waiting for a reply after 00:05:00.
Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.
At line:1 char:1
+ Get-Log -Bundle -DestinationPath C:\temp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-Log], ViError
    + FullyQualifiedErrorId : Client20_QueryServiceImpl_WaitForUpdates_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetLog 

  • Cached .tgz log bundles created in the /storage/log directory may not be deleted following the failure, posing a risk of log disk exhaustion.
  • Executing the following PowerShell command "$error[0].exception | select *" immediately after the failure will provide additional details regarding this timeout issue - 

ErrorId           : Client20_QueryServiceImpl_WaitForUpdates_ViError
ErrorCategory     : NotSpecified
TargetObject      :
RecommendedAction :
SessionId         :
ConnectionId      : /VIServer=example.local\[email protected]:443/
Severity          : Error
Message           : 9/4/2023 10:56:11 AM        Get-Log         The request channel timed out while waiting for a reply after 00:05:00. 
                   Increase the timeout value passed to the call to Request or increase the SendTimeout value on the Binding. The time allotted to this operation may have been a portion of a longer timeout.

Environment

VMware vSphere 7.0.x

Cause

The PowerCLI session may time out before the operation or task completes due to the length of time required to generate a vCenter log bundle.

Resolution

  • To resolve this issue, extend the PowerCLI timeout by increasing the "WebOperationTimeoutSeconds" setting with the following command -

Set-PowerCLIConfiguration -WebOperationTimeoutSeconds 1800 

  • This will set the timeout to 30 minutes.
  • WebOperationTimeoutSeconds - This parameter defines the timeout for web operations, with a default value of 300 seconds.
  • To set an infinite timeout, use a negative integer.
  • A restart of PowerCLI is required for the changes to take effect.

 

Additional Information

For additional details, refer to the Set-PowerCLIConfiguration section of the PowerCLI documentation - Set-PowerCLIConfiguration

Impact/Risks -

  • Inability to export the log bundle from the vCenter Server.
  • Potential disk space consumption as the storage/log directory may fill with incomplete cached .tgz bundles.