Backdrop is indicating that the database needs to be updated, but when we run the update script, it tells us "no pending updates." 

We would like turn off this warning or figure out if there are actually updates that need to be run. Any thoughts on how to debug this?

This site does use CiviCRM. 

I've cleared the cache and run cron. What am I missing?

Most helpful answers

It'd be helpful to know which module is the culprit for the false positive. Can you try running the following in the Execute PHP field with Devel?

foreach (module_list() as $module) {
  $updates = backdrop_get_schema_versions($module);
  if ($updates !== FALSE) {
    $current_schema = backdrop_get_installed_schema_version($module);
    $latest_schema = end($updates);
    if ($current_schema < $latest_schema) {
      dpm($module, 'module');
      dpm($current_schema, 'current schema');
      dpm($latest_schema, 'latest schema');
    }
  }
}


 

Comments

Olafski's picture

The same has been happening to me, very strange! It's on a site without CiviCRM, btw. What else could our sites have in common?

Sometimes the message about database updates goes away, but it reappears after clearing all caches.

I don't suppose you know what modules have recently been updated?

Olafski's picture

I don't suppose you know what modules have recently been updated?

In theory yes, made some notes and can have a look (I guess, not before next week).

It'd be helpful to know which module is the culprit for the false positive. Can you try running the following in the Execute PHP field with Devel?

foreach (module_list() as $module) {
  $updates = backdrop_get_schema_versions($module);
  if ($updates !== FALSE) {
    $current_schema = backdrop_get_installed_schema_version($module);
    $latest_schema = end($updates);
    if ($current_schema < $latest_schema) {
      dpm($module, 'module');
      dpm($current_schema, 'current schema');
      dpm($latest_schema, 'latest schema');
    }
  }
}


 

@argiepiano 

Running that code in devel did not generate any response. Does DPM work in devel execute PHP field? I also tried with print statements. 

Also tried alternative version provided in Zulip:

foreach (module_list() as $module) {
  $updates = backdrop_get_schema_versions($module);
  if ($updates != FALSE) {
    $current_schema = backdrop_get_installed_schema_version($module);
    $latest_schema = end($updates);
    if ($current_schema < $latest_schema) {
      debug($module);
    }
  }
}

Going to experiment a bit more with this over weekend to see if I did something wrong.

I have tested with both the php code above , but did not get any module which has updates still. But what I found was - 

1. Got only one module which was update (Update manager) had updates. 

2. But the currently installed version schema and the latest schema version were same.

 

Olafski's picture

I've finally had a look which modules have been updated on my site, and found something interesting:

The issue (Database update warning - but no pending updates) happened only in the "dev" environment of the site. In contrast to the production site, the dev environment has the References module installed. It is disabled, but it's there, and I updated it from 1.x-1.0.2 to 1.x-1.0.3.

@ – is the References module installed on your site?

@Olafski - No, I don't have the References module installed on this site at all.