Page 2 of 2

Re: Upgrade Errors With V2.1.0.1

Posted: Fri Oct 09, 2015 6:25 pm
by OSWorX
Qphoria wrote:
ebmarques wrote:The same with me. >:D
My store is down, my Website is down.
I am so mad with OpenCart!!! Amateurs!!! It is unacceptable to release a new version without testing!!!
In spite of hiring someone to fix it I will move to WordPress with an Ecommerce plugin.
BYE BYE OpenCart!!!
It's just amateur to to blindly update your live site with a bleeding edge version for no reason.
Maybe, but how many of the users using OC are NO amateurs??

Re: Upgrade Errors With V2.1.0.1

Posted: Sat Oct 10, 2015 1:28 am
by AhmedSabri
The update model does not work properly, so before upgrade edit "upgrade.php" in the model directory and change the line number 25 from

Code: Select all

$line = str_replace("CREATE TABLE `oc_", "CREATE TABLE `" . DB_PREFIX, $line);
to

Code: Select all

$line = str_replace("CREATE TABLE `oc_", "CREATE TABLE IF NOT EXISTS `" . DB_PREFIX, $line);
OR

change the line number 125 from

Code: Select all

preg_match_all('#create\s*table\s*if\s*not\s*exists\s*`(\w[\w\d]*)`#i', $sql, $table);
to

Code: Select all

preg_match_all('#create\s*table\s*`(\w[\w\d]*)`#i', $sql, $table);
After upgrade check your store settings becouse maybe you will lost the content of the home page and some data like user API key and some other data.

Re: Upgrade Errors With V2.1.0.1

Posted: Sat Oct 10, 2015 2:28 am
by ebmarques
OSWorX wrote:
Qphoria wrote:
ebmarques wrote:The same with me. >:D
My store is down, my Website is down.
I am so mad with OpenCart!!! Amateurs!!! It is unacceptable to release a new version without testing!!!
In spite of hiring someone to fix it I will move to WordPress with an Ecommerce plugin.
BYE BYE OpenCart!!!
It's just amateur to to blindly update your live site with a bleeding edge version for no reason.
Maybe, but how many of the users using OC are NO amateurs??
"bleeding edge version" !!!!!!!!!!!!!!!!!!
"for no reason" !!!!!!!!!
Qphoria, you made my day! Thank you very much! Now I have no doubt! OC is history to me.

Re: Upgrade Errors With V2.1.0.1

Posted: Mon Oct 12, 2015 1:38 pm
by starconfig
So is there any solution to create api ? probably deleted due to upgrades

I just copy api data from opencart.sql to SQL query and it works for me

Code: Select all

-- Table structure for table `oc_api`
--

DROP TABLE IF EXISTS `oc_api`;
CREATE TABLE `oc_api` (
  `api_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `key` text NOT NULL,
  `status` tinyint(1) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  PRIMARY KEY (`api_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `oc_api_ip`
--

DROP TABLE IF EXISTS `oc_api_ip`;
CREATE TABLE `oc_api_ip` (
  `api_ip_id` int(11) NOT NULL AUTO_INCREMENT,
  `api_id` int(11) NOT NULL,
  `ip` varchar(40) NOT NULL,
  PRIMARY KEY (`api_ip_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `oc_api_session`
--

DROP TABLE IF EXISTS `oc_api_session`;
CREATE TABLE `oc_api_session` (
  `api_session_id` int(11) NOT NULL AUTO_INCREMENT,
  `api_id` int(11) NOT NULL,
  `token` varchar(32) NOT NULL,
  `session_id` varchar(32) NOT NULL,
  `session_name` varchar(32) NOT NULL,
  `ip` varchar(40) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  PRIMARY KEY (`api_session_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

Re: Upgrade Errors With V2.1.0.1

Posted: Mon Oct 12, 2015 5:19 pm
by starconfig
Hmm still got problem when go to Admin Order Page

Warning: Your IP XX.XX.XX.XX is not allowed to access this API!

Can add but always coming back this warning

Updated

Api User haven't selected in settings that's why i always receiving this warning.

Go to Home> Stores> Settings

and Pick API User

Re: Upgrade Errors With V2.1.0.1

Posted: Sat Oct 17, 2015 10:50 am
by abilrk

Code: Select all

Warning: mysqli::mysqli(): Headers and client library minor version mismatch. Headers:50542 Library:50626 in /home/abilrkprivat/public_html/system/library/db/mysqli.php on line 7

Code: Select all

Warning: Cannot modify header information - headers already sent by (output started at /home/abilrkprivat/public_html/system/library/db/mysqli.php:7) in /home/abilrkprivat/public_html/system/library/response.php on line 12
why my update error???

Re: Upgrade Errors With V2.1.0.1

Posted: Wed Oct 21, 2015 9:19 pm
by oberheimer
AhmedSabri wrote:The update model does not work properly, so before upgrade edit "upgrade.php" in the model directory and change the line number 25 from

Code: Select all

$line = str_replace("CREATE TABLE `oc_", "CREATE TABLE `" . DB_PREFIX, $line);
to

Code: Select all

$line = str_replace("CREATE TABLE `oc_", "CREATE TABLE IF NOT EXISTS `" . DB_PREFIX, $line);
OR

change the line number 125 from

Code: Select all

preg_match_all('#create\s*table\s*if\s*not\s*exists\s*`(\w[\w\d]*)`#i', $sql, $table);
to

Code: Select all

preg_match_all('#create\s*table\s*`(\w[\w\d]*)`#i', $sql, $table);
After upgrade check your store settings becouse maybe you will lost the content of the home page and some data like user API key and some other data.
Does this work or so it upgrades the database. How about the other things like admin and so on?

Re: Upgrade Errors With V2.1.0.1

Posted: Thu Oct 22, 2015 1:39 am
by Staiko79
Had some errors myself when upgrading from 2.0.3.1 to 2.1.0.1

Admin Dashboard Page:
Warning: vsprintf(): Too few arguments in activity.php on line 19Warning: vsprintf(): Too few arguments in activity.php on line 19Warning: vsprintf(): ..................

Admin Settings Page:
Notice: Error: Unknown column 'name' in 'order clause'
Error No: 1054
SELECT * FROM `oc_api` ORDER BY name ASC in .....system/library/db/mysqli.php on line 41Notice: Trying to get property of non-object in ...admin/model/user/api.php on line 77

See errors in front end as well:
Notice: Error: Table 'Commad4quadcom.oc_cart' doesn't exist
Error No: 1146
DELETE FROM oc_cart WHERE customer_id = '0' AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR) in system/library/db/mysqli.php on line 41Notice: Error: Table 'Commad4quadcom.oc_cart' doesn't exist
Error No: 1146
SELECT * FROM oc_cart WHERE customer_id = '0' AND session_id = '90r7445d1mdov0svrrobdv1aj4' in system/library/db/mysqli.php on line 41Notice: Trying to get property of non-object in system/library/cart.php on line 37Warning: Invalid argument supplied for foreach() in system/library/cart.php on line 37Notice: Error: Table 'Commad4quadcom.oc_cart' doesn't exist
Error No: 1146.....................


Luckily backed up so going back to previous version.

Hope the update gets checked and fixed real soon !

Re: Upgrade Errors With V2.1.0.1

Posted: Thu Oct 22, 2015 7:28 am
by IP_CAM
The latest UPDATE, as you call it, (I call them releases) does not need a fix, for some reasons, apparently, some DB-Stuff got changed, for good, compared with it's predecessor Subversions. This is, what may happen, frequently, on most Software-DEV-Versions. Just remember MS Windows, requiring decades, and a lot of changes, to make it do, what had been planned.
Just to mention it! ;)
Ernie

Re: Upgrade Errors With V2.1.0.1

Posted: Sun Nov 22, 2015 1:22 am
by tcustomgolf
To sum up the major items on this thread that I also received, and now fixed: (The question is, why do we have to perform these steps? A whole table missing, c'mon!)

This code fixes the error about the oc_cart missing. Note that you need to remove 'oc_' if you do not use the prefix:

Code: Select all

    CREATE TABLE `oc_cart` (
      `cart_id` int(11) NOT NULL AUTO_INCREMENT,
      `customer_id` int(11) NOT NULL,
      `session_id` varchar(32) NOT NULL,
      `product_id` int(11) NOT NULL,
      `recurring_id` int(11) NOT NULL,
      `option` text NOT NULL,
      `quantity` int(5) NOT NULL,
      `date_added` datetime NOT NULL,
      PRIMARY KEY (`cart_id`),
      KEY `cart_id` (`customer_id`,`session_id`,`product_id`,`recurring_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
For this error:

Code: Select all

Notice: Error: Unknown column 'name' in 'order clause'
Error No: 1054
I basically renamed the 'username' field to 'name' in the 'oc_api' table, as the api.php file is using 'name' in the array...and taking a hint from this post:
https://github.com/opencart/opencart/issues/3507

All seems to work for now.

Re: Upgrade Errors With V2.1.0.1

Posted: Mon Apr 11, 2016 7:18 pm
by yorgvan
damn """"""""
i nailed it , to all of you fellaz who have been keeping quiet a bout this ,
i will help most of u who have had toruble like me , i have had to delete all my system files just for one small number to be changed. okay to hell with the excitement ?????

go to cpanel ,
databases .... > phpmyadminn......>

look for your data base name, on the left corner,
click it , below look for oc_api_ip click it
you will see this picture. check and see if your ip is the same with this one, if not then this is the problem.

click edit on the right , add only change that ip , after press go. an you are done.
took me 4 days to figure this out . iam happy to share with you all. oc 2.1.0

Re: Upgrade Errors With V2.1.0.1

Posted: Mon Apr 11, 2016 11:29 pm
by yorgvan
another post to help solve this error,
go to system, settings, click on your store edit action, go to the option bar,
scroll down down until u find stock,
by api user select your created profile, go up and save , and there it will be solved.

i had to recreate my site over 8 times and 4 days work.
ha ha haa hope this post helps

Re: Upgrade Errors With V2.1.0.1

Posted: Mon Apr 25, 2016 10:25 am
by Manda13
Thanks very much, yorgvan, that worked for me!

Re: Upgrade Errors With V2.1.0.1

Posted: Sun Jun 26, 2016 8:09 am
by haxcop
This solve everything on my store to the upgrade from 2.0.3 up to 2.1.0.2 ;D Thanks!!
CREATE TABLE `oc_cart` (
`cart_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`session_id` varchar(32) NOT NULL,
`product_id` int(11) NOT NULL,
`recurring_id` int(11) NOT NULL,
`option` text NOT NULL,
`quantity` int(5) NOT NULL,
`date_added` datetime NOT NULL,
PRIMARY KEY (`cart_id`),
KEY `cart_id` (`customer_id`,`session_id`,`product_id`,`recurring_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
and after that to avoid the vs... error as one of the guys here posted you need to empty the table oc_customer_activity

Code: Select all

TRUNCATE TABLE oc_customer_activity;


This should work .. hope so hehe ??? :D

Re: Upgrade Errors With V2.1.0.1

Posted: Sun Jun 26, 2016 8:40 am
by haxcop
starconfig wrote:So is there any solution to create api ? probably deleted due to upgrades

I just copy api data from opencart.sql to SQL query and it works for me

Code: Select all

-- Table structure for table `oc_api`
--

DROP TABLE IF EXISTS `oc_api`;
CREATE TABLE `oc_api` (
  `api_id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(64) NOT NULL,
  `key` text NOT NULL,
  `status` tinyint(1) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  PRIMARY KEY (`api_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `oc_api_ip`
--

DROP TABLE IF EXISTS `oc_api_ip`;
CREATE TABLE `oc_api_ip` (
  `api_ip_id` int(11) NOT NULL AUTO_INCREMENT,
  `api_id` int(11) NOT NULL,
  `ip` varchar(40) NOT NULL,
  PRIMARY KEY (`api_ip_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

-- --------------------------------------------------------

--
-- Table structure for table `oc_api_session`
--

DROP TABLE IF EXISTS `oc_api_session`;
CREATE TABLE `oc_api_session` (
  `api_session_id` int(11) NOT NULL AUTO_INCREMENT,
  `api_id` int(11) NOT NULL,
  `token` varchar(32) NOT NULL,
  `session_id` varchar(32) NOT NULL,
  `session_name` varchar(32) NOT NULL,
  `ip` varchar(40) NOT NULL,
  `date_added` datetime NOT NULL,
  `date_modified` datetime NOT NULL,
  PRIMARY KEY (`api_session_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

Flawless Victory!!! I just changed the ENGINE= InnoDB

Thanks your are a legend! ;)

Re: Upgrade Errors With V2.1.0.1

Posted: Sun Jun 26, 2016 8:58 am
by straightlight
Thanks for finding this solution.

Code: Select all

SHOW TABLE STATUS
should be used during either the installation or during the upgrade activity in order to avoid this type of problem in the future.

opencart cart table does not exist

Posted: Tue May 08, 2018 10:16 pm
by expressindia
Hello Friends,

I have installed fresh opencart 3.0.0 on my local machine macbook pro. It was working fine. But last 2 days I am receiving following error.

Fatal error: Uncaught Exception: Error: Table 'streamit.oc_cart' doesn't exist<br />Error No: 1146<br />DELETE FROM oc_cart WHERE (api_id > '0' OR customer_id = '0') AND date_added < DATE_SUB(NOW(), INTERVAL 1 HOUR) in /Applications/MAMP/htdocs/streamit/system/library/db/mysqli.php:40 Stack trace: #0 /Applications/MAMP/htdocs/streamit/system/library/db.php(16): DB\MySQLi->query('DELETE FROM oc_...', Array) #1 /Applications/MAMP/htdocs/streamit/system/library/cart/cart.php(15): DB->query('DELETE FROM oc_...') #2 /Applications/MAMP/htdocs/streamit/catalog/controller/startup/startup.php(183): Cart\Cart->__construct(Object(Registry)) #3 /Applications/MAMP/htdocs/streamit/system/engine/action.php(51): ControllerStartupStartup->index() #4 /Applications/MAMP/htdocs/streamit/system/engine/router.php(34): Action->execute(Object(Registry)) #5 /Applications/MAMP/htdocs/streamit/system/engine/router.php(19): Router->execute(Object(Action)) #6 /Applications/MAMP/htdocs/streamit/system/framework.php(168): Router->dispatch(Object(Action in /Applications/MAMP/htdocs/streamit/system/library/db/mysqli.php on line 40

============================

Can anybody help me out what is the issue.


Thanks
Jafar Ansari