Last Comment Bug 446327 - WebService faultCode is a string when a script "die"s
: WebService faultCode is a string when a script "die"s
Status: RESOLVED FIXED
:
Product: Bugzilla
Classification: Server Software
Component: WebService (show other bugs)
: unspecified
: All All
: P1 normal (vote)
: Bugzilla 3.0
Assigned To: Max Kanat-Alexander
: default-qa
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-20 14:36 PDT by Michael Donohue
Modified: 2008-08-26 18:57 PDT (History)
2 users (show)
mkanat: approval+
mkanat: approval3.2+
mkanat: blocking3.2+
mkanat: approval3.0+
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
v1 (996 bytes, patch)
2008-08-21 21:48 PDT, Max Kanat-Alexander
dkl: review+
Details | Diff | Splinter Review
fix bustage (1004 bytes, patch)
2008-08-26 15:28 PDT, Frédéric Buclin
mkanat: review+
Details | Diff | Splinter Review

Description Michael Donohue 2008-07-20 14:36:10 PDT
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
Comment 1 Michael Donohue 2008-07-20 14:43:19 PDT
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.
Comment 2 timeless 2008-07-20 16:16:56 PDT
bug 435507 has changed this code... i believe the relevant code is here:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/webtools/bugzilla/Bugzilla/Error.pm&rev=1.24&mark=104-115#97
Comment 3 Max Kanat-Alexander 2008-07-21 00:19:16 PDT
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.
Comment 4 Michael Donohue 2008-07-22 15:38:03 PDT
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.
Comment 5 Max Kanat-Alexander 2008-07-22 16:29:57 PDT
Yeah, I haven't reported the bug yet. It can be fixed locally in Bugzilla, though, and we should definitely do so.
Comment 6 Max Kanat-Alexander 2008-08-21 21:48:30 PDT
Created attachment 334999 [details] [diff] [review]
v1

This fixes it. You can test by calling Bug.get(1) (the incorrect syntax).
Comment 7 David Lawrence [:dkl] 2008-08-22 09:19:08 PDT
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
Comment 8 Max Kanat-Alexander 2008-08-25 08:43:15 PDT
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
Comment 9 David Lawrence [:dkl] 2008-08-25 22:01:37 PDT
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
Comment 10 David Lawrence [:dkl] 2008-08-25 22:04:08 PDT
Nevermind. This generates the warnings on bugzilla-tip but not bugzilla-3.2. Should I file a different bug for the tip?
Comment 11 Frédéric Buclin 2008-08-25 22:36:18 PDT
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.
Comment 12 Frédéric Buclin 2008-08-26 15:28:17 PDT
Created attachment 335622 [details] [diff] [review]
fix bustage

A friend of you (mst on #perl, with whom you had a beer at OSCON), made this suggestion. This fixes the warning.
Comment 13 Max Kanat-Alexander 2008-08-26 18:45:43 PDT
Comment on attachment 335622 [details] [diff] [review]
fix bustage

Excellent.
Comment 14 Frédéric Buclin 2008-08-26 18:57:10 PDT
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

Note You need to log in before you can comment on or make changes to this bug.