Wrong Number of Arguments for USPS Calculator #53

Open
iloveitaly opened this Issue Jan 13, 2013 · 3 comments

2 participants

@iloveitaly
spree-contrib member

I'm getting an exception when calculating shipping costs for USPS: ArgumentError: wrong number of arguments(1 for 0).

The strange part of this is it doesn't happen all of the time. I can calculate shipping with the same address and same order information: sometimes it happens, sometimes it doesn't.

My thought is it has something to do with shipping calculation threading, but I don't have enough knowledge about threading to pick out where things are going wrong.

active_utils-1.0.5/lib/active_utils/common/posts_data.rb:56→ initialize
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:56→ new
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:56→ new_connection
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:36→ raw_ssl_request
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:30→ ssl_request
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:22→ ssl_get
active_shipping-0.9.14/lib/active_shipping/shipping/carriers/usps.rb:425→ commit
active_shipping-0.9.14/lib/active_shipping/shipping/carriers/usps.rb:176→ us_rates
active_shipping-0.9.14/lib/active_shipping/shipping/carriers/usps.rb:156→ find_rates
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/app/models/spree/calculator/active_shipping/base.rb:90→ retrieve_rates
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/app/models/spree/calculator/active_shipping/base.rb:44→ block in compute
activesupport-3.2.10/lib/active_support/cache.rb:297→ block in fetch
activesupport-3.2.10/lib/active_support/cache.rb:520→ instrument
activesupport-3.2.10/lib/active_support/cache.rb:296→ fetch
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/app/models/spree/calculator/active_shipping/base.rb:39→ compute
spree_core-1.2.3/app/models/spree/order.rb:413→ block (2 levels) in rate_hash

Any help would be much appreciated!

@iloveitaly
spree-contrib member

I've also gotten this with the ups calculator:


active_utils-1.0.5/lib/active_utils/common/posts_data.rb:56→ initialize
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:56→ new
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:56→ new_connection
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:36→ raw_ssl_request
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:30→ ssl_request
active_utils-1.0.5/lib/active_utils/common/posts_data.rb:26→ ssl_post
active_shipping-0.9.14/lib/active_shipping/shipping/carriers/ups.rb:375→ commit
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/lib/spree/active_shipping/ups_override.rb:197→ find_rates
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/app/models/spree/calculator/active_shipping/base.rb:90→ retrieve_rates
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/app/models/spree/calculator/active_shipping/base.rb:44→ block in compute
activesupport-3.2.10/lib/active_support/cache.rb:297→ block in fetch
activesupport-3.2.10/lib/active_support/cache.rb:520→ instrument
activesupport-3.2.10/lib/active_support/cache.rb:296→ fetch
[GEM_ROOT]/bundler/gems/spree_active_shipping-64219139f9b8/app/models/spree/calculator/active_shipping/base.rb:39→ compute
spree_core-1.2.3/app/models/spree/order.rb:413→ block (2 levels) in rate_hash
@jspizziri
spree-contrib member

@iloveitaly, what's the status of this. Was this resolved in the spree project?

@iloveitaly
spree-contrib member

@jspizziri Honestly, I don't remember. For us, somehow it was resolved.

The only thing I can think of is ensuring that all of the UPS configuration settings are set:

Spree::ActiveShipping::Config.set(:ups_login => ENV['UPS_LOGIN'])
Spree::ActiveShipping::Config.set(:ups_password => ENV['UPS_PASSWORD'])
Spree::ActiveShipping::Config.set(:ups_key => ENV['UPS_KEY'])
Spree::ActiveShipping::Config.set(:usps_login => ENV['USPS_LOGIN'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment