Closed Bug 446327 Opened 16 years ago Closed 16 years ago

WebService faultCode is a string when a script "die"s

Categories

(Bugzilla :: WebService, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Bugzilla 3.0

People

(Reporter: mdonohue, Assigned: mkanat)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_3; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.20
Build Identifier: 3.0.4

This is reported as XMLRPC-154 on the Apache XMLRPC bug tracker.  
(https://issues.apache.org/jira/browse/XMLRPC-154)

This was also reported here as the SECOND part of bug 373300.  The first part of that bug was determined to be invalid, but no comment was made about the second problem reported there, thus I'm opening this bug.

The failure code in the XML reported in bug 373300 is <string>Server</string>  when the failure code ought to be an integer.  I don't know enough about XMLRPC to place the blame with Apache's XMLRPC or with Bugzilla.

I'm still seeing this bug in the 3.0.4 code.  I haven't yet tried the CVS tip.

Reproducible: Always

Steps to Reproduce:
1. See bug 373300

Actual Results:  
faultCode contains the string "Server"

Expected Results:  
faultCode should return one of the Bugzilla::Constants
I took a look at the spec, and it appears Bugzilla is at fault here.  (http://www.xmlrpc.com/spec)
Search for faultCode.  Under the section "Response Format" the faultCode is specified as an int.
The problem is SOAP::Lite. For some reason, XMLRPC::Lite doesn't correctly set one of SOAP::Lite's global variables which says what this error code is.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: webservice faultCode should be an integer → WebService faultCode is a string when a script "die"s
Target Milestone: --- → Bugzilla 3.0
Browsing the SOAP::Lite bug tracker, I don't see any existing or fixed issues filed for the faultCode.  It sounds like you have a better understanding of the fault than I do.
Yeah, I haven't reported the bug yet. It can be fixed locally in Bugzilla, though, and we should definitely do so.
Flags: blocking3.2+
Priority: -- → P1
Attached patch v1Splinter Review
This fixes it. You can test by calling Bug.get(1) (the incorrect syntax).
Assignee: webservice → mkanat
Status: NEW → ASSIGNED
Attachment #334999 - Flags: review?(dkl)
Comment on attachment 334999 [details] [diff] [review]
v1

With the patch applied and calling a method with improper syntax (Bug.get(1)) I get:

FAULT_CODE: -32000
FAULT_STRING: Can't use string ("1") as a HASH ref while "strict refs" in use at /var/www/html/bugzilla/Bugzilla/WebService/Bug.pm line 85.

Without the patch I get:
FAULT_CODE: Server
FAULT_STRING: Can't use string ("966") as a HASH ref while "strict refs" in use at /var/www/html/bugzilla/Bugzilla/WebService/Bug.pm line 85.

So looks good to me.
Dave
Attachment #334999 - Flags: review?(dkl) → review+
Flags: approval3.2+
Flags: approval3.0+
Flags: approval+
tip:

Checking in xmlrpc.cgi;
/cvsroot/mozilla/webtools/bugzilla/xmlrpc.cgi,v  <--  xmlrpc.cgi
new revision: 1.9; previous revision: 1.8
done

3.2:

Checking in xmlrpc.cgi;
/cvsroot/mozilla/webtools/bugzilla/xmlrpc.cgi,v  <--  xmlrpc.cgi
new revision: 1.6.2.3; previous revision: 1.6.2.2
done

3.0:

Checking in xmlrpc.cgi;
/cvsroot/mozilla/webtools/bugzilla/xmlrpc.cgi,v  <--  xmlrpc.cgi
new revision: 1.2.2.2; previous revision: 1.2.2.1
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Fails t/001compile.t:

not ok 64 - xmlrpc.cgi --WARNING
#   Failed test 'xmlrpc.cgi --WARNING'
#   at t/001compile.t line 103.
Name "SOAP::Constants::FAULT_SERVER" used only once: possible typo at xmlrpc.cgi line 34.
Name "XMLRPC::Constants::FAULT_SERVER" used only once: possible typo at xmlrpc.cgi line 37.
xmlrpc.cgi syntax OK
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Nevermind. This generates the warnings on bugzilla-tip but not bugzilla-3.2. Should I file a different bug for the tip?
Flags: needsinfo?(mkanat)
This error appears on tip, 3.2 and 3.0:

http://tinderbox.mozilla.org/showbuilds.cgi?tree=Bugzilla
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Bugzilla3.2
http://tinderbox.mozilla.org/showbuilds.cgi?tree=Bugzilla3.0

No need to file a separate bug. Just attach the bugstage fix here.
Flags: needsinfo?(mkanat)
Attached patch fix bustageSplinter Review
A friend of you (mst on #perl, with whom you had a beer at OSCON), made this suggestion. This fixes the warning.
Attachment #335622 - Flags: review?(mkanat)
Comment on attachment 335622 [details] [diff] [review]
fix bustage

Excellent.
Attachment #335622 - Flags: review?(mkanat) → review+
tip:

Checking in xmlrpc.cgi;
/cvsroot/mozilla/webtools/bugzilla/xmlrpc.cgi,v  <--  xmlrpc.cgi
new revision: 1.10; previous revision: 1.9
done

3.2.rc1:

Checking in xmlrpc.cgi;
/cvsroot/mozilla/webtools/bugzilla/xmlrpc.cgi,v  <--  xmlrpc.cgi
new revision: 1.6.2.4; previous revision: 1.6.2.3
done

3.0.5:

Checking in xmlrpc.cgi;
/cvsroot/mozilla/webtools/bugzilla/xmlrpc.cgi,v  <--  xmlrpc.cgi
new revision: 1.2.2.3; previous revision: 1.2.2.2
done
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.