Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Guzzle/Guzzle #65

Closed
oempire opened this issue Apr 3, 2017 · 8 comments
Closed

Guzzle/Guzzle #65

oempire opened this issue Apr 3, 2017 · 8 comments

Comments

@oempire
Copy link

oempire commented Apr 3, 2017

will you be updating to remove its requirement on Guzzle/guzzle? as it is depreciated now?

im getting this error any idea?

2017-04-03T17:10:06+00:00 ERR (3):
Guzzle\Http\Exception\ClientErrorResponseException: Client error response
[status code] 404
[reason phrase] Not Found
[url] https://digitalapi.auspost.com.au/postage/parcel/domestic/service?from_postcode=3033&to_postcode=2320&length=20&width=20&height=20&weight=31.5 in /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43
Stack trace:

@chnorton
Copy link
Member

chnorton commented Apr 4, 2017

The error isn't related to the version of the Guzzle library being used. When I run the same code I get the following content in the 404 response:

{ "error": { "errorMessage": "The maximum weight of a parcel is 22 kg." } }

Unfortunately this is part of Australia Post's service so there's not much we can do about this limit.

@oempire
Copy link
Author

oempire commented Apr 7, 2017

Ahh sorry bad example from the log. having problems getting a rate from

postcode 3033 to postcode 0850 with a weight of 6 KG.

im only seeing this error from the exception.log

on the front end there is literally nothing returned.

Interestingly if i go to 2320 (not 0850) i get a result.

Is there a way to see a better error log, as the exception.log would indicate to me a guzzle issue?

2017-04-07T08:27:33+00:00 ERR (3):
Guzzle\Http\Exception\ClientErrorResponseException: Client error response
[status code] 404
[reason phrase] Not Found
[url] https://digitalapi.auspost.com.au/postage/parcel/domestic/service?from_postcode=3033&to_postcode=850&length=20&width=20&height=20&weight=6 in /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Exception/BadResponseException.php:43
Stack trace:
#0 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(145): Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\Request), Object(Guzzle\Http\Message\Response))
#1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#2 /home/globalgs/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php(184): call_user_func(Array, Object(Guzzle\Common\Event), 'request.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 /home/globalgs/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'request.error', Object(Guzzle\Common\Event))
#4 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(589): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('request.error', Object(Guzzle\Common\Event))
#5 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Message/Request.php(378): Guzzle\Http\Message\Request->processResponse(Array)
#6 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(302): Guzzle\Http\Message\Request->setState('complete', Array)
#7 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(257): Guzzle\Http\Curl\CurlMulti->processResponse(Object(Guzzle\Http\Message\Request), Object(Guzzle\Http\Curl\CurlHandle), Array)
#8 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(240): Guzzle\Http\Curl\CurlMulti->processMessages()
#9 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(224): Guzzle\Http\Curl\CurlMulti->executeHandles()
#10 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php(111): Guzzle\Http\Curl\CurlMulti->perform()
#11 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Curl/CurlMultiProxy.php(94): Guzzle\Http\Curl\CurlMulti->send()
#12 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Http/Client.php(284): Guzzle\Http\Curl\CurlMultiProxy->send()
#13 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(136): Guzzle\Http\Client->send(Object(Guzzle\Http\Message\Request))
#14 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(153): Guzzle\Service\Client->execute(Object(Guzzle\Service\Command\OperationCommand))
#15 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(189): Guzzle\Service\Command\AbstractCommand->execute()
#16 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(76): Guzzle\Service\Command\AbstractCommand->getResult()
#17 /home/globalgs/public_html/vendor/fontis/australia/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(138): Guzzle\Service\Client->__call('listDomesticPar...', Array)
#18 /home/globalgs/public_html/vendor/fontis/australia/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(123): Fontis_Australia_Model_Shipping_Carrier_Australiapost->_getQuotes(5000, Array)
#19 /home/globalgs/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(209): Fontis_Australia_Model_Shipping_Carrier_Australiapost->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#20 /home/globalgs/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(129): Mage_Shipping_Model_Shipping->collectCarrierRates('australiapost', Object(Mage_Shipping_Model_Rate_Request))
#21 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(944): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#22 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(875): Mage_Sales_Model_Quote_Address->requestShippingRates()
#23 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php(155): Mage_Sales_Model_Quote_Address->collectShippingRates()
#24 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(1013): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#25 /home/globalgs/public_html/app/code/local/Mage/Sales/Model/Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#26 /home/globalgs/public_html/app/code/core/Mage/Checkout/Model/Cart.php(461): Mage_Sales_Model_Quote->collectTotals()
#27 /home/globalgs/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(161): Mage_Checkout_Model_Cart->save()
#28 /home/globalgs/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->indexAction()
#29 /home/globalgs/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#30 /home/globalgs/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#31 /home/globalgs/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#32 /home/globalgs/public_html/app/Mage.php(691): Mage_Core_Model_App->run(Array)
#33 /home/globalgs/public_html/index.php(83): Mage::run('', 'store')
#34 {main}

@chnorton
Copy link
Member

chnorton commented Apr 7, 2017

I tested the URL directly again and got this:

{ "error": { "errorMessage": "Please enter a valid To postcode." } }

It seems to be a problem with the postcode being "0850", which appears to get converted to "850" somewhere. This is most likely a bug somewhere in the extension itself, rather than with the use of the older Guzzle version.

I will take a look soon and update this issue once I have more info.

@oempire
Copy link
Author

oempire commented Apr 23, 2017

Hi, Have you had any luck with this at all?

@chnorton
Copy link
Member

The latest release includes a fix for this. Hopefully that resolves it for you - let us know if there are any other problems.

@oempire
Copy link
Author

oempire commented May 1, 2017

Hi, unfortunately no fix it seems. getting this error in exception log

2017-05-01T14:30:42+00:00 ERR (3):
Guzzle\Service\Exception\ValidationException: Validation errors: [from_postcode] must be of type integer
[to_postcode] must be of type integer in /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php:357
Stack trace:
#0 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(236): Guzzle\Service\Command\AbstractCommand->validate()
#1 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(205): Guzzle\Service\Command\AbstractCommand->prepare()
#2 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(136): Guzzle\Service\Client->prepareCommand(Object(Guzzle\Service\Command\OperationCommand))
#3 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(153): Guzzle\Service\Client->execute(Object(Guzzle\Service\Command\OperationCommand))
#4 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Command/AbstractCommand.php(189): Guzzle\Service\Command\AbstractCommand->execute()
#5 /home/globalgs/public_html/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php(76): Guzzle\Service\Command\AbstractCommand->getResult()
#6 /home/globalgs/public_html/vendor/fontis/australia/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(140): Guzzle\Service\Client->__call('listDomesticPar...', Array)
#7 /home/globalgs/public_html/vendor/fontis/australia/src/app/code/community/Fontis/Australia/Model/Shipping/Carrier/Australiapost.php(125): Fontis_Australia_Model_Shipping_Carrier_Australiapost->_getQuotes(5000, Array)
#8 /home/globalgs/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(209): Fontis_Australia_Model_Shipping_Carrier_Australiapost->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#9 /home/globalgs/public_html/app/code/community/Unirgy/Dropship/Helper/Protected.php(569): Mage_Shipping_Model_Shipping->collectCarrierRates('australiapost', Object(Mage_Shipping_Model_Rate_Request))
#10 /home/globalgs/public_html/app/code/community/Unirgy/Dropship/Model/Carrier.php(163): Unirgy_Dropship_Helper_Protected->collectVendorCarrierRates(Object(Mage_Shipping_Model_Rate_Request))
#11 /home/globalgs/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(209): Unirgy_Dropship_Model_Carrier->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#12 /home/globalgs/public_html/app/code/core/Mage/Shipping/Model/Shipping.php(129): Mage_Shipping_Model_Shipping->collectCarrierRates('udropship', Object(Mage_Shipping_Model_Rate_Request))
#13 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(944): Mage_Shipping_Model_Shipping->collectRates(Object(Mage_Shipping_Model_Rate_Request))
#14 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(875): Mage_Sales_Model_Quote_Address->requestShippingRates()
#15 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php(155): Mage_Sales_Model_Quote_Address->collectShippingRates()
#16 /home/globalgs/public_html/app/code/core/Mage/Sales/Model/Quote/Address.php(1013): Mage_Sales_Model_Quote_Address_Total_Shipping->collect(Object(Mage_Sales_Model_Quote_Address))
#17 /home/globalgs/public_html/app/code/local/Mage/Sales/Model/Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#18 /home/globalgs/public_html/app/code/core/Mage/Checkout/Model/Cart.php(461): Mage_Sales_Model_Quote->collectTotals()
#19 /home/globalgs/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(478): Mage_Checkout_Model_Cart->save()
#20 /home/globalgs/public_html/app/code/core/Mage/Checkout/controllers/CartController.php(446): Mage_Checkout_CartController->_updateShoppingCart()
#21 /home/globalgs/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->updatePostAction()
#22 /home/globalgs/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('updatePost')
#23 /home/globalgs/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#24 /home/globalgs/public_html/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#25 /home/globalgs/public_html/app/Mage.php(691): Mage_Core_Model_App->run(Array)
#26 /home/globalgs/public_html/index.php(83): Mage::run('', 'store')
#27 {main}

@chnorton
Copy link
Member

chnorton commented May 2, 2017

This seems to be a problem with the auspost-php-sdk library. We've just pushed an update that will hopefully address this - could you try updating to 1.0.5 and see if that helps?

composer update fontis/auspost-api-php

@chnorton chnorton reopened this May 2, 2017
@oempire
Copy link
Author

oempire commented May 12, 2017

Hi confirmed this has resolved the issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants