Closed jphat closed 6 years ago
Hello @jphat , thank you for your report. I cannot reproduce this issue on clean 2.2.4 magento installation. Please use https://github.com/magento/data-migration-tool/issues to report issues related to migration from magento 1.x to 2.x.
Magento's errorProcessor.process(response);
should be coded to deal with an empty response. The error above is misleading. The API actually returned an empty response here. errorProcessor is trying to read it as json. It should check if the response is not empty first.
This error is coming from the fail() section of this code block in new-address.js
storage.post(
serviceUrl, payload, false
).done(function (result) {
rateRegistry.set(address.getCacheKey(), result);
shippingService.setShippingRates(result);
}).fail(function (response) {
shippingService.setShippingRates([]);
errorProcessor.process(response);
}).always(function () {
shippingService.isLoading(false);
});
Preconditions
Steps to reproduce
Expected result
Actual result
POST http://store.local/rest/default/V1/guest-carts/9a2b6352e8634b961ca6843c5fa45b4a/estimate-shipping-methods 500 (Internal Server Error)
Uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at Object.process (error-processor.js:28) at Object.<anonymous> (new-address.js:82) at fire (jquery.js:3232) at Object.fireWith [as rejectWith] (jquery.js:3362) at done (jquery.js:9842) at XMLHttpRequest.callback (jquery.js:10311)
PHP Fatal error: Uncaught Error: Call to a member function getCheckoutFields() on array in /home/mage/store/vendor/temando/module-shipping-m2/Observer/SaveCheckoutFieldsObserver.php:73\nStack trace:\n#0 /home/mage/store/vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): Temando\\Shipping\\Observer\\SaveCheckoutFieldsObserver->execute(Object(Magento\\Framework\\Event\\Observer))\n#1 /home/mage/store/vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): Magento\\Framework\\Event\\Invoker\\InvokerDefault->_callObserverMethod(Object(Temando\\Shipping\\Observer\\SaveCheckoutFieldsObserver), Object(Magento\\Framework\\Event\\Observer))\n#2 /home/mage/store/vendor/magento/framework/Event/Manager.php(66): Magento\\Framework\\Event\\Invoker\\InvokerDefault->dispatch(Array, Object(Magento\\Framework\\Event\\Observer))\n#3 /home/mage/store/generated/code/Magento/Framework/Event/Manager/Proxy.php(95): Magento\\Framework\\Event\\Manager->dispatch('sales_quote_add...', Array)\n#4 /home/mage/store/vendor/magento/framework/Model/AbstractModel.php(818): Magento\\Fra in /home/mage/store/vendor/temando/module-shipping-m2/Observer/SaveCheckoutFieldsObserver.php on line 73, referer: http://store.local/checkout/
any help would be greatly appreciated