Jump to content

cannot login to admin panel after upgrade


Recommended Posts

today we upgraded our website to Cubecart 6.1 from 5.2. I had to do it multiple times, but each time I got into the same issues.

I cannot log into the admin page. the password and user name seems to be fine, as it does not complain. it just stay at the same page.

Not sure if it helps, the website seems to work but it carries a big chunk of unknow text on the top. other than that, it seems to work.

Here is the website: https://mastechpowersupply.com

please help.

thanks in advance.

Edited by volteq
Link to comment
Share on other sites

Update:

I was able to logon using a different browser. The weird text on the website also went away.

however, when trying to change the skin to foundation on the layout tab, I got this message:

 

Error 406 - Not Acceptable

Generally a 406 error is caused because a request has been blocked by Mod Security. If you believe that your request has been blocked by mistake please contact the web site owner.

Edited by volteq
Link to comment
Share on other sites

CubeCart has three parts to the version:

5 or 6: Major Family
0,1,2,4,5: Feature Set
0-10+: Minor Features, Bug Fixes

So, "CubeCart 6.1" is missing a part of the version number.

Do you mean CubeCart 6.5.1 - the latest release? Upgraded from some version of the CubeCart 5 family?

 

Link to comment
Share on other sites

is there a way to manually set the skin type? from database or where this variable is kept?

by the way, the admin allows most of the variables to be set, except the skin selection, enable/disable debugging, etc.

while it issued multiple of 406 errors, none of them got logged in the error report.

Link to comment
Share on other sites

The 406 comes from the web server, not PHP nor CubeCart. Additional investigation could be provided by your hosting provider.

The default skin as selected in Store Settings is noted in a group settings array.

Access the database directly, and look in CubeCart_config table. Find the row where the 'name' is "config". From that row, note the "array" value.

It will be a very long sequence of seemingly random letters and numbers.

This is the result of an array being serialized, then base64 encoded. You will need a utility to decode the value. Some programmer's text editors can do this, and maybe phpMyAdmin (perhaps the utility you are using to directly access the database).

After decoding, 'skin_folder' and 'skin_style' is what you will be looking for.

In admin, the first page displayed is the Dashboard. On the Store Overview tab, let us know what version of PHP is being used. We strongly recommend PHP 8.1+.

Edited by bsmither
Link to comment
Share on other sites

"If I change the .htaccess file name, the website will complain that the php version is too low, and the website will not work."

I have not seen CubeCart do this. So, please verify that the complaint message is from CubeCart.

Link to comment
Share on other sites

how do I do that?

by the way, the issue of cannot login to admin comes and goes. I think it's related to broswer cache or sesion information.

another strange thing is after I get the config text decoded, I tried to encode it back. I can't get the same coded text, even though decode that different text seems to generate the same normal text, or at least by my quick check. I tried to use that different encoded text to replace the original decoded text in the config table, the website goes into different skin with broken links. 

 

Link to comment
Share on other sites

.htaccess has this:

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
   php_flag display_errors On
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 32M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php81"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors On
   php_value max_execution_time 30
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 32M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php81"
   php_value upload_max_filesize 2M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
 

maybe this is why? what I don't understand is why we need this?

Edited by volteq
Link to comment
Share on other sites

OK looks like the issue is related to the server side rules by the hosting company. they changed the rules and it's working now.

however, after changing skin to foundation, all the category links are not working. what could be the problem?

 

this is the kind of system error message we get when the category links are not working:

[<strong>Exception</strong>] /home/xxx/public_html/classes/db/database.class.php:507 - array_key_last(): Argument #1 ($array) must be of type array, null given
https://mastechpowersupply.com/variable-dc-power-supply.html?page=all
  [<strong>Exception</strong>] /home/xxx/public_html/classes/db/database.class.php:507 - array_key_last(): Argument #1 ($array) must be of type array, null given
https://mastechpowersupply.com/linear-dc-power-supply.html?page=all
   
Edited by volteq
Link to comment
Share on other sites

not sure what happened, in the foundation skin, some of the categories work and others don't. it's weird. also for all of the categories, when try to show all pages, it does not work. it gives a blank page.

this is even true with the Kurouto mode, which has always been working.

do you think it's better for me to reinstall the cubecart?

Edited by volteq
Link to comment
Share on other sites

Many "Warnings" have been found in CubeCart - even in CC651 - because PHP 8 has decided that what once 'Notices' are now 'Warnings'. Nothing bad is going to happen. These messages are being found and fixed in CC652 (not yet published).

The "page=all" should put an entry in admin, Error Logs, System Error Log table. I don't recall seeing this happen with CC651, but there is a fix for this that was implemented in CC6410.

That edit requires that the info provided in the skin's config.xml file have the following:

  <layout>
	<products>
		<perpage amount="6" />
		<perpage default="true" amount="12" />
		<perpage amount="24" />
		<perpage amount="48" />
		<perpage amount="96" />
	</products>
  </layout>

Early versions of Kurouto do not have these statements. Add them just above the <styles> statement. (Or update Kurouto to v1.0.4)

Then, have CubeCart clear its internal cache (lit button at the upper-right corner of admin screens).

Edited by bsmither
Link to comment
Share on other sites

thanks! that took care of the all page issue.

do you have any suggestions regarding the broken category issue? it's really weird that some of the links work and some don't, and I can't see any difference. e.g., on foundation skin this works:

Linear Power Supply - Best Deals on Mastech Variable DC Power Supply (mastechpowersupply.com

and this doesn't:

Switching DC Power Supplies - Best Deals on Mastech Variable DC Power Supply (mastechpowersupply.com

but on Kuroura skin they all work. On croshatch, most of them work except a couple of them.

what's even more puzzling is that now the clear cache link disappears on admin!

Link to comment
Share on other sites

I sort of figured out the issue... but it's by breaking the whole site.

I tried to reinstall the cubecart, by downgrading the site back to 5.2 and upgrading it again. only this time it won't go through setup, it just told me that it's the website is already at 6.5.1. this may be is the reason why all the links do not work now, and why the category links worked partly?

another issue is that everything when I go through this downgrade/upgrade, as soon as set the page to setup, it tells me that the php is at 5.6, I have to go to the php manager to tell it that the php is 8.2, even though I have never changed it and the system indicated it's at 8.2. I am wondering all my problems can be due to php issue? maybe I need to reinstall php package?

Edited by volteq
Link to comment
Share on other sites

CubeCart checks for what storefront skin to use in this sequence:

1. Session
2. Config
3. First Found
4. Foundation

So, if a visitor (including each admin) uses the Skin Selector made available to visitors on the storefront, that choice is stored in the visitor's 'session'.

If there is no skin having been selected in the visitor's session, CubeCart uses the Default Skin as specified in Store Settings, Layout tab.

If that skin somehow does not exist (which would be strange, but has happened), CubeCart will use the first found of all other installed skins - as long as it is not Vanilla.

Finally, as of more recent versions of CubeCart, the last resort is Foundation.

Therefore, if all you get is Kurouto, even after changing the default skin in admin config settings, you will need to log out of admin (thus killing that 'session'). Then you should see the skin as set in admin settings.

If I used this URL:

https://mastechpowersupply.com/linear-dc-power-supply
Note: No .html

I get the 404 response back directly from the web sever - not CubeCart. This tells me that the .htaccess file does not have the proper mod_rewrite directives, or that the web server is not configured to allow .htaccess directives to be executed (needs hosting company support).

Link to comment
Share on other sites

I seemed to have made things worse by working on it ...

now I cannot properly upgrade the website anymore. anytime I tried to upgrade, it won't go through setup properly. normally it needs to take some time, now it just declares the 6.5.1 already existed. of course when I go check it out, none of the links work!

how can I remove that indicator for 6.5.1 so I can force it to go through setup?

 

another thing is that I have made the seo links to work only with double html, like this:

https://mastechpowersupply.com/volteq-power-supply-hy3010ex-30v-10a-over-voltage-over-current-protection.html.html

I don't know how to change it back. right now all links with single .html will no longer work.

Link to comment
Share on other sites

I got rid of the double .html issue by going into the database and remove the .html from the urls.

at this point, what I really need help with is how to upgrade to 6.5.1 while the last few times the system would not follow through with setup.index, andclaimed victory prematurally.

 

Link to comment
Share on other sites

Look at the database table CubeCart_history. It will have rows that indicate when CubeCart was upgraded to a specific version.

Try deleting any row that has a version 6.x.x in it -- assuming you upgraded from CubeCart 5.something.something (5.2 is not specific enough).

 

 

Link to comment
Share on other sites

thank you! I did that and it is able to upgrade to 6.5.1. however, still have a lot of broken links and most ugly of all, I get some encoded text of this thing on top of every page:

assign('featured', $vars[0]); $content = $GLOBALS['smarty']->fetch('templates/box.featured.php'); $GLOBALS['smarty']->assign('RANDOM_PROD', $content); ?>

do you know where it might be located and how it ended up showing on top of every page?

it shows up on every skin

 

Link to comment
Share on other sites

You have a serious problem.

That stuff, when decoded, looks like code that wants to act as a server for malware. I can't be sure.

It will be somewhat difficult to determine where this code lives.

Firstly, look at the folder /includes/extra/. If there is any file in there other than .htaccess and index.php, delete it and post back with what you found.

 

Link to comment
Share on other sites

I do seem to have some virus. there are a few wierd looking files with .php. I deleted them but they keep on coming back.

the index file looks like this:

<?php
/**
 * CubeCart v6
 * ========================================
 * CubeCart is a registered trade mark of CubeCart Limited
 * Copyright CubeCart Limited 2017. All rights reserved.
 * UK Private Limited Company No. 5323904
 * ========================================
 * Web:   http://www.cubecart.com
 * Email:  [email protected]
 * License:  GPL-3.0 https://www.gnu.org/licenses/quick-guide-gplv3.html
 */
die('Access denied');

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...