vcenter-event-broker-appliance icon indicating copy to clipboard operation
vcenter-event-broker-appliance copied to clipboard

[BUG] Init processing error for powercli based functions

Open rguske opened this issue 1 year ago • 2 comments

Describe the bug The following Init Processing Error occurs when deploying a PowerCLI based function.

Defaulted container "user-container" out of: user-container, queue-proxy
09/04/2023 06:21:40 - PowerShell HTTP server start listening on 'http://*:8080/'
09/04/2023 06:21:40 - Processing Init
09/04/2023 06:21:40 - Configuring PowerCLI Configuration Settings
Write-Error: 09/04/2023 06:21:40 - Init Processing Error: System.Management.Automation.CommandNotFoundException: The term 'Set-PowerCLIConfiguration' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
   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)
   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
   at System.Management.Automation.CommandProcessorBase.Complete()
09/04/2023 06:21:40 - PowerShell HTTP Server stop requested. Waiting for server to stop
True
09/04/2023 06:21:40 - PowerShell HTTP server is stopped

Applies to examples:

Version (please complete the following information):

  • Reproduced it in a non-VEBA environment as we as on VEBA v0.7.5

Additional context Add any other context about the problem here.

rguske avatar Sep 04 '23 06:09 rguske

@rguske Are you still seeing this problem?

lamw avatar Jan 21 '24 00:01 lamw

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Mark as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Apr 20 '24 00:04 github-actions[bot]

Closing issue due to inactivity. Please reopen if needed

github-actions[bot] avatar May 21 '24 00:05 github-actions[bot]

@lamw I am actually having this same error on v0.8 with a slightly different error message. If I comment out that line, Connect-VIServer is recognized as a cmdlet but fails since I can't set InvalidCertificateAction to Ignore so I'm not sure how to proceed.

Here's the error for what it's worth:

Write-Error: 07/03/2024 01:08:08 - Init Processing Error: System.Management.Automation.CommandNotFoundException: The term 'Set-PowerCLIConfiguration' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs:line 1655 at System.Management.Automation.Interpreter.ActionCallInstruction2.Run(InterpretedFrame frame) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/interpreter/CallInstruction.Generated.cs:line 504 at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs:line 392 at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/interpreter/ControlFlowInstructions.cs:line 358 at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/interpreter/Interpreter.cs:line 105 at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/interpreter/LightLambda.Generated.cs:line 81 at System.Management.Automation.PSScriptCmdlet.RunClause(Action1 clause, Object dollarUnderbar, Object inputToProcess) in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs:line 2339 at System.Management.Automation.PSScriptCmdlet.DoEndProcessing() in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/runtime/CompiledScriptBlock.cs:line 2276 at System.Management.Automation.CommandProcessorBase.Complete() in /usr/src/photon/BUILD/PowerShell-7.1.4/src/System.Management.Automation/engine/CommandProcessorBase.cs:line 592

zolakk avatar Jul 03 '24 01:07 zolakk

Just to add, after sleeping on it I figured I would try adding "Install-Module -Name VMware.PowerCLI -Scope AllUsers -Confirm:$false" to the top of the Process-Init function and it seems to have resolved the issue so I'm not sure if that's a bug workaround or not but it does work. Strange that Connect-VIServer was recognized though, almost like the built-in PowerCLI module is incomplete

zolakk avatar Jul 03 '24 18:07 zolakk