When upgrading from 7.x-2.0-alpha3 to either 4 or 5 I get the following error message in my Drupal 7.8 install... If there's any specific information you need let me know and I will get it to you.

DatabaseSchemaObjectDoesNotExistException: Cannot add field video_queue.duration: table doesn't exist. in DatabaseSchema_mysql->addField() (line 320 of /includes/database/mysql/schema.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

heshanlk’s picture

If table doesn't exists that means you haven't install the module properly. Please check if you already have video_queue table exits?
We highly recommend to us http://drupal.org/project/videokit

nitmd’s picture

Version: 7.x-2.0-alpha5 » 7.x-2.0-alpha6

Updating to the latest video module gives me similar; I also tried uninstalling the old module and reinstalling the new, which didn't fix it. I am fairly new at drupal, and patching drupal core, as mentioned in the videokit page, is something I really don't want to touch. Is there any other solution? If I read phpmyadmin output correctly, the video_queue table does not exist.

video module
Update #7202

Failed: DatabaseSchemaObjectDoesNotExistException: Cannot add field video_queue.duration: table doesn't exist. in DatabaseSchema_mysql->addField() (line 320 of /home/xxx/public_html/xxx.com/drupal7/includes/database/mysql/schema.inc).

theullrich’s picture

Having the same problem. Idk what you mean about not installing it properly. I have been useing it for weeks now.

heshanlk’s picture

Status: Active » Closed (cannot reproduce)

Are you using MySQL? I tried on MySQL and there was no any issue.

revu’s picture

Mine is the same issue and I am using MySQL :(

heshanlk’s picture

Please check do you already have video_queue table installed?

revu’s picture

No, I can't find video_queue table in the database.

heshanlk’s picture

It seems your installation has failed when you install video module. It should be there if you successfully install the video module. Let me know which is the version you used?. Please try re-installing module and see video_queue is there? and they try upgrading the module. I cannot see any possible issues why video_queue missing on your system. I haven't faced any such situation when I install and upgrade the module. Please confirm after upgrade of the new installation. Its possible to upgrade from 7.x-2.x version to any later versions of video module.

heshanlk’s picture

Title: Error while applying database update 7202 - Alter video_queue table to add video duration. » Update 7202 - missing video_queue table.
nitmd’s picture

I tried deleting the video module from the command line, because the module page wouldn't let me do it. I reinstalled and had the same problems as above. Today I tried uninstalling it from the module page, but although I have deleted the video fields in my content (seemed the only way to get this done), now it won't let me delete it because:

Required by: Drupal (Fields pending deletion)

I can't find any information on getting the fields to get past this pending status, so I can't uninstall. I am using mysql.

kbenn’s picture

Same error after updating to drupal 7.8 and module video-7.x-2.1-alpha2

revu’s picture

I have the latest one 7.x-2.1-alpha2. I just managed to reinstall the module and it went without any glitches but when it came to update the database, the same error message as below appeared. It is just a bug?:


The following updates returned messages
video module
Update #7202

    Failed: DatabaseSchemaObjectDoesNotExistException: Cannot add field <em class="placeholder">video_queue</em>.<em class="placeholder">duration</em>: table doesn't exist. in DatabaseSchema_mysql->addField() (line 320 of ...\includes\database\mysql\schema.inc).

heshanlk’s picture

Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

Please provide steps to re-produce this error.

revu’s picture

now when I created a new video content type and tried to upload the video, the following error message is displayed and it seems to again point towards same database link missing. Is there a way i could do it manually or how can I get back to previous version of the module?


An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: .../?q=file/ajax/field_video_display/und/form-RMbaeEBXY4gWn9RNyd2iEZQ0T9IHeLO81LadcNpa9fc
StatusText: n/a
ResponseText: 
Resource homepage Find your resources here!        
Error          
Error message
Notice: Undefined property: stdClass::$vid in _video_field_file_autoconversion() (line 168 of ...\sites\all\modules\video\video.field.inc).
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal77.video_queue' doesn't exist: SELECT f.*, vf.vid, vf.nid, vf.dimensions, vf.data, vf.status as video_status
FROM {video_queue} vf LEFT JOIN {file_managed} f ON vf.fid = f.fid WHERE f.fid=vf.fid AND f.fid = :fid; Array
(
[:fid] =&gt; 37
)
in TranscoderAbstractionFactory-&gt;loadJob() (line 237 of ...sites\all\modules\video\includes\TranscoderFactory.inc).
The website encountered an unexpected error. Please try again later.          

ReadyState: undefined
heshanlk’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Every one should note that there is no any direct upgrade method to 7.x-2.x version from older version of video module ie. 7.x-1.x. You have to manually upgrade your module as its a little bit of tricky task.

revu’s picture

So what is the process/procedure that we need to follow if we want to do it all over again without running into any dead ends? I'll uninstall the version, clear fields in database and then what?

Normally one would again install the module. But this hasn't worked here. Can you please outline how you would do? Thanks Heshan!

heshanlk’s picture

Please read the release note beforehand.

nitmd’s picture

On the command line, downloaded the video module, deleted the old module, extracted the new module, ran update.php Same 7202 error. I, too, would appreciate instructions on how to manually update the database to allow installation of the new module.

Also, from the main page:

7.x-2.x version comes with Zencoder so to work it properly you have to install couple of additional module.
You can download all relevant module from VideoKit profile http://drupal.org/project/videokit
How to configure Zencoder with 7.x-2.x version http://heididev.com/video-module-7x-2x-configure-zencoder

Does that mean one MUST patch drupal core to use the video module?

Note: obviously, from the successful installation note below, patching core is not necessary for installation of the module. I suppose the question still applies for use of Zencoder.

heshanlk’s picture

Follow these steps.
1. Uninstall the video module (Go to module page on website and uninstall from there).
2. Copy the latest version and install the module
3. Check if you have installed the video_queue, video_output tables

nitmd’s picture

This is the process I followed at least twice before; just did it again but got a different result. After uninstall through drupal, when I tried to reinstall it, drupal reports that video is already installed. Go to the command line, delete video. Go back into drupal, reinstall video. This time the update runs without error. Once the modules are activated the video_queue and video_output fields are present.

Thank you.

kbenn’s picture

I followed these steps delete video, and reinstall video-7.x-2.x-dev.
I update and have this error :
Update #7202

* Failed: DatabaseSchemaObjectDoesNotExistException : Impossible d'ajouter le champ video_queue.duration : la table n'existe pas. dans DatabaseSchema_mysql->addField() (ligne 320 dans /homez.232/neotissi/www/cms/includes/database/mysql/schema.inc).

video_queue and video_output fields are not present in mysql ?

What is the issue ?

nitmd’s picture

When I checked during my installation, I found the tables did not exist in mysql until the module was activated.

aacraig’s picture

The tables in question are created when the module is first installed.

It looks like these tables were added in at some point but no update installs the tables for those who had the module installed before the tables were added, and have simply followed the upgrade path as releases have been added.

The module author should release a new update that adds these tables, as it's clear this problem is affecting a number of people (anyone who installed the module prior to the existence of these tables).

If it helps, Drush updated me today directly from 7.x.1 to 7.x.2, which may explain the problem?

At any rate, for those of you who, like me, cannot simply uninstall the module and reinstall it (which DOES solve the problem) as you will lose any configuration settings (and all other data in the video* tables that get removed as a part of the uninstall process) here is some code to add the tables.

I have put this code in my own custom module's .install file. If you don't have a custom module, you may want to create one and add this code to it.

Of course the best place for this code would be in the Video module's .install file as an update :)

Here's a step-by-step guide for those of you who aren't developers.

Create a folder in your modules directory:

$ cd sites/all/modules/contrib
$ mkdir mymodule

In the directory, create a file called mymodule.info and insert the following

name = Temporary module
description = Temporary fix for Video tables
package = Other
core = 7.x

Create a second file called mymodule.install and insert the following

function mymodule_install() {
  // video queue
  $schema['video_queue'] = array(
    'description' => 'Store video transcoding queue.',
    'fields' => array(
      'vid' => array(
        'description' => t('Video id, the primary identifier'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'fid' => array(
        'description' => 'The {file_managed}.fid being referenced in this field.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => 'The {node}.nid being referenced in this field.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'description' => 'Status of the transcoding, possible values are 1, 5, 10, 20',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'dimensions' => array(
        'description' => 'The dimensions of the output video.',
        'type' => 'varchar',
        'length' => '255',
        'default' => '',
      ),
      'duration' => array(
        'description' => 'Stores the video duration in Sec.',
        'type' => 'int',
        'default' => 0,
      ),
      'started' => array(
        'description' => t('Start timestamp of transcodings'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'completed' => array(
        'description' => 'Transcoding completed timestamp',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'data' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of converted files.
          Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
      ),
    ),
    'indexes' => array(
      'status' => array('status'),
      'file' => array('fid'),
    ),
    'primary key' => array('vid'),
  );
  // video preset
  $schema['video_preset'] = array(
    'description' => 'The preset table.',
    'fields' => array(
      'pid' => array(
        'description' => 'The primary identifier for a video preset.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The name of this preset.',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => 'A brief description of this preset.',
        'type' => 'text',
        'size' => 'medium',
        'translatable' => TRUE,
      ),
      'settings' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'Serialized preset settings that do not warrant a dedicated column.
          Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
      ),
    ),
    'unique keys' => array(
      'name' => array('name'),
    ),
    'primary key' => array('pid'),
  );
  // video thumbnails
  $schema['video_thumbnails'] = array(
    'description' => 'The video thumbnails table.',
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'Foreign Key {video_queue}.fid.',
      ),
      'thumbnails' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'Serialized array of thumbnails data.
          Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
      ),
    ),
    'indexes' => array(
      'thumbnail' => array('vid'),
    ),
    'foreign keys' => array(
      'thumbnails' => array(
        'table' => 'video_queue',
        'columns' => array('vid' => 'vid'),
      ),
    ),
  );
  // video converted file reference
  $schema['video_output'] = array(
    'description' => 'Track file id for conveted files.',
    'fields' => array(
      'vid' => array(
        'description' => 'Video ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'original_fid' => array(
        'description' => 'Original File ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'output_fid' => array(
        'description' => 'Converted file fid.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'job_id' => array(
        'description' => 'Referenced job id if any.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => NULL,
      ),
    ),
    'primary key' => array('vid', 'original_fid', 'output_fid')
  );

  $ret = array();
  foreach ($schema as $table_name => $table_schema) {
    if (!db_table_exists($table_name)) {
      db_create_table($table_name, $table_schema);
    }
  }

  return $ret;
}

Then enable your module in your preferred method.

I did this as an update, so I haven't tested this as part of the install process. If you have trouble, change the name of the function to 'mymodule_update_7001', then enable and run update.php

In the end, you'll get the new tables added without having to delete any existing data.

revu’s picture

Yes, you need to follow the steps very closely or else it will not work. Also remember to put site on maintenance mode as you would do with any upgrades. Read more here, if you need to: http://drupal.org/upgrade

I also had similar issues but I was probably jumping steps until Heshan caught me :P

aacraig’s picture

True, though it looks like this new version of Video is a fairly radical departure from the 7.x.1 branch. Patching core is pretty scary.

In fact, even with the tables added in correctly, there are too many changes so the only solution is to uninstall and reinstall.

heshanlk’s picture

Patching core is pretty scary.

7.x-2.x is complete redesign and there is no patch apply to the core.

I will release never version of the module with more tested results, unfortunately all the time I install the video module the video_queue table was there so ntng to reproduce the issue you have.

As far as I believe this could happen if you try to upgrade from 7.x-1.x and in release note I clearly mentioned there is no direct upgrade method. You have to manually upgrade the module.

nitmd’s picture

Perhaps some of the confusion is in how to manually upgrade the module.

studiotaffi’s picture

Hi Heshan!

Is it a problem if we build manually the tables from the mysql prompt?
Can you give us the columns description to do that?

I've the same issue... it's not possible to start from scratch with the module installation if you already have many videos already uploaded.

thank you!

Marco

cvining’s picture

When trying to uninstall Video, I got that "Fields Pending Deletion" issue. There was a lingering video field entry in the 'field_config' table. Delete that entry (using phpMyAdmin, say), then I was able to go ahead and uninstall Video module.

-- Cronin

Pyro411’s picture

Sorry I did not see the case updates, I manually removed the files and pushed the files from the new package up via scp after doing that the database updated properly.

pengie’s picture

Ok. This is a seemingly impossible task.

Have removed all the tables I can from php admin that involve the word video. Have deleted all content types involving video. No video to be seen at all anywhere in my installation as far as I know. Deleted cache, run cron... close browser, reopen.

Downloaded latest release. Extracted. Uploaded. Install. Update... get 7202 error.

Check database, still no video tables to be seen. None are created when I install the module.

I assume that I have manually installed, but seriously? Is there something I am missing? I've spent over 3 hours trying to get this module to work. I DO NOT want to use youtube to display videos.

Ron Williams’s picture

When using http://drupal.org/node/1275154#comment-4990420, you must have a blank mymodule.module file to enable the module. This is required in cases where the site does not have a custom module already.

pengie’s picture

After reading through this post again... Went through and checked field_config in the database... sure enough there was a video field in there that wasn't displaying on the site.

If after multiple reinstalls you are having this issue. CHECK THERE!

Now it works great, sorry for my previous aggravated posting.

porg’s picture

I upgraded from 6.x-4.x-dev to 7.x-2.2-beta3 (published 2011-09-27) and got the same error message as the issue submitter.

Can I just ignore that message?
Will there be a module update?
Must I perform a manually fix at my installation?

heshanlk’s picture

You should manually fix it.

marcorai’s picture

Aaron's code (http://drupal.org/node/1275154#comment-4990420) with blank mymodule.module file works for me.

Anyway, I have this issue during migration about the field field_video: "Missing field module: 'filefield'. This field cannot be migrated".

Any ideas? The issue is reported here: http://drupal.org/node/1295286

porg’s picture

How?

Nicholas Cook’s picture

Version: 7.x-2.0-alpha6 » 7.x-2.2-beta5

(#23) thanks aacraig for this, worked perfectly for me. updated and happy with no loss of data :)

citricguy’s picture

FileSize
1.73 KB

(#23) worked perfectly. I needed to add one additional empty file (likely due to a stupid hack I made) but worked after adding mymodule.module to the directory.

Thank you for writing out the instructions @aacraig You saved me days of time.

mgifford’s picture

Thanks for the zip @citricguy - that worked for me.

Trick is why isn't this fixed in the .install so that we don't run into this in the first place?

aacraig’s picture

It's not in .install because the module author opted to not offer an automated upgrade path from the previous version to this one.

kyletaylored’s picture

Issue summary: View changes
Status: Closed (works as designed) » Needs review
FileSize
6.11 KB

This does not work as designed, and a simple patch can fix it.

I'm working on a site running 7.x-2.10, and the error still persists. By taking the update from #23, just prepend it to update 7202 since that is the update that fails.

If the tables already exists, no problem, it'll just skip them. But if they don't exist, this will create the tables and let the rest of the updates continue without halting.

kyletaylored’s picture

Version: 7.x-2.2-beta5 » 7.x-2.11
TonyK’s picture

Title: Update 7202 - missing video_queue table. » Drupal 6 to 7 upgrade path is broken
Status: Needs review » Active

Up.

Drupal 6 version of the module doesn't have video_queue, video_preset and video_thumbnails module. You should write hook_update_7000() to correctly move the data from the old tables.

heshanlk’s picture

Category: Support request » Bug report
kyletaylored’s picture

Title: Drupal 6 to 7 upgrade path is broken » Update 7202 - missing video_queue table
Version: 7.x-2.11 » 7.x-2.x-dev
Status: Active » Needs review

@tonyk, I think the Drupal 6 to 7 upgrade path should be a new issue since this is specifically a 7.x issue. No need to complicate things and bloat the patches.

re-tested patch against the latest dev, still applies cleanly.

heshanlk’s picture

Status: Needs review » Fixed

  • heshanlk committed 07cfef8 on 7.x-2.x authored by kyletaylored
    Issue #1275154 by kyletaylored: Update 7202 - missing video_queue table
    

Status: Fixed » Closed (fixed)

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