The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
WebService
P1
normal
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Michael Donohue, Assigned: Max Kanat-Alexander)

Tracking

unspecified
Bugzilla 3.0
Bug Flags:
approval +
approval3.2 +
blocking3.2 +
approval3.0 +

Details

Attachments

(2 attachments)

(Reporter)

Description

9 years ago
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
(Reporter)

Comment 1

9 years ago
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

9 years ago
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
(Assignee)

Comment 3

9 years ago
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
(Reporter)

Comment 4

9 years ago
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.
(Assignee)

Comment 5

9 years ago
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
(Assignee)

Comment 6

9 years ago
Created attachment 334999 [details] [diff] [review]
v1

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+
(Assignee)

Updated

9 years ago
Flags: approval3.2+
Flags: approval3.0+
Flags: approval+
(Assignee)

Comment 8

9 years ago
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
Last Resolved: 9 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)

Comment 11

9 years ago
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)

Comment 12

9 years ago
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.
Attachment #335622 - Flags: review?(mkanat)
(Assignee)

Comment 13

9 years ago
Comment on attachment 335622 [details] [diff] [review]
fix bustage

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

Comment 14

9 years ago
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
Last Resolved: 9 years ago9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.