Sort of urgent: New db column seems to be ignored

Hi! I have a site running CakePHP v3, and we’re delivering meals to the elderly/vulnerable people in the midst of coronavirus, and a weird behavior I see from time seems to be rearing its ugly head again.

Basically, I have a dev server and a prod server, and I just added a column to my postgres database, and on dev, everything works fine, but on prod, it seems to ignore the fact I just added a new column. By this I mean, I try to select that column’s value, and on dev it populates, but on prod it returns null.

I am guessing it has something to do with model caching. It is possible that I have some other error, but I have seen this a couple other times and never did figure it out back then. I tried deleting the relevant model file in my tmp/cache directory but it didn’t seem to do anything.

Does this sound familiar to anyone else? Worst case I can probably just stick the relevant data into a column that already exists that I’m not using, but that’s bad practice obviously


try to refresh orm_cache
bin/cake orm_cache clear

Thanks for the quick reply!

Unfortunately this didn’t fix the problem for me

from your description this should be it, but well things happen you might try

  1. bin/cake cache clear_all if it wont help then:
  2. delete /tmp/cache/models dir

Hmmmm, got this when trying bin/cake cache clear_all

2020-03-20 21:25:08 Error: Fatal Error (1): APCuIterator::__construct(): APC must be enabled to use APCuIterator in

in app.php you have set APCu cache somewhere and maybe even you are not using it

hmmmm, here is my cache settings:

'Cache' => [
    'default' => [
        'className' => 'Apcu',
        'path' => CACHE,
        'url' => env('CACHE_DEFAULT_URL', null),

     * Configure the cache used for general framework caching.
     * Translation cache files are stored with this configuration.
     * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
     * If you set 'className' => 'Null' core cache will be disabled.
    '_cake_core_' => [
        'className' => 'Apcu',
        'prefix' => 'myapp_cake_core_',
        'path' => CACHE . 'persistent/',
        'serialize' => true,
        'duration' => '+1 years',
        'url' => env('CACHE_CAKECORE_URL', null),

     * Configure the cache for model and datasource caches. This cache
     * configuration is used to store schema descriptions, and table listings
     * in connections.
     * Duration will be set to '+2 minutes' in bootstrap.php when debug = true
    '_cake_model_' => [
        'className' => 'Apcu',
        'prefix' => 'myapp_cake_model_',
        'path' => CACHE . 'models/',
        'serialize' => true,
        'duration' => '+2 minutes',
        'url' => env('CACHE_CAKEMODEL_URL', null),

well then you probably have this module disabled for php in cli you would need to find php.ini for cli and enable it there
you might try to enable debug kit and there is also button to clear cache from web page