1

I created an SQL installation script for my extension and it ran just fine. I was developing the extension with the caches turned off. When I turn the caches on, the installation script doesn't get run, and I can't work out why.

I've tried clearing all of the Magento caches through the admin panel, flushing the cache storage, manually removing the contents of the magento/var/cache folder, clearing the APC cache, clearing the redis backend from the command line and restarting the PHP process, and nothing has worked. The only way I've managed to get the installation script to run is by turning the caches off.

Does anyone know why this would be happening? I'm using Magento v1.4.0.0 RC1.

6
  • try checking what version is installed in your core_config_resource(may not be the correct table name) in your database. If the version installed equals the version of your extension, then remove that entry. that should trigger magento to execute the install script again
    – Soundz
    Mar 13, 2013 at 1:45
  • 3
    Why 1.4.0.0RC1?
    – benmarks
    Mar 13, 2013 at 1:48
  • There is no entry in the core_resource table for my extension. I'm attempting to run an install script, not an upgrade script.
    – Matthew G
    Mar 13, 2013 at 1:51
  • @benmarks Because that just happens to be the version I'm working with.
    – Matthew G
    Mar 13, 2013 at 1:52
  • 1
    I'm fairly sure @benmarks comment was rhetorical. You are using a BETA and an old one at that. At least move to the next latest stable (1.4.0.1) Mar 13, 2013 at 8:41

2 Answers 2

4

Once an installer runs, if successful, it will create an entry in core_resource. If your don't have an entry in there, then either your installer isn't running or not completing properly.

I think the fact you said that table contains no entry is a bigger issue than the extension not being recognised with the cache on.

Also note, the ./var/cache directory should be empty when using Redis. If it isn't, you have mis-configured it.

First resolve the fact it isn't installing with the caches off.

8
  • It is installing with the caches off. It's when the caches are on that it's not installing.
    – Matthew G
    Mar 14, 2013 at 2:11
  • The configuration is cached. If you don't refresh it, your extension is not recognized. No extension. No Installation. Mar 14, 2013 at 7:53
  • There is no entry in the core_resource table . If there isn't an entry, it isn't installed. Mar 14, 2013 at 8:14
  • @FabianBlechschmidt "I've tried clearing all of the Magento caches through the admin panel"
    – Matthew G
    Mar 18, 2013 at 1:47
  • Just ignore the caches for now. Turn them off and ensure that the entry is created in core_resource - if it is not created, it is not installed. Mar 18, 2013 at 15:56
1

Before I get to an answer, and apologies for echoing what others are implying above, because you're

  1. Running a relatively old version of Magento

  2. Running a pre-release version of Magento

you're sort of off in the dessert by yourself. Beyond the obvious problems with your setup, most experienced Magento developers know that systems running an old version of the software are going to have countless system hacks and core customizations.

My guess if you're not actually clearing all your caches out — the only way to know for sure is to debug the configuration module loading and cache buildup in your system.

This old StackOverflow question has instructions for debugging setup resource problems. Start there. Per my guess, you may find that this part of the system can't see your setup resource configuration. If that's the case jump up to where the configuration is loaded and determine why it's not loading your configuration from cache.

I also threw together a module with a setup resource model that runs successfully on a stock 1.4.0.0-rc1 system. Try this one in your system and if you get the "Setup Resource is Loading" exception (which my setup resource script throws), then you know there's a problem that's specific to your module. Along those lines, its possible the scripting going on in your setup resource script acts different under cache and non-cache, and is being skipped by the system.

Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.