Post by OSWorX » Fri Oct 09, 2015 6:25 pm

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??

Image


User avatar
Expert Member
Online

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by AhmedSabri » Sat Oct 10, 2015 1:28 am

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.

User avatar
Newbie

Posts

Joined
Sat Oct 10, 2015 1:10 am

Post by ebmarques » Sat Oct 10, 2015 2:28 am

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.

User avatar
Newbie

Posts

Joined
Tue Nov 22, 2011 3:45 am

Post by starconfig » Mon Oct 12, 2015 1:38 pm

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;

Newbie

Posts

Joined
Thu Feb 26, 2015 6:54 pm


Post by starconfig » Mon Oct 12, 2015 5:19 pm

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

Newbie

Posts

Joined
Thu Feb 26, 2015 6:54 pm


Post by abilrk » Sat Oct 17, 2015 10:50 am

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???

Newbie

Posts

Joined
Sat Oct 17, 2015 7:29 am

Post by oberheimer » Wed Oct 21, 2015 9:19 pm

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?

New member

Posts

Joined
Fri Jun 22, 2012 5:28 am

Post by Staiko79 » Thu Oct 22, 2015 1:39 am

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 !

Newbie

Posts

Joined
Thu Oct 22, 2015 1:32 am

Post by IP_CAM » Thu Oct 22, 2015 7:28 am

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

For Sale: Top URL's, including OpenCart V-Pro installed, like seen here:
http://www.bigmax.ch - http://www.ipcam.li - http://www.opencart.li
For Information + URL's offered, please contact me at: jti@jacob.ch
I am NOT available for Custom Support in existing OC Installations!
My Github Repositories: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by tcustomgolf » Sun Nov 22, 2015 1:22 am

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.

Newbie

Posts

Joined
Wed Apr 18, 2012 10:28 pm

Post by yorgvan » Mon Apr 11, 2016 7:18 pm

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

Attachments

damn.png

damn.png (67.34 KiB) Viewed 5903 times


Newbie

Posts

Joined
Mon Apr 11, 2016 2:08 pm

Post by yorgvan » Mon Apr 11, 2016 11:29 pm

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

Newbie

Posts

Joined
Mon Apr 11, 2016 2:08 pm

Post by Manda13 » Mon Apr 25, 2016 10:25 am

Thanks very much, yorgvan, that worked for me!

Newbie

Posts

Joined
Mon Apr 25, 2016 10:23 am

Post by haxcop » Sun Jun 26, 2016 8:09 am

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

Save Time and the hassle of the legal stuff on your site with this Amazing Guys of
Iubenda http://bit.ly/2xKZBKh


New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by haxcop » Sun Jun 26, 2016 8:40 am

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! ;)

Save Time and the hassle of the legal stuff on your site with this Amazing Guys of
Iubenda http://bit.ly/2xKZBKh


New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by straightlight » Sun Jun 26, 2016 8:58 am

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.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by expressindia » Tue May 08, 2018 10:16 pm

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

Newbie

Posts

Joined
Tue May 08, 2018 10:12 pm
Who is online

Users browsing this forum: No registered users and 6 guests