Jump to content

ps_smarty_lazy_cache doesn't exist


pietruzzo

Recommended Posts

Hi.

I'm having some trouble while updatig data from backoffice in prestashop 1.6.5. Any attempt of saving changes from product/ category tabs gets an http error 500. I'm on Keliweb server and they told me there should be some problems with a module or the ps_smarty_lazy cache table.. if I try to select the table on php myadmin I get an error notice (ps smarty_lazy_cache doesn't exist). Could you please tell me whether this is the problem that generated the server errors and how I could fix it?

Thanks in advance.

Link to comment
Share on other sites

I suppose your shop is an upgrade ? Sometimes on upgrades this table is missing. BEFORE you manipulate your database manually, please make a back-up of it. On your back-office, tab "advanced parameters -> DB back-up".

 

Add ps_lazy_cache manually to you database with phpMyAdmin and SQL-query:

DROP TABLE IF EXISTS `PREFIX_smarty_lazy_cache`;
CREATE TABLE `PREFIX_smarty_lazy_cache` (
  `template_hash` varchar(32) NOT NULL DEFAULT '',
  `cache_id` varchar(255) NOT NULL DEFAULT '',
  `compile_id` varchar(32) NOT NULL DEFAULT '',
  `filepath` varchar(255) NOT NULL DEFAULT '',
  `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

The PREFIX you should change to the prefix of your database tables. Native install it is ps_, but if you changed, you should change to the one you used. If your shop is a native install, and nothing changed when installed, so the query is:

DROP TABLE IF EXISTS `ps_smarty_lazy_cache`;
CREATE TABLE `ps_smarty_lazy_cache` (
  `template_hash` varchar(32) NOT NULL DEFAULT '',
  `cache_id` varchar(255) NOT NULL DEFAULT '',
  `compile_id` varchar(32) NOT NULL DEFAULT '',
  `filepath` varchar(255) NOT NULL DEFAULT '',
  `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

If you don't know how to use SQL-queries, please ask your provider or somebody else.

  • Like 6
  • Thanks 1
Link to comment
Share on other sites

Thanks for your quick reply. Actually thete was no upgrade recently. I got those http errors an then I checked on the tables list and realized that smart lazy cache wasn't there. In my latest backup there was the table and some values in it. I can't figure out what's happened. Any idea about that?

Thanks again.

Link to comment
Share on other sites

  • 4 months later...

I have also suddenly gotten this error. When trying to create the table again with the script or manually in phpmyadmin, the server denies saying: 

#1005 - Can't create table 'thatsminedk.ps_smarty_lazy_cache' (errno: -1)

Any advise is greatly appreciated!

Link to comment
Share on other sites

  • 2 months later...

I also had blank page issue (possibly due to migration from PS Cloud to PS Native installation)

 

found the error message when I turned ('_PS_MODE_DEV_', false) to true

 

 

This Fixed Worked a treat, Thank you very much!

 

 

I suppose your shop is an upgrade ? Sometimes on upgrades this table is missing. BEFORE you manipulate your database manually, please make a back-up of it. On your back-office, tab "advanced parameters -> DB back-up".

 

Add ps_lazy_cache manually to you database with phpMyAdmin and SQL-query:

DROP TABLE IF EXISTS `PREFIX_smarty_lazy_cache`;
CREATE TABLE `PREFIX_smarty_lazy_cache` (
  `template_hash` varchar(32) NOT NULL DEFAULT '',
  `cache_id` varchar(255) NOT NULL DEFAULT '',
  `compile_id` varchar(32) NOT NULL DEFAULT '',
  `filepath` varchar(255) NOT NULL DEFAULT '',
  `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

The PREFIX you should change to the prefix of your database tables. Native install it is ps_, but if you changed, you should change to the one you used. If your shop is a native install, and nothing changed when installed, so the query is:

DROP TABLE IF EXISTS `ps_smarty_lazy_cache`;
CREATE TABLE `ps_smarty_lazy_cache` (
  `template_hash` varchar(32) NOT NULL DEFAULT '',
  `cache_id` varchar(255) NOT NULL DEFAULT '',
  `compile_id` varchar(32) NOT NULL DEFAULT '',
  `filepath` varchar(255) NOT NULL DEFAULT '',
  `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

If you don't know how to use SQL-queries, please ask your provider or somebody else.

 

 

Just pasted native install code above into SQL field in the DB 'PHPmyAdmin' while on main table structure page

 

(so just left as 'ps_smarty_lazy_cache')

 

Cheers

Link to comment
Share on other sites

  • 4 weeks later...

Thank you so much!
It's helped me too:

 

DROP TABLE IF EXISTS `ps_smarty_lazy_cache`;
CREATE TABLE `ps_smarty_lazy_cache` (
`template_hash` varchar(32) NOT NULL DEFAULT '',
`cache_id` varchar(255) NOT NULL DEFAULT '',
`compile_id` varchar(32) NOT NULL DEFAULT '',
`filepath` varchar(255) NOT NULL DEFAULT '',
`last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

I was error when changed order status. I has found that table `ps_smarty_lazy_cache` is corrupted. the deleting and newly recreating it was solved my problem.
 

Link to comment
Share on other sites

  • 4 weeks later...

I suppose your shop is an upgrade ? Sometimes on upgrades this table is missing. BEFORE you manipulate your database manually, please make a back-up of it. On your back-office, tab "advanced parameters -> DB back-up".

 

Add ps_lazy_cache manually to you database with phpMyAdmin and SQL-query:

DROP TABLE IF EXISTS `PREFIX_smarty_lazy_cache`;
CREATE TABLE `PREFIX_smarty_lazy_cache` (
  `template_hash` varchar(32) NOT NULL DEFAULT '',
  `cache_id` varchar(255) NOT NULL DEFAULT '',
  `compile_id` varchar(32) NOT NULL DEFAULT '',
  `filepath` varchar(255) NOT NULL DEFAULT '',
  `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

The PREFIX you should change to the prefix of your database tables. Native install it is ps_, but if you changed, you should change to the one you used. If your shop is a native install, and nothing changed when installed, so the query is:

DROP TABLE IF EXISTS `ps_smarty_lazy_cache`;
CREATE TABLE `ps_smarty_lazy_cache` (
  `template_hash` varchar(32) NOT NULL DEFAULT '',
  `cache_id` varchar(255) NOT NULL DEFAULT '',
  `compile_id` varchar(32) NOT NULL DEFAULT '',
  `filepath` varchar(255) NOT NULL DEFAULT '',
  `last_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  PRIMARY KEY (`template_hash`, `cache_id`, `compile_id`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;

If you don't know how to use SQL-queries, please ask your provider or somebody else.

Worked perfect for me! I only had to remove 

ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
Link to comment
Share on other sites

  • 1 year later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...