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.
The following updates returned messages
image module
Update #7002
Failed: DatabaseSchemaObjectExistsException: Невозможно добавить поле %able.<em class="placeholder">field_image_width</em>: поле уже существует. в функции DatabaseSchema_mysql->addField() (строка 323 в файле /home/www/simbiozcomua/simbiozcomua/www/new/includes/database/mysql/schema.inc).
I `d add chech into image.install and all looks fine after that
with patch
# drush -ydv updatedb
Bootstrap to phase 0. [0.03 sec, 2.7 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [0.04 sec, 2.92 MB] [bootstrap]
Bootstrap to phase 2. [0.11 sec, 7.25 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.11 sec, 7.26 MB] [bootstrap]
Initialized Drupal 7.9 root directory at # [0.14 sec, 8.85 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.14 sec, 8.85 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.14 sec, 8.86 MB] [notice]
Found command: updatedb (commandfile=core) [0.27 sec, 9.48 MB] [bootstrap]
Initializing drush commandfile: drush_make [0.27 sec, 9.49 MB] [bootstrap]
Initializing drush commandfile: drush_make_d_o [0.28 sec, 9.49 MB] [bootstrap]
Initializing drush commandfile: user [0.28 sec, 9.49 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [1.96 sec, 22.89 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [1.96 sec, 22.89 MB] [bootstrap]
Successfully connected to the Drupal database. [1.96 sec, 22.89 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [1.96 sec, 22.89 MB] [bootstrap]
The following updates are pending:
image module :
7002 - Add width and height columns to image field schema and populate.
Do you wish to run all pending updates? (y/n): y
Running: /usr/local/bin/php /usr/local/bin/drush.php --php='/usr/local/bin/php' [command]
--root='#' --uri='http://default' updatedb-batch-process '95' --backend
2>&1 [4.48 sec, 49.7 МБ]
Bootstrap to phase 0. [39.89 sec, 49.77 МБ] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drush() [39.89 sec, 49.77 МБ] [bootstrap]
Bootstrap to phase 2. [39.89 sec, 49.77 МБ] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root() [39.89 sec, 49.77 МБ] [bootstrap]
Initialized Drupal 7.9 root directory at # [39.89 sec, 49.77 МБ] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [39.89 sec, 49.77 МБ] [bootstrap]
Initialized Drupal site default at sites/default [39.89 sec, 49.77 МБ] [notice]
Found command: updatedb-batch-process (commandfile=core) [39.89 sec, 49.78 МБ] [bootstrap]
Initializing drush commandfile: drush_make [39.89 sec, 49.78 МБ] [bootstrap]
Initializing drush commandfile: drush_make_d_o [39.89 sec, 49.78 МБ] [bootstrap]
Initializing drush commandfile: user [39.89 sec, 49.78 МБ] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [39.89 sec, 49.78 МБ] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [39.89 sec, 49.78 МБ] [bootstrap]
Successfully connected to the Drupal database. [39.89 sec, 49.78 МБ] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [39.9 sec, 49.79 МБ] [bootstrap]
Executing image_update_7002 [39.9 sec, 49.79 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.79 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.79 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.79 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.79 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.79 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.8 МБ] [notice]
Executing image_update_7002 [39.9 sec, 49.8 МБ] [notice]
Command dispatch complete [39.9 sec, 49.8 МБ] [notice]
Peak memory usage was 50.36 МБ [39.9 sec, 49.8 МБ] [memory]
Finished performing updates. [39.9 sec, 49.73 МБ] [ok]
Command dispatch complete [39.9 sec, 49.7 МБ] [notice]
Timer Cum (sec) Count Avg (msec)
page 39.576 1 39576.28
Peak memory usage was 51.53 МБ [39.91 sec, 49.7 МБ]
Comment | File | Size | Author |
---|---|---|---|
image_install_7002_field_bug.patch | 758 bytes | podarok | |
Comments
Comment #1
andypostPrabably this could happen when one field used in different entities
Comment #2
allella CreditAttribution: allella commentedSummary of Problem
Same issue here after upgrading from 7.8 to 7.9.
We have an image field that was used by multiple content types. The field name is field_image, and thus there is a corresponding tables named field_data_field_image and field_revision_field_image.
The image module's 7002 update did not run properly and never added the corresponding field_image_width and field_image_height columns to the aforementioned field tables. Thus the following error occurred.
Solution
First, modify the system table to make Drupal think it has never run update 7002 for the image module, by setting the last update value to that of the previous update, which was 7001.
Apply the patch above in comment #1 from the Drupal root directory, like this
Then run update.php (or drush updb) and the update should succeeded and add the missing width and height fields, along with the actual width and height values of any existing images.
Comment #3
jbrown CreditAttribution: jbrown commentedI've been unable to reproduce this, but the problem seems to be that if update 7002 does not complete for whatever reason, it needs to be started again from the beginning. However, this does not work because the db columns have already been added.
The patch in #0 fixes this problem by only adding the column if it does not already exist. This means the update can be run over and over again without any problems. (I have verified this)
So I think this is a good idea!
dup: #1335312: foo_width field already exist image field upgrade error ?
Comment #4
jbrown CreditAttribution: jbrown commentedComment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedi think we need to try a bit harder to find out how to reproduce this, so we can fix the underlying bug. i'm going to have a play with the suggestion in #1.
Comment #6
jbrown CreditAttribution: jbrown commentedIt uses the batch api, so if you have a lot of images and you close the browser window after the update has started then it would be impossible to complete the upgrade.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous commentedok, still looking, but i'm not sure we want to support "oh, it broke". that's why we tell people to do backups.
i'm mostly interested in a) verifying there's not an underlying bug, and/or b) making sure this works even for large data sets.
Comment #8
catchWe should not make this re-entrant, it is bad enough trying to maintain a working upgrade path that runs once, let alone twice, and like beejeebus says that's what backups are for.
Fixing the underlying bug and/or issues with large data sets sounds good though.
Comment #9
podarokhow to reproduce?
create more than one content types with shared field image between em in drupal 7.x< 7.9
after that - generate a few nodes for every content types (devel_generate FE)
upgrade to 7.9
run drush updatedb
here is a bug $)
without 7002 we have no possibility to add those nodes - error with schema
apply #1
run drush updatedb
schema fixed without errors
I`ll wait for RTBC
Comment #10
podarokchanging title due #9
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedawesome, trying that now, if we can reproduce with that, we should be able to turn this in to tests. or something.
Comment #12
podarokwhat kind of tests we can write for that?
Can QA infrastructure install previous version of drupal and make upgrade path ?
if Yes - then it is possible to write something like checking image_install_7002 before and after for making possible all the tables upgraded without skipped data tables
#0 already tested on huge site with 6 content types with shared image field on them
Comment #13
allella CreditAttribution: allella commentedI concur with the assessment of #9, so it does appear to be a bug.
Patch #0 worked for a site with an image field shared across two content types, but only by faking out the update.php to re-run 7002, as described in #2.
In addition to patch #0, should there be an update 7003 that checks if the width and height fields still don't exist and then runs the 7002 code only if they are still missing?
Thanks
Comment #14
jbrown CreditAttribution: jbrown commentedI can't reproduce this. I have created multiple image fields, put them into multiple content types and vocabularies, created enough content so the batch api has to take a second pass and tried it with both drush and running update.php manually.
Is it possible that people are using an old version of drush?
Is there an error output the first time the update is attempted?
Is drush timing out because a pass is taking too long?
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedyeah, i can't reproduce this either.
i created a bunch of content types, made sure that multiple pairs of them shared some image fields, used drush devel and created 5000 nodes, and couldn't get the fail.
is it possible someone who does see this could post a db dump? it's hard to move forward without that.
Comment #16
podarok#13
creating 7003 not good, cause 7002 generate error and stops update
#14 and #15
ok
I`ll try to upload sql dump with my config for making possible to reproduce a bug
Comment #17
podarok8((
I can`t reproduce my own bug
got backup and update to 7.9 without any problems at all
in #0 there was web update.php with error in batch api stopped due to javascript error (possibly browser 8( ) and restarting batch from semiupgraded 7002 generate error described by me in #0
patch #0 fix all my tables without errors and site now works well
Now I`d try several times to reproduce a bug "without success" - batch working well to the end and 7002 upgrade my tables with status OK
Possibly someone catch similar error - please reopen this issue with reproduce path
sorry...
Comment #18
Quarantine CreditAttribution: Quarantine commentedI'm posting here to say that I'm encountering the same problem as well after updating to 7.9 and then 7.10, but I'm unable to tell you how to reproduce it.
I saw this in my logs - not sure if it'll help any since I don't understand it much:
I can offer you my db dump but I'll only be able to give it to you in private.