Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Upgrading fails because of a missing file_usage table. See error below.
System module
Update #7059
* Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'core.file_usage' doesn't exist: SELECT 1 AS expression FROM {file_usage} file_usage WHERE (fid = :db_condition_placeholder_0) AND (module = :db_condition_placeholder_1) AND (type = :db_condition_placeholder_2) AND (id IS NULL ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => 4 [:db_condition_placeholder_1] => file [:db_condition_placeholder_2] => node ) in file_usage_add() (line 608 of /Users/erik/www/core/includes/file.inc).
If the database has been anonymized sufficiently I will upload it.
Comment | File | Size | Author |
---|---|---|---|
#8 | 895032-6.patch | 1.02 KB | pbuyle |
#5 | 895032-5.patch | 4.09 KB | clemens.tolboom |
#4 | db895032.sql_.zip | 277.53 KB | Sutharsan |
#3 | system-missing_table_file_usage-895032-3.patch | 3.6 KB | Sutharsan |
Comments
Comment #1
Sutharsan CreditAttribution: Sutharsan commentedComment #2
catchComment #3
Sutharsan CreditAttribution: Sutharsan commentedIn system_update_7059() the {file_update} table is used while it is only created in system_update_7060().
This patch moves create table the code form system_update_7060() to system_update_7059().
Comment #4
Sutharsan CreditAttribution: Sutharsan commentedAttached database to reproduce this issue and #895088: Upgrade fails
Comment #5
clemens.tolboomAs system_update_7060 is now empty we need to adjust user_update_dependencies to point to system_update_7059
Comment #6
catchLooks great.
Comment #7
webchickGreat! Committed to HEAD. Thanks!
Comment #8
pbuyle CreditAttribution: pbuyle commentedIf the upload table does not exists on the upgraded site, the file_usage will not be created because of the check at the beginning of system_update_7059. Also, system_update_7059 can be run multiple times since it process batches of 500 files at a time. At the second run, an DatabaseSchemaObjectExistsException is thrown.
Here as patch to separate table creation and upload migration and avoid these issues.
Comment #9
pbuyle CreditAttribution: pbuyle commentedComment #10
marvil07 CreditAttribution: marvil07 commentedThis is needed for solving #895176: Upgrade fails because of integrity constraint violation in system_update_7060, and after testing it against the other issue(see the database at #895176-3: Upgrade fails because of integrity constraint violation in system_update_7060) we can get the real error mentioned in the mentioned issue.
Comment #11
webchickMarco discussed this with me in person, and said it's RTBC. So, committed to HEAD. :)
Comment #12
groovehunter CreditAttribution: groovehunter commentedGot almost same error with current snapshot, after a while, playing with it and installing some mods, views, rdfx,...
update.php doesnt fix it.
Comment #13
groovehunter CreditAttribution: groovehunter commentedjust to note an error resulting from that
using rdfx / rdfui module and entering a RDF predicate for the voc on
http://drupal7/admin/structure/types/manage/page/fields/field_myvoc1
Comment #14
groovehunter CreditAttribution: groovehunter commentedjust to get the table created i helped me by executing per web
before i outcommented the check for existing update table
throws errors but at least the table is created and as my installation is fresh there are no uploads resp. files yet
Comment #15
David_Rothstein CreditAttribution: David_Rothstein commentedCross-linking this to its HEAD to HEAD issue, for those who care: #905776: #895032 - Update for creating the {file_usage} table