Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ServerFaultCode: The operation is not supported on the object" #952

Closed
bradfitz opened this issue Dec 11, 2017 · 6 comments
Closed

"ServerFaultCode: The operation is not supported on the object" #952

bradfitz opened this issue Dec 11, 2017 · 6 comments

Comments

@bradfitz
Copy link
Contributor

I've used govc successfully in the past, and I have production jobs using it regularly, but today I'm trying to use govc with my homelab cluster, which it doesn't seem to like:

bard:~ $ govc ls
govc: ServerFaultCode: The operation is not supported on the object.
bard:~ $ govc about
govc: ServerFaultCode: The operation is not supported on the object.

Does that mean my VMUG EVALExperience license for my 3-node vSphere + vCenter HA setup doesn't include API access?

If so, can we get a better error message in govc telling users what the actual problem is?

Or do I need to enable the API server in vCenter somewhere? I've only ever worked with vSphere clusters others have created before. This home one is the first I've put together, and perhaps I screwed it up.

Sorry for the noob questions.

Thanks!

@dougm
Copy link
Member

dougm commented Dec 11, 2017

Hey Brad, I haven't used the vmug license before, I'll have to look into it.

Can you check if your license has the vimapi feature enabled:

% govc license.ls -json -feature vimapi | jq .[].EditionKey
"esx.enterprisePlus.cpuPackage"

And share your edition keys if it doesn't (will help me track down this licence):

% govc license.ls -json | jq .[].EditionKey
"eval"
"esx.enterprisePlus.cpuPackage"
"vc.standard.instance"

@dougm
Copy link
Member

dougm commented Dec 11, 2017

Then again, if govc about fails, you likely can't collect the license properties either.

@bradfitz
Copy link
Contributor Author

bradfitz commented Dec 11, 2017

Yeah,

bard:~ $ govc license.ls -json -feature vimapi
govc: ServerFaultCode: The operation is not supported on the object.

bard:~ $ govc license.ls -json
govc: ServerFaultCode: The operation is not supported on the object.

Maybe I need to add more VMUG licenses or something.

But considering that I was able to set up an HA vCenter configuration, I'd be surprised if there was a license that allowed HA but did not also include API access.

@dougm
Copy link
Member

dougm commented Dec 11, 2017

Looking at this list: https://www.vmug.com/Join/EVALExperience

"VMware vSphere® ESXi Enterprise Plus with Operations Management™" should work if you assign it to your ESX hosts.

Normally the "eval" license that is included in the default install allows API access (until the eval expires). I use this script to assign licenses: /~https://github.com/vmware/govmomi/blob/master/scripts/vcsa/README.md#licenses

@bradfitz
Copy link
Contributor Author

I had a giant reply written here with all my debugging steps, but then as I was reading through the HTTP requests & responses from the -debug flag's output to ~/.govmomi/debug, I kept setting <userName>bradfitz</userName> instead of my actual username brad@vsphere.xxx.com.

Whoops--- I had GOVC_USER set in my environment, not GOVC_USERNAME.

Sigh.

Sorry.

But a nicer error message would be nice, if such a thing is possible.

But the API server doesn't give you much to work with:

bard:~ $ cat /home/bradfitz/.govmomi/debug/2017-12-11T14-55-17.547742701/1-0002.req.headers ; echo
POST /sdk HTTP/1.1
Host: 10.0.0.150:443
Content-Type: text/xml; charset="utf-8"
Soapaction: urn:vim25/6.5
User-Agent: govc/0.16.1

bard:~ $ cat /home/bradfitz/.govmomi/debug/2017-12-11T14-55-17.547742701/1-0002.req.xml; echo
<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header></Header><Body><AcquireLocalTicket xmlns="urn:vim25"><_this type="SessionManager">SessionManager</_this><userName>bradfitz</userName></AcquireLocalTicket></Body></Envelope>

bard:~ $ cat /home/bradfitz/.govmomi/debug/2017-12-11T14-55-17.547742701/1-0002.res.headers ; echo
HTTP/1.1 500 Internal Server Error
Content-Length: 566
Cache-Control: no-cache
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
Date: Mon, 11 Dec 2017 22:55:17 GMT
X-Frame-Options: DENY

bard:~ $ cat /home/bradfitz/.govmomi/debug/2017-12-11T14-55-17.547742701/1-0002.res.xml ; echo
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring>The operation is not supported on the object.</faultstring><detail><NotSupportedFault xmlns="urn:vim25" xsi:type="NotSupported"></NotSupportedFault></detail></soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

dougm added a commit to dougm/govmomi that referenced this issue Dec 11, 2017
If no username is provided, the govc client tries to acquire a local ticket.
When invoked remotely, ESX returns an InvalidRequestFault (VC returns NotSupportedFault).
So, rather than return an error here, fallthrough to Login() with the original User to
to avoid what would be a confusing error message.

Don't try AcquireLocalTicket at all against vCenter as it is unsupported.

Fixes vmware#952
@dougm
Copy link
Member

dougm commented Dec 11, 2017

Argh, sorry Brad, this confusion is govc's fault. Fixed in #955 so the error message in this case will be:

govc: ServerFaultCode: Cannot complete login due to an incorrect user name or password.

dougm added a commit to dougm/govmomi that referenced this issue Dec 11, 2017
If no username is provided, the govc client tries to acquire a local ticket.
When invoked remotely, ESX returns an InvalidRequestFault (VC returns NotSupportedFault).
So, rather than return an error here, fallthrough to Login() with the original User to
to avoid what would be a confusing error message.

Don't try AcquireLocalTicket at all against vCenter as it is unsupported.

Fixes vmware#952
dougm added a commit that referenced this issue Dec 12, 2017
If no username is provided, the govc client tries to acquire a local ticket.
When invoked remotely, ESX returns an InvalidRequestFault.
So, rather than return an error here, fallthrough to Login() with the original User to
to avoid what would be a confusing error message.

Don't try AcquireLocalTicket at all against vCenter as it is unsupported.

Fixes #952
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants