Page 1 of 1

Warning: shipping method required

Posted: Fri Jan 17, 2014 3:32 am
by nvedia
Hi
I am getting "Warning: shipping method required " on Step 4 of the checkout(error happens only sometimes) and have already done the cache:false, checked geozones and everything as per this thread but the issue still remains (deleted teh vqcache, system cache etc)

http://forum.opencart.com/viewtopic.php ... 58#p395258

Since the issue does not happen all the times, I have created an automation script to do checkout automatically and observed that it happens almost once in every 15 times
The issue never happened on another server(did checkout 200+ times )

Strange thing is its only appearing on one server but not on the other(with same code, vqmods,.htaccess etc)

Current version of opencart with issue - 1.5.5.1 (Please do not suggest to upgrade the cart as this would be the last resort and Ia m not sure if it would fix the issue since checkout.tpl etc did not change much from ajax post/get etc :) )

Server with problem -
PHP version 5.2.6

Server where it works fine
PHP Version 5.3.13

Please let me know if any other detail is needed and hope that this thread would help others with the same issue

Since error happens from this block in shipping_method.php, looks like $this->session->data['shipping_methods'] is getting unset

Code: Select all


				if (!isset($shipping[0]) || !isset($shipping[1]) || !isset($this->session->data['shipping_methods'][$shipping[0]]['quote'][$shipping[1]])) {
					$json['error']['warning'] = $this->language->get('error_shipping');
				}


So, I wrote few logging statements to capture both GET and POST requests(index.php) and also print the $this->session->data['shipping_methods'] object

Logs when it works fine

Code: Select all


2014/01/16 07:21:13:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/shipping_method
    [_] => 1389856877052
)
2014/01/16 07:21:13:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:21:13:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/payment_address
    [_] => 1389856877055
)
2014/01/16 07:21:13:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:21:14:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/checkout/country
    [country_id] => 223
    [_] => 1389856877702
)
2014/01/16 07:21:14:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:21:14:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/shipping_address
    [_] => 1389856877790
)
2014/01/16 07:21:14:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:21:15:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/checkout/country
    [country_id] => 223
    [_] => 1389856878673
)
2014/01/16 07:21:15:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:21:16:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/shipping_method/validate
)
2014/01/16 07:21:16:/var/site/public_html/index.php:16: post object from index: Array
(
    [shipping_method] => totalbased.totalbased_2
    [comment] => 
)
2014/01/16 07:21:16:/var/site/public_html/catalog/controller/checkout/shipping_method.php:90 Inside validate of shipping_method.php  

2014/01/16 07:21:16:/var/site/public_html/catalog/controller/checkout/shipping_method.php:142: Shipping object: Array
(
    [totalbased] => Array
        (
            [title] => Total-Based Shipping
            [quote] => Array
                (
                    [totalbased_2] => Array
                        (
                            [id] => totalbased.totalbased_2
                            [code] => totalbased.totalbased_2
                            [title] => International Shipping
                            [cost] => 45.584
                            [tax_class_id] => 9
                            [text] => £45.58
                        )

                )

            [sort_order] => 2
            [error] => 
        )

)



Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 3:37 am
by nvedia
Logs when it doesn't works fine

Code: Select all



2014/01/16 07:20:46:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/shipping_method
    [_] => 1389856850128
)
2014/01/16 07:20:46:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:20:47:/var/site/public_html/index.php:15: get object from index: Array
(
   2014/01/16 07:20:47:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/checkout/country
    [country_id] => 223
   2014/01/16 07:20:48:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/checkout/country
    [country_id] => 223
    [_] => 1389856851493
)
2014/01/16 07:20:48:/var/site/public_html/index.php:16: post object from index: Array
(
)
2014/01/16 07:20:49:/var/site/public_html/index.php:15: get object from index: Array
(
    [route] => checkout/shipping_method/validate
)
2014/01/16 07:20:49:/var/site/public_html/index.php:16: post object from index: Array
(
    [shipping_method] => totalbased.totalbased_2
    [comment] => 
)
2014/01/16 07:20:49:/var/site/public_html/catalog/controller/checkout/shipping_method.php:90 Inside validate of shipping_method.php  

2014/01/16 07:20:49:/var/site/public_html/catalog/controller/checkout/shipping_method.php:145: Shipping object is not set 

As can be seen when it doesn't works fine

GET request for checkout/payment_address and checkout/shipping_address are not called since they are missing in the logs(or did not reach the server)

In what cases request can get lost from browser to server?

Since the same code works on another server, I have a feeling that it has something to do with server(PHP version or something else?)

Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 3:44 am
by cwswebdesign
The original coding for 1.5.5.1 is fine (I have a lot of stores using it). There is a typo somewhere in your config settings (either the shipping module or zones most likely).

DL

Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 3:52 am
by nvedia
cwswebdesign wrote:The original coding for 1.5.5.1 is fine (I have a lot of stores using it). There is a typo somewhere in your config settings (either the shipping module or zones most likely).

DL
Thanks
Can you please give me the specific field to look into?
Also, please note that the same site works on another server(with same code/config files/DB and I ran my tests 200 times so I should have seen this error on another server too if it was config issue)

Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 3:54 am
by pedro1993
Just to confuse things, nvdeia are working with the same client here hehe! I can confirm the config settings (assuming you are talking about the config.php files) are both fine and the shipping module is fine.

The problem has became less intermittent however still exists from time to time. I am slowly beginning to think it is a server issue now. Any thoughts anyone?

Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 4:01 am
by nvedia
Forgot to add in my original post there are following warnings in the system/logs related to cache file not found(which as per my finding are harmless and can be ignored)

Code: Select all

2014-01-14 13:58:25 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389711446) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:01:26 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389711625) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:11:26 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389712227) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:34:55 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389713635) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:37:26 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389713786) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:43:27 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389714147) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:54:56 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389714836) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 14:55:27 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389714867) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 16:23:05 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.store.1389720116) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9
2014-01-14 16:24:50 - PHP Warning:  file_get_contents(/var/site//public_html/system/cache/cache.currency.1389720215) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in /var/site//public_html/system/library/cache.php on line 9


Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 4:48 am
by cwswebdesign
I'm referring to your settings under the module section and if Geo Zones aren't right (they are on a fresh install but no idea of what's gone on with your install).

Are you running a caching mod?

DL

Re: Warning: shipping method required

Posted: Fri Jan 17, 2014 6:12 am
by pedro1993
cwswebdesign wrote:I'm referring to your settings under the module section and if Geo Zones aren't right (they are on a fresh install but no idea of what's gone on with your install).

Are you running a caching mod?

DL
I can confirm that the shipping module settings are all correct, and the Geo Zones have been changed to suit the clients needs. There was a caching extension (the JayG one) but even when it was disabled and the cache (opencart and the jay gilfords caching system) was cleared the error still occurred.

Over time the error has been less prominent so for now we have set up a temporary fall back system if anything goes wrong for the customer and an email containing all the session data and customer details is sent to myself and the store admin.

It is certainly a strange error.

Peter

Re: Warning: shipping method required

Posted: Fri May 23, 2014 8:19 am
by gocreative
FYI, I have this same error with PHP 5.3.3 and OC 1.5.1.3. It also happens about 1 in 15 times, and the only solution is to click "Modify" on the previous checkout step and proceed again. Sometimes that fixes it, sometimes it doesn't, but if you repeat again it normally works.