Closed Bug 534611 Opened 15 years ago Closed 15 years ago

Error in function fix_time while trying to get an attachment

Categories

(Webtools Graveyard :: BzAPI, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adrianocola, Assigned: gerv)

Details

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10 Build Identifier: 0.3 The error happens when I try to get and attachment on my custom instalation of the bzapi poiting to a custom instalation of the bugzilla. Viewing the logs I realized that the problem was at line 440 of the file Utils.pm. This lines makes the call to the function fix_time passing as parameter the field "last_change_time" of the attachment. So I commented this line to see if the GET would work, After commenting this line the GET worket, but it didn't returned the field "last_change_time" in the body of the attachment. Making the same request to the bzapi of the staging server returned the field! Error log to the GET request at "http://192.168.26.134:8080/attachment/1" Dec 14 11:45:01 [ERROR] Caught exception in Bugzilla::API::Controller::Attachment->one_attachment "The 'epoch' parameter (undef) to DateTime::from_epoch did not pass regex check at /usr/local/lib/perl/5.10.0/DateTime.pm line 457 DateTime::from_epoch(undef, 'epoch', undef) called at /var/www/bzapi/script/../lib/Bugzilla/API/Model/Utils.pm line 569 Bugzilla::API::Model::Utils::fix_time('Bugzilla::API=HASH(0xaaa4b20)', 'HASH(0xafb87e8)', 'last_change_time') called at /var/www/bzapi/script/../lib/Bugzilla/API/Model/Utils.pm line 440 Bugzilla::API::Model::Utils::fixup_xml_bug('Bugzilla::API=HASH(0xaaa4b20)', 'HASH(0xafbc5f0)') called at /var/www/bzapi/script/../lib/Bugzilla/API/Model/Bug.pm line 295 ... Reproducible: Always Actual Results: Bugzilla error page, no data returned. Expected Results: Requested attachment details Ubuntu 9.10 Perl 5.10 Bugzilla 3.4.4
Hi Adriano, Thank you for all these bug reports. They are very helpful. For some reason, str2time() must be failing on your time. I have changed the code in 0.4 to be more robust, and when str2time() fails, it returns the original value, with a note that str2time has failed. Please try again with version 0.4, when it is released (soon now) and add a comment giving the last_change_time which you get back from this API call. Thanks :-) Gerv
Hi Gerv! Updated to version 0.4 and now I receive the field last_change_time with the GET request! Received the value "2009-12-17T17:54:23Z" Thanks again for the support! =D
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.