VMware Cloud Community
korycoronado
Contributor
Contributor

Connect-VIServer fails with Base-64 error

I am trying to connect to one of our vCenter instances after a PowerCLI upgrade.  I'm getting this error:

PS U:\> Connect-VIServer vCenterServer

Connect-VIServer : The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.

At line:1 char:1

+ Connect-VIServer vCenterServer

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Connect-VIServer], FormatException

    + FullyQualifiedErrorId : System.FormatException,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

Has anyone else ever seen this that may have some clues as to what's wrong?  I know credentials are good and i've seen similar issues as this not related to powercli on other forums.  Of course those were mostly devs talking about string encoding and didn't provide much insight for this issue.

PS: in case it matters that's not the real server name. I've tried the UQDN, FQDN, and CNAME of the host all without luck so i'm guessing the name isn't an issue.

Env:

VMware PowerCLI 10.1.0 build 8346946

PowerShell 5.1.17134.228

vCenter Server VCSA 6.5.0.5500

Reply
0 Kudos
21 Replies
Zsoldier
Expert
Expert

Is it the name that it's complaining about?  Have you tried IP?  Does the error pop up after entering credentials?

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos
korycoronado
Contributor
Contributor

I had not tried that but yes, it's still complaining even with the IP.

Reply
0 Kudos
Zsoldier
Expert
Expert

Are you passing -username -password?  Or are you passing -credential?

Chris Nakagaki (中垣浩一)
Blog: https://tech.zsoldier.com
Twitter: @zsoldier
Reply
0 Kudos
briance71
Contributor
Contributor

What os are you running on?

What version of powershell?

Screen shot of your commands + errror would be good.

Are there any other issues happening?

Has this ever worked on your system?

Reply
0 Kudos
LucD
Leadership
Leadership

Did you check if there is a VICredentialStoreItem for this vCenter?

Do a

Get-VICredentialStoreItem -Host vCenterServer

Did you stop/start your PowerShell/PowerCLI session in between retries?


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

Reply
0 Kudos
korycoronado
Contributor
Contributor

I've tried both passing the creds with -username and -password as well as having it prompt me for creds (passing nothing in the command line).

Reply
0 Kudos
korycoronado
Contributor
Contributor

I'm on windows 10.  The screenshot and PowerShell version are in my original post.  I am not experiencing any other issues.  We have 7 vC instances and this is the only one giving me problems.  It worked fine before the update to PowerShell from the PowerShell Gallery.

Reply
0 Kudos
korycoronado
Contributor
Contributor

I get an error running that command:

PS U:\> Get-VICredentialStoreItem -Host vCenterServer

Get-VICredentialStoreItem : Could not find Credential Store items for host 'vCenterServer' using the specified filter.

At line:1 char:1

+ Get-VICredentialStoreItem -Host vcenterserver

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (:) [Get-VICredentialStoreItem], VimException

    + FullyQualifiedErrorId : Core_GetVICredentialStoreItem_ProcessRecord_NotFoundByHost,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVICredentialStoreItem

The runs have been under numerous conditions including a stop/start of the entire script, closing and reloading powershell between runs, and running only the single command on a fresh powershell instance.

Reply
0 Kudos
korycoronado
Contributor
Contributor

Some additional info:

  • I'm running two external PSCs behind a Netscaler
  • The VCSA and PSCs have been restarted
  • VCSA HA is not currently enabled
  • Active Directory is used as the primary auth source
  • I've tried valid creds from Active Directory and the SSO admin account
  • I've verified creds by using a bad password.  The command properly returns the bad password error instead of the Base-64 error in this case.
  • This vCenter instance was deployed as 6.5, not upgraded from a previous version.
  • No errors related to vC are active in vC itself
  • No other configuration errors are currently known
  • Other users have tried executing the command on their systems with the same software versions.  All get the same error.
Reply
0 Kudos
briance71
Contributor
Contributor

Ok, does this error return on other systems with powercli or just yours?

Reply
0 Kudos
LucD
Leadership
Leadership

Did you check the vpxd log if there are any entries related to this?


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

Reply
0 Kudos
korycoronado
Contributor
Contributor

  • Other users have tried executing the command on their systems with the same software versions.  All get the same error.
Reply
0 Kudos
korycoronado
Contributor
Contributor

vpxd.log shows nothing of interest.  No errors, only unrelated info entries during the time frame when i execute the command.

Reply
0 Kudos
LucD
Leadership
Leadership

This type of error mostly indicates an encoding/decoding issue somewhere in the chain?
Do you get similar errors with the Web or HTML5 client?
Do you have the possibility to bypass the Netscaler?


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

Reply
0 Kudos
korycoronado
Contributor
Contributor

I am getting no errors at all in vCenter via either client.  The user/password combo works fine.  Bypassing the netscaler is not trivial.  I'd have to reconfigure the vCenter server to point to a new PSC.  More a political issue than technical.  The netscaler is configured for passthrough and it was working fine up until i updated to the latest powercli version.

Reply
0 Kudos
LucD
Leadership
Leadership

I understand (on the Netscaler).

Perhaps a network trace on the station where you launch the Connect-VIServer cmdlet might shed some light?
Connect from a HTML5 Client and do a Connect-VIServer.
Any obvious differences in what the VCSA returns?


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

Reply
0 Kudos
korycoronado
Contributor
Contributor

Sorry, I don't understand what you mean by "Connect from a HTML5 Client and do a Connect-VIServer".  Can you explain?  I am connecting from the PowerShell ISE.  I am unaware of how to run the commandlet through HTML 5.  Thank you.

Reply
0 Kudos
LucD
Leadership
Leadership

I just mean connect to the vCenter with the Web Client or the HTML5 Client (the web interfaces).
You also need to authenticate for those, just as with Connect-VIServer.


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

Reply
0 Kudos
korycoronado
Contributor
Contributor

I had my networking team take a look at the trace, this is what they see:

I opened the trace in a different software we have that sometimes gives a little more insight and I just saw the same thing.  The client is sending the RST flag to tear down the connection.  I looked into that packets and do not see anything that indicates why it would terminate the session. 

He's referring to the PowerCLI trace.

Reply
0 Kudos