eangulo

Fatal error when delete content of "caches" table

Recommended Posts

Hello everyone,

Usually in many CMS database tables prefixed or suffixed with "cache" can be manually cleared without a problem because the system will populate them on the "next page request". Actually in Processwire I am expecting this behaviour:

[On PW 3.x]

  1. Manually clear table "caches" in database
  2. Go to "client" side (not in the admin panel)
  3. All references to my "/site/modules" in my template files does not work : wire("modules")->get(""), $modules->get("") and modules()->get("")
    1. PHP error:  Fatal error: Uncaught TypeError: Return value...
    2. My _init.php file are not able to find the references to my /site/modules/
  4.  The client side not working because this PHP fatal error.

If I go to the admin panel "Admin -> Modules" and I trigger the action "Check for New Modules" in the top-right corner in the page, it populates the caches table with the required information and them the client side works.

It is normal? Or I am doing something wrong ?

A solution could be to manually call the script that the button "Check for New Modules" calls, but I want to know if  I am doing something wrong here.

Thank you in advance guys ! 

Share this post


Link to post
Share on other sites

Always do backups before manually changing something in the DB.

I never touched the caches DB-table. I only delete assets/cache/ stuff from the file-system if I need to (rarely). Perhaps delete those file-caches too and it will then try to re-create all DB-caches? 

Share this post


Link to post
Share on other sites

Hi @dragan,

Yes that's a very good advice, I always do this kind of manipulation in a local environnement.

Maybe I'm comparing to much Processwire with others CMS/CMF. Maybe the "caches" table that contains the system registry entries should never be cleared manually.

(caches table system registry)

  • Modules.info
  • Modules.site/modules/ (This is the one causing the Fatal PHP error, after "caches" table is manually cleared and the system is not generating it automatically)
  • Modules.wire/modules/
  • ... and so on

If @ryan design it that way, I understand :).

But I think it would be nice, if the rebuild caches table's content script can generate the content for this one too "Modules.site/modules/".

Thank you,

Share this post


Link to post
Share on other sites

Thank you @adrian for this module and I fully agree with you that this is a much better way to do it, but I was looking for an explanation for this behaviour to explain it to my team.

Thank you guys,

Share this post


Link to post
Share on other sites
Just now, eangulo said:

but I was looking for an explanation for this behaviour to explain it to my team.

I think it's an oversight that should be fixed - I think you should post a Github issue for Ryan to think about. He may not agree but I think that is the best way forward.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

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


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By modifiedcontent
      I have one central website, with membership registration and content etc., and then several related websites with their own URL/domains, each on Processwire, all on the same server.
      I would like to access the database of the central website from the sister websites. How would I do that?
      You can't bootstrap one PW installation into another. You can include template parts from one in the other by just using the server path, but whatever you try to get/post just comes/goes to the database of the site you are on.
      Could you switch databases by including the config.php from another PW installation somewhere?
      What is the correct, secure way to do this?
    • By anttila
      I developed my own web store platform on ProcessWire. Work like a charm. However, I would like to know what is the best way to cache web store? There is a shopping cart, many languages and previously watched products which need to run without cache but everything else could be cached. Is there a way to use PW's own cache or ProCache for everything else except for certain HTML ID? I have used MarkupCache for categories in some cases.
      I'm addicted to speed. Everything has to be loaded as fast as possible or even faster. My next step is developing AMP HTML as part of the platform, but that is not helping normal version.
    • By answersmode
      Please help me........
      DATABASE CONNECTION PROBLEM  - CREATE DATABASE IF NOT EXISTS `lwteswm664_ltingesjfo_itbd` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
      Error
      SQL query:
       
      -- -- Database: `lwteswm664_ltingesjfo_itbd` -- CREATE DATABASE IF NOT EXISTS `lwteswm664_ltingesjfo_itbd` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;  
      MySQL said:
      #1044 - Access denied for user 'newhost'@'localhost' to database 'lwteswm664_ltingesjfo_itbd' 
       
      I'm facing this peoblem in my website xxxxx and xxxxx When I wanted to upload my databaz backup file.
      Now what can I do?
      Please help me........
       
       

    • By thmsnhl
      Hi everybody,
      we started our first Processwire driven project in my new company and for the first time, I was working on one site with more than 2 colleagues on the same site.
      It didn't take long for us to stumble across some problems when multiple developers work at the same time, conflicts with updating the database on vagrant machines, like duplicate entries for page IDs, errors when setting up fields and stuff like this. We ended up working on a dedicated database server, that we linked to our vagrant machines and most of the problems were gone, but the performance of this constellation is really bad compared to our first approach with database running on vagrant machines.
      I already tried to find a solution in the forums but I couldn't find anyone with problems like this.
      So I was wondering: how do you manage projects with multiple developers on vagrant machines in a git-based workflow?
    • By hezmann
      Hi!  I've just started on ProcessWire, coming from Wordpress.  I've done several sites in WP but this new one is just to data driven for Wordpress to handle without so many plugins and custom code it just seemed like there must be a better option so here I am.  I used to do a lot of stuff in Access (many years ago) and have some experience with PHP/MySQL.
      I've had a look at a few tutorials and created the planets website etc.  I have a specific structure that I'm looking to create so thought I would ask for some expert advice before making every mistake in the book.
      I do a lot of long distance (inn to inn) walking and am always looking for new ones which involves searching many different sites.  I've yet to find a good repository for this type of thing so thought I would build my own.  The basic structure is (more info added later but trying to get basic idea of best practices):
       
      Walks -> Walk Variations <->Walk Segments <-> Walk Towns (go into Walk Segments as Start and End Towns).
      Walks <->Links
      Walk Towns <-> Accomodation, Walk Towns <-> Dining
      Should I be using ProFields?  How should I structure this as far as fields/templates?
      Thanks in advance for your help.
      Heather