Red Hat Bugzilla – Bug 968397
CIM clients are sometimes getting HTTP/1.1 501 Not Implemented
Last modified: 2015-03-03 18:06:50 EST
Description of problem:
So I was wondering why simple wbemcli instance enumeration doesn't work on sfcbd but works on Pegasus with the same query. The wbemcli client was getting HTTP/1.1 501 Not Implemented from the server.
So I started debugging sfcbd and grabbed a query from YAWN (basically the same operation on the same class). First I thought the query was malformed but putting the working query in curl I got 501 again. Funny that moving from https to http made it work.
So I started looking in sfcbd sources, added some prints to see what's in the buffer. Eventually it came up that buffer handling in httpAdapter.c:getHdrs() is wrong since for some reason the incoming message was fragmented at the beginning, within the "POST" string that was also being checked to match the expected http command/method.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
$ wbemcli ei -noverify -dx 'https://user:pass@localhost:59890/root/cimv2:LMI_LANEndpoint'
- or -
$ curl -vvv --insecure 'https://user:pass@localhost:59890/root/cimv2:LMI_LANEndpoint' -H 'Content-type: application/xml; charset="utf-8"' -H 'CIMOperation: MethodCall' -H 'CIMMethod: EnumerateInstances' -H 'CIMObject: root/cimv2' -H 'Accept-Encoding: identity' -d '<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0"><MESSAGE ID="1001" PROTOCOLVERSION="1.0"><SIMPLEREQ><IMETHODCALL NAME="EnumerateInstances"><LOCALNAMESPACEPATH><NAMESPACE NAME="root"/><NAMESPACE NAME="cimv2"/></LOCALNAMESPACEPATH><IPARAMVALUE NAME="ClassName"><CLASSNAME NAME="LMI_LANEndpoint"/></IPARAMVALUE><IPARAMVALUE NAME="LocalOnly"><VALUE>FALSE</VALUE></IPARAMVALUE></IMETHODCALL></SIMPLEREQ></MESSAGE></CIM>'
* About to connect() to localhost port 59890 (#0)
* Trying ::1...
* Connected to localhost (::1) port 59890 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
* subject: Eemail@example.com,CN=localhost.localdomain
* start date: May 16 14:38:45 2013 GMT
* expire date: May 16 14:38:45 2014 GMT
* common name: localhost.localdomain
* issuer: Efirstname.lastname@example.org,CN=localhost.localdomain
* Server auth using Basic with user 'root'
> POST /root/cimv2:LMI_LANEndpoint HTTP/1.1
> Authorization: Basic cm9vdDpoZXNsbw==
> User-Agent: curl/7.29.0
> Host: localhost:59890
> Accept: */*
> Content-type: application/xml; charset="utf-8"
> CIMOperation: MethodCall
> CIMMethod: EnumerateInstances
> CIMObject: root/cimv2
> Accept-Encoding: identity
> Content-Length: 445
* upload completely sent off: 445 out of 445 bytes
< HTTP/1.1 501 Not Implemented
< Server: sfcHttpd
< Content-Length: 0
* Connection #0 to host localhost left intact
Created attachment 754458 [details]
httpAdapter: Check for cmd in whole buffer
The commRead() call may return data not always aligned to newlines,
in fact data are typically fragmented for https connection. The test
for "cmd" presence in headers may actually end up checking shorter
buffer than the string itself, resulting in immediate error return
instead of waiting for next chunk.
sblim-sfcb-1.3.16-7.fc19 has been submitted as an update for Fedora 19.
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing sblim-sfcb-1.3.16-7.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
sblim-sfcb-1.3.16-7.fc19 has been pushed to the Fedora 19 stable repository. If problems still persist, please make note of it in this bug report.