tomatonetwork Posted June 6, 2016 Share Posted June 6, 2016 Hi, I've upgraded from CubeCart 5 to the latest verison of 6 and had no problems when it was running on MAMP. Now I've moved to my live server I'm getting the following message Fatal error: Call to a member function setError() on null in /usr/local/www/sitename/classes/admin.class.php on line 393 I get this when logging in with the correct login details but a 500 error when using the wrong details. Any help would be greatly appreciated. Sam Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted June 6, 2016 Share Posted June 6, 2016 Hi tomatonetwork! Welcome to the forums. I'm sorry, but I'm not one who can help with this. Hopefully @bsmither will be along shortly, or perhaps @havenswift-hosting. They have the skills to be of help with this. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 6, 2016 Author Share Posted June 6, 2016 Thanks @Dirty Butter Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 6, 2016 Share Posted June 6, 2016 I am thinking somewhere along the way, when CubeCart admin is waking up with a user/pass, part of that process is to engage the GUI (technically, instantiate the GUI class). The first thing the GUI wants to do when instantiated is get a fresh list of installed skins and assign a bunch of data to the template rendering engine (Smarty). When the Admin _authenticate() function can't find a valid user/pass, it will want to give to the GUI a message about "wrong username or password". If the GUI went away because of a problem, or never did instantiate, then the above will be the PHP Fatal Error logged. A fatal error is..., well..., fatal. So, we need to determine if the GUI went away or had a problem getting instantiated. To do so, we need to look at PHP's error_log. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 7, 2016 Author Share Posted June 7, 2016 Hi, Slightly wrong on my first post. In the logs we get this on a wrong password: [Tue Jun 07 11:22:27.833195 2016] [:error] [pid 19926:tid 35106422784] [client 31.205.51.193:50022] PHP Fatal error: Call to a member function setError() on null in /usr/local/www/www.sitename.co.uk/classes/admin.class.php on line 393, referer: http://www.sitename.co.uk/admin.php On correct password we just get a screen refresh. there is nothing else in the PHP log. Sam Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 7, 2016 Share Posted June 7, 2016 If you know how, please have your browser show you CubeCart's cookie being received and set, and then the cookie the browser sends back to CubeCart. Hopefully, the browser does send the cookie back. Then, you will need to determine how the PHP on the live server is managing sessions. With respect to CubeCart, if the cookie is wrong or missing, or if PHP cannot record a session (a few ways to do this) based on that cookie, then you won't be getting into the admin. On a related note, on the storefront, place an item in the basket then go to View Cart. Are the item(s) still in the cart? The error message above does not look familiar. It seems to be a variation of the standard web server's error log when PHP is being controlled by Apache's mod_php, as opposed to PHP being a stand-alone FastCGI. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 Hi @bsmither Items do not stay in the cart and we get the following error: substr() expects parameter 3 to be long, string given in /usr/local/www/www.sitename.co.uk/classes/catalogue.class.php on line 1292 Our server is running FreeBSD with the following PHP extensions: mod_php56-5.6.22 PHP Scripting Languagephp56-5.6.22 PHP Scripting Languagephp56-ctype-5.6.22 The ctype shared extension for phpphp56-curl-5.6.22 The curl shared extension for phpphp56-filter-5.6.22 The filter shared extension for phpphp56-gd-5.6.22 The gd shared extension for phpphp56-hash-5.6.22 The hash shared extension for phpphp56-json-5.6.22 The json shared extension for phpphp56-mbstring-5.6.22 The mbstring shared extension for phpphp56-mysql-5.6.22 The mysql shared extension for phpphp56-mysqli-5.6.22 The mysqli shared extension for phpphp56-openssl-5.6.22 The openssl shared extension for phpphp56-session-5.6.22 The session shared extension for phpphp56-simplexml-5.6.22 The simplexml shared extension for phpphp56-xml-5.6.22 The xml shared extension for phpphp56-xmlwriter-5.6.22 The xmlwriter shared extension for phpphp56-zip-5.6.22 The zip shared extension for phpphp56-zlib-5.6.22 The zlib shared extension for php Thanks Sam Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 9, 2016 Share Posted June 9, 2016 The above error suggests to me that in CubeCart's admin, Store Settings, Layout tab, "Length of product precis" has a value that does not look like a number. I think this is not a Fatal Error, so I believe this is not the cause of your server environment not maintaining a session state. Google will have some forum discussions at the top of its results from this search, freebsd php session support. From reading those conversations, especially this one, I think some configuration of your FreeBSD environment may be necessary. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 Hi, Here are the current settings: session.auto_start => Off => Off session.cache_expire => 180 => 180 session.cache_limiter => nocache => nocache session.cookie_domain => no value => no value session.cookie_httponly => Off => Off session.cookie_lifetime => 0 => 0 session.cookie_path => / => / session.cookie_secure => Off => Off session.entropy_file => /dev/urandom => /dev/urandom session.entropy_length => 32 => 32 session.gc_divisor => 1000 => 1000 session.gc_maxlifetime => 1440 => 1440 session.gc_probability => 1 => 1 session.hash_bits_per_character => 5 => 5 session.hash_function => 0 => 0 session.name => PHPSESSID => PHPSESSID session.referer_check => no value => no value session.save_handler => files => files session.save_path => no value => no value session.serialize_handler => php => php session.upload_progress.cleanup => On => On session.upload_progress.enabled => On => On session.upload_progress.freq => 1% => 1% session.upload_progress.min_freq => 1 => 1 session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS session.upload_progress.prefix => upload_progress => upload_progress session.use_cookies => On => On session.use_only_cookies => On => On session.use_strict_mode => Off => Off session.use_trans_sid => 0 => 0 We are overriding the session path in ini-custom.inc.php with session_save_path(CC_ROOT_DIR.'/sessions'); session files are being persisted there. Also here are our Loaded Apache Modules, apache set to use SESSION_COOKIE. core_module (static) so_module (static) http_module (static) access_compat_module (shared) authz_core_module (shared) authn_file_module (shared) authz_host_module (shared) authn_core_module (shared) auth_basic_module (shared) authz_user_module (shared) cgi_module (shared) reqtimeout_module (shared) filter_module (shared) mime_module (shared) log_config_module (shared) unixd_module (shared) dir_module (shared) alias_module (shared) ssl_module (shared) rewrite_module (shared) headers_module (shared) socache_shmcb_module (shared) deflate_module (shared) mpm_worker_module (shared) php5_module (shared) Thanks Sam Also attached config from web server Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 9, 2016 Share Posted June 9, 2016 Nothing looks strange or problematic, and you say session files are showing up in CC_ROOT_DIR/sessions. So, obvious questions: Does the folder/file permissions allow for Apache/PHP to read these files? Is Apache/PHP receiving the cookie from the browser client? The table above suggests that Cookies are enabled, so however you got the above table, scroll to the PHP Variables table and look for _SERVER["HTTP_COOKIE"]. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 Hey guys, Sam opened an internal ticket and I've been looking into this too. Thanks Brian for all your help here.. fantastic help as always! A var_dump in the _authenticate method (in the admin class) of $GLOBALS['gui'] returns null. To check other objects a var_dump of $GLOBALS['db'] WAS there. We are losing the gui class for some reason. Just to test I cloned the store locally and it worked as expected. I'm really struggling to get to the bottom of this. CubeCart has seen compatibility issues with other operating systems. For example Solaris can't work with the braces of the PHP glob function used in CubeCart. .... I just don't know how to debug this. Does the web server log tell us anything at all? Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 Hi, Cookie as received by Apache: HTTP_COOKIE utma=69724425.942590399.1463602409.1463744022.1464346411.5; utmz=69724425.1463602409.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) Sam Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 Oddly.. on login fail the autoloader classes are not all initiated. The lists below show the classes autoloaded prior to error in order. On the broken store: Cache Database Config Debug Sanitize Session Admin Password Fatal error: Call to a member function setError() on null in /usr/local/www/www.xxx.co.uk/classes/admin.class.php on line 396 On the cloned store (working on OSX MAMP): Cache Database Config Debug Sanitize SessionSmarty Smarty_Internal_Data Language HookLoader GUI Smarty_Internal_Method_GetTemplateVars Smarty_Undefined_Variable SEO SSL Catalogue ACP Admin Password Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 Apparently spl_autoload_functions exist and I can see the SPL section of PHP info. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 Hi Al, We managed to progress past the issue by commenting out: // session_name('CCS_'.strtoupper(substr(md5(ROOT_REL), 0,10))); Now shows the GUI. We have another lot of errors to work through though. Sam Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 These is my SPL classes: From splmax yours also has. SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException I'm getting out my depth here a bit. 2 minutes ago, tomatonetwork said: Hi Al, We managed to progress past the issue by commenting out: // session_name('CCS_'.strtoupper(substr(md5(ROOT_REL), 0,10))); Now shows the GUI. We have another lot of errors to work through though. Sam Ok maybe I am barking up the wrong tree entirely or there is more than one issue. What other errors do you see? Please note that only "Fatal" errors are of real significance. Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 9, 2016 Share Posted June 9, 2016 I think a lot more would be missing if the classes listed in red were actually not getting instantiated. "Cookie as received by Apache" The cookie PHPSESSID, later changed to CCS_A7865DF9A9, is not being received. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 2 minutes ago, bsmither said: I think a lot more would be missing if the classes listed in red were actually not getting instantiated. "Cookie as received by Apache" The cookie PHPSESSID, later changed to CCS_A7865DF9A9, is not being received. good point! Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 It looks like the cookie domain isn't set properly "cookie_domain" do you know where it's set in the config? Sam Was set to: $cookie_domain = '.sitename'; ini_set('session.cookie_domain',$cookie_domain); Manually set to: $cookie_domain = '.sitename.co.uk'; ini_set('session.cookie_domain',$cookie_domain); Now all working. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 It's set from within the admin control panel under the SSL tab of the stores settings. You could always hard code the value into line 88 of classes/session.class.php Find: $cookie_domain = $GLOBALS['config']->get('config', 'cookie_domain'); Replace with: $cookie_domain = '.example.com'; Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 Fixed We just have these errors on checkout now: Notice: Error: Hook 'Google_Checkout/hooks/class.cubecart.display_gateways.php' was not found in /usr/local/www/www.hearts-delight.co.uk/classes/hookloader.class.php on line 288Notice: Error: Hook 'Google_Checkout/hooks/class.cubecart.display_basket.alternate.php' was not found in /usr/local/www/www.hearts-delight.co.uk/classes/hookloader.class.php on line 288 Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 They are just notices that can be ignored. They won't show when error reporting is off. To fix it make sure the hooks for Google Checkout are deleted in the "Manage Hooks" section of the admin control panel. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 Hi Al, We'll disable error reporting. But I don't actually have Google Checkout in hooks. Sam Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 9, 2016 Share Posted June 9, 2016 In the "Maintenance" section go to "Query Database" then run: DELETE FROM `cc_CubeCart_hooks` WHERE `plugin` = 'Google_Checkout'; Your database tables are prefixed with cc_ so that should work. Quote Link to comment Share on other sites More sharing options...
tomatonetwork Posted June 9, 2016 Author Share Posted June 9, 2016 All done, thanks for your help @Al Brookbanks @bsmither Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.