I just tried debugging my install and had some error messages fly off:

Notice: Trying to get property of non-object in commerce_fedex_service_rate_order() (line 126 of /home/**/sites/all/modules/commerce_fedex/commerce_fedex.module).
Notice: Trying to get property of non-object in commerce_fedex_service_rate_order() (line 134 of /home/***/beta/sites/all/modules/commerce_fedex/commerce_fedex.module).

And it keeps goin'. Here is the response from FedEx:

stdClass Object
(
    [HighestSeverity] => WARNING
    [Notifications] => stdClass Object
        (
            [Severity] => WARNING
            [Source] => crs
            [Code] => 872
            [Message] => Rating is temporarily unavailable for one or more services:
FIRST_OVERNIGHT; PRIORITY_OVERNIGHT; STANDARD_OVERNIGHT; FEDEX_2_DAY_AM; FEDEX_2_DAY; FEDEX_EXPRESS_SAVER; ; ; ; ; . Please try again later. 
            [LocalizedMessage] => Rating is temporarily unavailable for one or more services:
FIRST_OVERNIGHT; PRIORITY_OVERNIGHT; STANDARD_OVERNIGHT; FEDEX_2_DAY_AM; FEDEX_2_DAY; FEDEX_EXPRESS_SAVER; ; ; ; ; . Please try again later. 

here is a pastin of the entire FedEx SOAP response: http://pastebin.com/924xy2rY if you need all the information returned.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andyg5000’s picture

@mglaman,
It looks like your getting some PHP notices because the 1st rate doesn't contain any rate details. Here's a patch that should ignore the rate service if it's unavailable. If your still having the issue, apply the patch and let me know if it resolves it. You should still be showing rates for GROUND_HOME_DELIVERY even though some others are failing.

mglaman’s picture

Thanks for the patch. I haven't had to apply it as the FedEx service went back up. I will keep this on hand so I can test it next time I run into that issue.

Summit’s picture

Status: Active » Reviewed & tested by the community

Hi shouldn't this patch be applied to get around this situation please?
Greetings, Martijn

Exploratus’s picture

I was getting this error because some of the selected services came back blank. Patch worked perfectly. Lets get this committed. :) its a pretty big and nasty bug.

vegantriathlete’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work

While the patch does prevent the nasty warning messages from appearing, it still doesn't actually handle the error correctly.

I have run into the situation in which FedEx is having a problem quoting some of the services. It's still able to quote other services though.

The issue is that the response object it is now returning looks very different from when there are no errors.

Basically, now the $response object contains $response->RateReplyDetails->RatedShipmentDetails[$key]->ShipmentRateDetail where $key represents each array index. So, there is still data there. The way the patch functions now is that it just totally skips any of the valid data that is returned.

vegantriathlete’s picture

I think that the bigger issue is whether you really want to proceed when FedEx is having problems. Even if you jump through the hoops to figure out how to parse this different response, you will be missing quotes for services you would otherwise provide as options.

vegantriathlete’s picture

It's probably better to check $response->HighestSeverity == 'SUCCESS' and take some appropriate action when it isn't.

Exploratus’s picture

agreed

  • nvahalik committed f3e3298 on 7.x-1.x
    Issue #1866064: Added better handling of API notifications
    Changed...
nvahalik’s picture

Title: Error when FedEx is down » Log Fedex notifications returned via the API
Status: Needs work » Closed (fixed)

This was originally a duplicate of #1935104: Error when fedex is returning only 1 rate. However, the issue turned into a matter of better logging. Updated the title. Also, some basic logging information has been added to -dev. Currently, it's set to ignore NOTE notifications since it seems like those are pretty common. If someone wants to write a patch that handles those as well as allows for configurable logging of API notifications, please do so!