Drupal 6.20 ->7.0 site
7001 - Removes {imce_files} in favor of {file_usage} never finish. Left if running for almost two hours but the only thing that happen is that is consume a lot of CPU. "drush updatedb" fails after a few minutes with:

Error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 260 bytes) in /Applications/drush/includes/context.inc, line 2254

Had a look into imce_files table but there is just a few files there:

SELECT * FROM `imce_files`
    -> ;
+-----+
| fid |
+-----+
|  17 | 
|  18 | 
|  19 | 
|  20 | 
| 118 | 
| 119 | 
| 120 | 
| 121 | 
+-----+
8 rows in set (0.00 sec)

Some quick debugging where I dump the result and break out of the upgrade:

  $result = db_query_range('SELECT i.fid FROM {imce_files} i INNER JOIN {file_managed} f ON i.fid = f.fid WHERE i.fid > :fid ORDER BY i.fid', 0, $limit, array(':fid' => $sandbox['last_fid_processed']))->fetchAll();
  var_dump($result);
  return;

But it returns a empty array:
array(0) {
}
Attaching the content of the "file_managed" table. Pls let me know if there more I can do to help you out.

--
Steinmb

Comments

ufku’s picture

Status: Active » Needs review
StatusFileSize
new1.4 KB

I think the count query should be SELECT COUNT(*) FROM {imce_files} i INNER JOIN {file_managed} f ON i.fid = f.fid

The patch also adds a progress check to prevent an infinite loop.

steinmb’s picture

Before I test the patch I wanted to let you know that the count query is returning "8" something that I think is correct according to the content of "imce_files".

steinmb’s picture

Rrrright, without further due tested I the patch. 7001 is now getting out the loop but I'm unable to find any of the fid from imce_files in file_managed that is identical to the attached text file in #1. This should also be checked some how before we destroy the org. data table.

adellefrank’s picture

subscribing

ufku’s picture

StatusFileSize
new2.79 KB

It appears IMCE needs to migrate its own files to the new {file_managed} table. I somehow thought that the core already migrated all files from {files} table.

Attached patch also fixes an error in update_7000.

ufku’s picture

Status: Needs review » Fixed

This was committed. Feel free to re-open in case the bug is still there.

steinmb’s picture

Sorry about the missing feedback on #5, have been unable to find time to proper test it. I'll reopen if needed.
Thanx! :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.