VMware Cloud Community
masula
Contributor
Contributor

PowerCLI "Get-ContentLibrary" returns "com.vmware.vapi.std.errors.unauthenticated"

Hello,

Any idea why "Get-ContentLibrary" command returns following error code :

Get-ContentLibrary : 9. 10. 2023 17:10:26 Get-ContentLibrary com.vmware.vapi.std.errors.unauthenticated {'messages': [com.vmware.vapi.std.localizable_message {'id': com.vmware.vapi.endpoint.method.authentication.required, 'de
fault_message': Authentication required., 'args': [], 'params': , 'localized':}], 'data': , 'error_type': UNAUTHENTICATED, 'challenge': Basic realm="VAPI endpoint",SIGN realm=xxx,service="V
API endpoint",sts="https://xxx.net/sts/STSService/vsphere.local"}.
At line:1 char:1
+ Get-ContentLibrary
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ContentLibrary], CisException
+ FullyQualifiedErrorId : VMware.VimAutomation.Cis.Core.Impl.V1.Service.CisConnectionService.SessionCanNotBeCreated,VMware.VimAutomation.ViCore.Cmdlets.Commands.ContentLibrary.GetContentLibrary


It is not about correct rights, because few days ago it was working fine, and with the same account other PowerCLI commands (e.g Get-VM) are working fine.

8 Replies
LucD
Leadership
Leadership

Are you able to restart the service? Or your VCSA?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sjanssencbs
Contributor
Contributor

I have the exact same issue from time to time and I'm not sure what causes this. The script stayed the same for months now and randomly it stops working with this exact error message.

Running version 7.0.3 build 20845200

Reply
0 Kudos
LucD
Leadership
Leadership

It often seems to be an issue with the service on the VCSA.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
sjanssencbs
Contributor
Contributor

Thanks, we rebooted the VC and this indeed fixed the issue. We do have this issue quite often to be fair, sad the only solution for now is rebooting

Reply
0 Kudos
mathiel
Enthusiast
Enthusiast

Same issue with 7.03 Build 22357613 !

Reply
0 Kudos
mathiel
Enthusiast
Enthusiast

seems the same bug as described here:

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/get-vm-tag-tagname-no-longer-working/t...

solution worked for me:

Get the current memory allocated to the service
# cloudvm-ram-size -l | grep vmware-infraprofile

Example: vmware-infraprofile = 332

Doubling the memory should be enough to fix the issue, however in case it does not fix it you can further increase the memory.
# cloudvm-ram-size -C 664 vmware-infraprofile

Check the memory status again to confirm the change
# cloudvm-ram-size -l | grep vmware-infraprofile

Example: vmware-infraprofile = 684

Then restart the infraprofile service
# service-control --stop vmware-infraprofile && service-control --start vmware-infraprofile

Workaround
Restart the image infraprofile service may fix the issue until the service has OOM again
# service-control --stop vmware-infraprofile && service-control --start vmware-infraprofile

Reply
0 Kudos
LucD
Leadership
Leadership

That link is not working


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
mathiel
Enthusiast
Enthusiast

sorry, fixed it!

Reply
0 Kudos