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

We used information provided here to help us solve the problem.

https://www.drupal.org/forum/support/upgrading-drupal/2011-08-30/databas...

Here is a note from my colleague:

"I have found that the “video embed field“ module has a database schema(schema version was set to -1) update, for this the alert was showing. I have manually set the schema version for that module, using the database Update command."

 

 

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. 

We used information provided here to help us solve the problem.

https://www.drupal.org/forum/support/upgrading-drupal/2011-08-30/databas...

Here is a note from my colleague:

"I have found that the “video embed field“ module has a database schema(schema version was set to -1) update, for this the alert was showing. I have manually set the schema version for that module, using the database Update command."

 

 

That's a good way to fix the problem once it has occurred, but doesn't explain why the schema version is not updated. My guess is that (if this is an upgraded site) the update process did not finish for some reason.

I had the same problem, with the status report showing Database updates were required. Running update.php reported no issues, yet the message was still shown.

I tried the suggestion from @argiepiano 

https://forum.backdropcms.org/comment/5183#comment-5183

but it resulted in no information.

So I tried the suggestion in 

https://forum.backdropcms.org/comment/5571#comment-5571

and this did provide more detail:

The uc_price_per_role module (and possibly others) has database schema updates to install

I checked the system table and saw that the schema_version for uc_price_per_role was set to -1. I manually changed this to 1000 to see if it fixed the problem, and it did. No more 'database update required' message.

I don't know how to find the root cause of this problem. It is on a site that was upgraded from D7, but the uc_price_per_role module wasn't used there (I only found out about it after moving to Backdrop).

Any suggestions would be welcome! I realise this may be something to report on the issue queue for uc_price_per_role but it may be something unique to my upgraded site and not a fault of that module at all.

[Update]

Now raised as an issue on the uc_price_per_role issue queue:

https://github.com/backdrop-contrib/uc_price_per_role/issues/13