Try the Demo

Magento Forum

   
Page 1 of 3
How do I debug shipping errors? 
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 

For some reason I am unable to get Fedex rates. I have put in my account ID (a 9 digit number I presume) and when I try to get the estimate I get the following:

This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.

I know this is just an error set in the admin section, but I’d like to know what the real Fedex error is. Where can I find the fedex error so I now why fedex isn’t responding with the rates?

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
joolsr
Sr. Member
 
Total Posts:  99
Joined:  2008-01-16
 

I cant remember where exactly, but if you set it to debug, the errors will appear in the database somewhere.

Hope someone else can help with the details, but its a start ..

Julian

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 

Hmm, this didn’t work

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoeNmass
Member
 
Avatar
Total Posts:  50
Joined:  2008-03-07
 

Check your zip code settings. Only put in 5 digits. i.e. 90210 and not 90210-1234

 
Magento Community Magento Community
Magento Community
Magento Community
 
joolsr
Sr. Member
 
Total Posts:  99
Joined:  2008-01-16
 

yes, i was getting confused. There is a PayPal API debug field in the database, but not one for FedEx.

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 
JoeNmass - 13 May 2008 03:15 PM

Check your zip code settings. Only put in 5 digits. i.e. 90210 and not 90210-1234

I’m actually based in Canada and am using a postal code (note: Fedex is supposed to work in Canada too)

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
JoeNmass
Member
 
Avatar
Total Posts:  50
Joined:  2008-03-07
 

Do you have at least one “Allowed methods” set in the FedEx configuration section??

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 
JoeNmass - 14 May 2008 05:11 PM

Do you have at least one “Allowed methods” set in the FedEx configuration section??

Yes, I have all allowed methods selected. I’ve also made sure that products have a weight on the. Again.. if there was any sort of debug log file that I can look up that would be perfect. It’s extremely hard debugging when I don’t know what the problem could be.

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

In file app/code/core/Mage/Usa/Model/Shipping/Fedex.php approx line 409:

// find:
$responseBody curl_exec($ch);

// add:
Mage::log($responseBody);
Admin > Configuration > Developer > Log Settings > Enabled = Yes

Now watch var/log/system.log and var/log/exception.log for raw information received from fedex during your transactions.

 Signature 

- I would love to change the world, but they won’t give me the source code -

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 

THANK YOU!!!!

Debugging lasted 5 minutes after that! I fixed the problem, though it’s more of a hack. I will report this bug in the “report bug” section.

The error reported by Fedex after I added the snippet from Moshe (which was in system.log, not exceptions.log) said the following

Currency code for Intra CA request must be CAD

This meant that either something was wrong with my configuration or with the currency being sent to Fedex. I checked my configuration and everything was working fine. I then checked what I was sending Fedex by adding the following line to the snippet Moshe gave me

Mage::log($request);

This logs the request. When I looked at my log file I can see it was sending USD as the currency code. That’s odd. So I looked at the same Fedex.php file and wouldn’t you know it.. the following is on line 283

$declaredValue->addChild('CurrencyCode''USD');

YIKES! “USD” is hardcoded in as the CurrencyCode… it should be pulling it from the DB. So I’ve submitted a bug and for now replaced “USD” with “CAD” and all works now! smile

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
joolsr
Sr. Member
 
Total Posts:  99
Joined:  2008-01-16
 

Hi

I had rates I couldnt quite tally up with rates we would normally get, so I checked the file, as yes it does say USD for the Currency Code ! Interestingly, If change it to my desired one, ie GBP , it does work ! Trying EUR as the code works, and returns very slightly different rates to that given at the dollar rate. I still dont think these differences are of the scale of the differences I was seeing, but even so, you’re right its a bug and needs fixing.

Wonder why it doesn’ like our UK Sterling ....

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 

joolsr, when you enter “GBP” what error does FedEx return?

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
joolsr
Sr. Member
 
Total Posts:  99
Joined:  2008-01-16
 

Sorry, when I added GBP it didnt work. I think my post from earlier missed an ‘nt’ after the does !.

In the end, I found the differences between the rates I got back whether using USD, or EUR were pretty much the same, only a very slight difference probably down to exchange rate fluctuations ...

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdumka
Member
 
Avatar
Total Posts:  56
Joined:  2008-02-28
 

Hey Coues

Thanks for the help ... but I still can’t get it working.

I replaced the the line like you said with CAD ... but still no luck.

was this the directory?

magento\app\code\core\Mage\Usa\Model\Shipping\Carrier

Thanks for the help ... it must have taken you a long time to fix.

Mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
coeus
Member
 
Avatar
Total Posts:  39
Joined:  2007-12-15
 

Hey guys, the best thing to do is to follow Moshe’s advice above to have the error message logged in a system.log. Without knowing what the error is it’ll take forever to debug.

@mdumka: The directory for the fedex file is what Moshe wrote (app/code/core/Mage/Usa/Model/Shipping/Fedex.php) ... Please reread his post on how to debug and reread my post right below his. After I learned how to catch shipping error it took me 5 minutes to fix the bug. So know what the actual error says is very important.

 Signature 

Windows XP | WampServer v 2.0 | Apache 2.2.6 | PHP 5.2.5 | MySQL Server 5.0.45

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdumka
Member
 
Avatar
Total Posts:  56
Joined:  2008-02-28
 

Well I will be dammed ... Your fix worked with CAD ... the problem is I was not entering in the postal code. If this is a required field man you cant just spit out the error like that.

Well ... thanks for the help ... I will have to come up with some good error messages.

Dam good work Boys!

Mike

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 1 of 3