Upgrade To 4.3.4 A Disaster

Hi all,

Upgraded to 4.3.4 last night. Store works fine except we get a Service Temporarily Unavailable message on order placement. So nobody can place an order.

There were three error message on upgrade:

ErrorAn error has occured during upgrading database structure (applying migration 20150702135958_addons_store_locator_add_privileges.php).

×ErrorPO-file contains syntax errors or incorrect structure. Please re-check it and upload again.
×WarningErrors occurred during the upgrade process. Please contact technical support to investigate the problem.
Any help really appreciated.

Try to delete the var/cache directory manually

@eComLabs that won't help the db issue I'm afraid.

@sostools I have run into this very same problem. When I looked at the logs I found that the upgrade process was trying to access a table that named incorrectly - the name would be correct if CS-Cart had been installed with the default table prefix. To me this looks like maybe a simple oversight by the developers. The version I am having this issue with was recently installed via Softaculous which allows you to custom name the db table prefix; which I did. The site is for my son and community edition ATM and it is still under production so I haven't spent much too much time looking for a solution.

Sorry for the long wait in my follow up. I found the issue is indeed related to the table prefix in the database. Best I can tell the update script Simtech provides us contains some code that calls for the default prefix label for CS-Cart which would be cscart_ of course. If; like me, you either used Softaculous to install CS-Cart or maybe you did a manual install and custom set the table prefix then the upgrade will appear to complete with an error like this one.

Here is the remedy:

1) Export a sql dump of your db by using phpMyAdmin and the following settings:

a) INSERT

b) Drop table if it exists

c) Create table if it doesn't exist

d) Don't compress unless you must because of your db size

2) open it in your favorite file editor

3) If your editor allows do a Find/Replace all with:

find: CREATE TABLE IF NOT EXISTS `customPrefix_

replace with: CREATE TABLE IF NOT EXISTS `cscart_

Then

find: INSERT INTO `customPrefix_

replace with: INSERT INTO `cscart_

Make sure you update your config.local.php with the new table prefix (should be around line 50) and just for good measure I would reflect this change in the var/upgrade/restore.php around line 103.

Once I made these adjustments the upgrade went through without error.

As always, backup everything first then go for it. Hopefully, the developers are watching and fix this.

If, you don't feel comfortable doing this yourself then contact me and we can discuss.

Sorry for my late follow up too!!!

Just performed a successful update...

The culprit is app/Tygh/UpgradeCenter/Migrations/config.migrations.php

Changing

'prefix' => DEFAULT_TABLE_PREFIX,

to:
'prefix' => $config['table_prefix'],
fixes the database issue.
Cheers and Merry Christmas

Thank you for the information. Merry Christmas too

Greetings!

I just tried to upgrade from 4.34 to 4.35, and looks like I'm getting very similar error message:

ErrorAn error has occured during upgrading database structure (applying migration 20150814123156_core_add_rocketgate.php).

I have wrote to tech support already, but maybe someone can help here?

Thanks in advance.

Did you try solution from post #5?

I have tried solution from post #5 already, deleted cache folder, etc... Still fails.

Please contact CS-Cart support team with this issue and PM me temporary FTP access so that we can check the reason

I have, but the response is very slow. I wish CS-CART dedicates more people to handle customer support.

Have you checked your PHP error_log file for Fatal errors?

You might also look at the end of var/upgrade/core_log.txt

Hi EZ (Tbirnseth),

Here is the bottom of core_log.txt file. It looks like, it has failed at Rocket Gate migration.

2015-12-24 02:21:30: using database mysite_v4
2015-12-24 02:21:30: -- createTable('phinxlog1450923473')
2015-12-24 02:21:33: -> 2.6406s
2015-12-24 02:21:33:
2015-12-24 02:21:33: == 20150804103848 CoreLastViewObsolete: migrating
2015-12-24 02:21:33: == 20150804103848 CoreLastViewObsolete: migrated 0.2339s
2015-12-24 02:21:33:
2015-12-24 02:21:33: == 20150812144247 CoreDecimalFilterValues: migrating
2015-12-24 02:21:33: == 20150812144247 CoreDecimalFilterValues: migrated 0.0079s
2015-12-24 02:21:33:
2015-12-24 02:21:33: == 20150814123156 CoreAddRocketgate: migrating
2015-12-24 02:21:33: exception 'Tygh\Exceptions\DatabaseException' with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':8:{s:5:"login";s:10:"1265916856";s:15:"transaction_key";s:16:"mhANRQhTnbyvKxUh"' at line 1' in /home/mysite/public_html/app/Tygh/UpgradeCenter/Phinx/MysqliAdapter.php:165
Stack trace:
#0 /home/mysite/public_html/app/Tygh/UpgradeCenter/Phinx/MysqliAdapter.php(89): Tygh\UpgradeCenter\Phinx\MysqliAdapter->onQueryError('UPDATE cscart_p...')
#1 /home/mysite/public_html/app/lib/vendor/robmorgan/phinx/src/Phinx/Migration/AbstractMigration.php(161): Tygh\UpgradeCenter\Phinx\MysqliAdapter->execute('UPDATE cscart_p...')
#2 /home/mysite/public_html/var/upgrade/packages/core/content/migrations/20150814123156_core_add_rocketgate.php(41): Phinx\Migration\AbstractMigration->execute('UPDATE cscart_p...')
#3 /home/mysite/public_html/app/lib/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(116): CoreAddRocketgate->up()
#4 /home/mysite/public_html/app/lib/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(210): Phinx\Migration\Manager\Environment->executeMigration(Object(CoreAddRocketgate), 'up')
#5 /home/mysite/public_html/app/lib/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(186): Phinx\Migration\Manager->executeMigration('development', Object(CoreAddRocketgate), 'up')
#6 /home/mysite/public_html/app/lib/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(100): Phinx\Migration\Manager->migrate('development', NULL)
#7 /home/mysite/public_html/app/lib/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Phinx\Console\Command\Migrate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Tygh\UpgradeCenter\Migrations\Output))
#8 /home/mysite/public_html/app/lib/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Tygh\UpgradeCenter\Migrations\Output))
#9 /home/mysite/public_html/app/lib/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Phinx\Console\Command\Migrate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Tygh\UpgradeCenter\Migrations\Output))
#10 /home/mysite/public_html/app/lib/vendor/robmorgan/phinx/src/Phinx/Console/PhinxApplication.php(80): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Tygh\UpgradeCenter\Migrations\Output))
#11 /home/mysite/public_html/app/lib/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Phinx\Console\PhinxApplication->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Tygh\UpgradeCenter\Migrations\Output))
#12 /home/mysite/public_html/app/Tygh/UpgradeCenter/Migrations/Migration.php(97): Symfony\Component\Console\Application->run(NULL, Object(Tygh\UpgradeCenter\Migrations\Output))
#13 /home/mysite/public_html/app/Tygh/UpgradeCenter/App.php(674): Tygh\UpgradeCenter\Migrations\Migration->__call('migrate', Array)
#14 /home/mysite/public_html/app/Tygh/UpgradeCenter/App.php(674): Tygh\UpgradeCenter\Migrations\Migration->migrate('20150804103848')
#15 /home/mysite/public_html/app/Tygh/UpgradeCenter/App.php(421): Tygh\UpgradeCenter\App->installUpgradePackage('core', Array)
#16 /home/mysite/public_html/app/controllers/backend/upgrade_center.php(91): Tygh\UpgradeCenter\App->install('core', Array)
#17 /home/mysite/public_html/app/functions/fn.control.php(680): include('/home/mysite/p...')
#18 /home/mysite/public_html/app/functions/fn.control.php(451): fn_run_controller('/home/mysite/p...', 'upgrade_center', 'install', '', '')
#19 /home/mysite/public_html/administratorsha.php(27): fn_dispatch()
#20 {main}
2015-12-24 02:21:33: Failed to execute migrations

@xmaster007,

I'm not familiar enough with the migration tool they are using.

Should be reported to bugtracker and a ticket (free) opened with support to help you out.

Greetings!

I just tried to upgrade from 4.34 to 4.35, and looks like I'm getting very similar error message:

ErrorAn error has occured during upgrading database structure (applying migration 20150814123156_core_add_rocketgate.php).

I have wrote to tech support already, but maybe someone can help here?

Thanks in advance.

This is confirmed bug. It occures if you have credentials data in you Rocketgate payment processor.
As a solution you can try delete Rocketgate processor data, then upgrade, and create it once again - probably this will help.

We are going to update upgrade package within week.
I will let you know in this thread.

Following upgrade, I have another issue:

When going into product edit, I get the following:

ErrorUnable to create thumbnail for file "/xxx/xxx/xxx/xxx/images/detailed/0/297.png": Unable to open image /xxx/xxx/www/xxx/images/detailed/0/297.png

The problem also happens when attempting to export to eBay:

The server specified by ExternalPictureURL is not responding

The issue is not that the images don't exist in the correct folders, it is that cs cart (or PHP) is attempting to access them using absolute full server directory structure rather than the relative host root directory.

Is this an issue with cs cart or PHP/Apache config on second thoughts?

I have, but the response is very slow. I wish CS-CART dedicates more people to handle customer support.

We guarantee a reply within one business day. If you ask us during our working hours (we work Monday - Friday, 9 a.m. - 6 p.m. at our local time, our local time is GMT+4), we usually answer within a few hours. If you ask a question at another time, the answer may take longer.

In your case we could not examine the issue because we could not connect to your server using provided FTP access credentials.

Following upgrade, I have another issue:

When going into product edit, I get the following:

ErrorUnable to create thumbnail for file "/xxx/xxx/xxx/xxx/images/detailed/0/297.png": Unable to open image /xxx/xxx/www/xxx/images/detailed/0/297.png

The problem also happens when attempting to export to eBay:

The server specified by ExternalPictureURL is not responding

The issue is not that the images don't exist in the correct folders, it is that cs cart (or PHP) is attempting to access them using absolute full server directory structure rather than the relative host root directory.

Is this an issue with cs cart or PHP/Apache config on second thoughts?

This issue requires examination directly on your server. Please contact us via Help Desk and provide temporary FTP access to your server so we can examine the issue in more detail.

Thank you cs cart team.

You have indeed been helpful in the past, however we have an issue with opening ftp ports in the system due to the security considerations, in our case the system had been compromised at least twice in the past 6 months with one of those times the hackers managing to inject code into cs cart scripts. While only cscart installation was affected, we are not willing to risk having to rebuild the system again.

So there is a situation where we are not sure how to move forward, we would prefer that cscart assist us directly rather than us allow cscart free reign over our data - how can cscart guarantee the security and integrity of data on our servers given access to it? I don't believe it can. There is certainly no signed or valid contract between us and cscart, we merely have a licence to use your software which we do on the basis that cscart has sold us a promise of certain functionality. So in fact we are paying for functionality, cs cart owns the code. Our installation has not been modified with the exception of config.local.php file and obviously the templates such as invoice, etc. So if there are bugs, which we accept there might be, as with all software there is, we would like an interactive solution with cscart so we can both benefit from the knowledge.

I don't think ftp access is a secure and perhaps the best approach to these issues. If it is absolutely necessary then cscart should provide a list of files and directories it requires access to and at what level. We would require IP address from cscart for us to allow access through our firewall, generate keys, time limit the access given exact times of access required. This process is cumbersome, beyond the scope of many installations and time consuming and still has security implications.

Looking for a better way here guys.

Most commonly, cs-cart (or any supporting vendor) is given ftp access for a specific FTP account that has it's home directory defined as the directory of the root of the store. Following their evaluation/reparation, you can easily disable (or change the password) of that ftp user.

If you use something like our EZ Admin Helper, you can track what files have been changed during their access so you would have very clear visibility of what the modified. Our file compare action will detect file modifications. If run it daily (via cron), you get a good picture of all files that are modified on your site. If the data is too much (like too much thumbnail activity) you can restrict directories that it will compare.

It is good that you are cautious and you are more descriptive in your detail than most. However, there are many times that access to a client site is required to efficiently evaluate and resolve issues.

Thank you cs cart team.

You have indeed been helpful in the past, however we have an issue with opening ftp ports in the system due to the security considerations, in our case the system had been compromised at least twice in the past 6 months with one of those times the hackers managing to inject code into cs cart scripts. While only cscart installation was affected, we are not willing to risk having to rebuild the system again.

So there is a situation where we are not sure how to move forward, we would prefer that cscart assist us directly rather than us allow cscart free reign over our data - how can cscart guarantee the security and integrity of data on our servers given access to it? I don't believe it can. There is certainly no signed or valid contract between us and cscart, we merely have a licence to use your software which we do on the basis that cscart has sold us a promise of certain functionality. So in fact we are paying for functionality, cs cart owns the code. Our installation has not been modified with the exception of config.local.php file and obviously the templates such as invoice, etc. So if there are bugs, which we accept there might be, as with all software there is, we would like an interactive solution with cscart so we can both benefit from the knowledge.

I don't think ftp access is a secure and perhaps the best approach to these issues. If it is absolutely necessary then cscart should provide a list of files and directories it requires access to and at what level. We would require IP address from cscart for us to allow access through our firewall, generate keys, time limit the access given exact times of access required. This process is cumbersome, beyond the scope of many installations and time consuming and still has security implications.

Looking for a better way here guys.

We understand your concerns. However, FTP is the most fast and convenient way to examine and fix the issues on the server. If the access credentials are provided via the Access Information form it is secure since the information is deleted automatically.

Unfortunately, we cannot tell you what exact files and directories require examination in each particular case. However, we can provide you with a list of amended files after the examination is complete.