Hi,

I tried to download and enable Yubikey 7.x-2.x-dev via drush and got this:

Project yubikey (7.x-2.x-dev) downloaded to                          [success]
/home/asrob/public_html/sites/all/modules/yubikey.

asrob@alpaca [~/public_html]# drush en -y yubikey

The following extensions will be enabled: yubikey
Do you really want to continue? (y/n): y

WD php: DatabaseSchemaObjectExistsException: Table yubikey_blocked already exists. in DatabaseSchema->createTable() (line 652 of /home/asrob/public_html/includes/database/schema.inc).
Cannot modify header information - headers already sent by (output started at /home/asrob/.drush/includes/output.inc:37)
bootstrap.inc:1239
DatabaseSchemaObjectExistsException: Table <em class="placeholder">yubikey_blocked</em> already exists. in DatabaseSchema->createTable() (line 652 of /home/asrob/public_html/includes/database/schema.inc).

Drush command terminated abnormally due to an unrecoverable error.   [error]
CommentFileSizeAuthor
#6 bugfix-db.diff577 bytesrasmuslp

Comments

toddejohnson’s picture

Hmm this sounds like the module had already been installed on the site. Was this a fresh install of Drupal and the first time you installed the yubikey module?

asrob’s picture

Not exactly. I installed Drupal due to something else then installed yubikey module today. Tomorrow, I'll try this again with fresh Drupal installation.

asrob’s picture

Hi toddejohnson,

sorry for the delay. Well, I installed a fresh Drupal 7.12 and the latest -dev version of this module via drush and got the same error like above. Have you any idea? Or do I provide more/further information?

toddejohnson’s picture

I will have to give it a try. The software should continue to work. Do you experience any other errors? I haven't been able to test the 7.x branch with drush. It is on my todo list. Thank you for the report!

rasmuslp’s picture

I tried installing this using Drush 4.4 on a fresh Drupal 7.12 (upgraded from 7.0), and got similar results. I did this on a QuickStart VM that I upgraded before trying.

drush pm-enable yubikey
The following extensions will be enabled: yubikey
Do you really want to continue? (y/n): y
WD php: DatabaseSchemaObjectExistsException: Table yubikey_blocked already exists. in DatabaseSchema->createTable() (line 652 of                   [error]
/home/quickstart/websites/example.dev/includes/database/schema.inc).
DatabaseSchemaObjectExistsException: Table <em class="placeholder">yubikey_blocked</em> already exists. in DatabaseSchema->createTable() (line 652 of /home/quickstart/websites/example.dev/includes/database/schema.inc).
Drush command terminated abnormally due to an unrecoverable error.

Disabling and reenabling, however, seems to solve the issue.

rasmuslp’s picture

StatusFileSize
new577 bytes

Since Drupal 7,hook_schema is called by Drupal before hook_install and after hook_uninstall, hence there is no need to call it manually from these. As a matter of fact, this is what causes the warning.

Diff attached.

rasmuslp’s picture

Status: Active » Needs review
toddejohnson’s picture

Assigned: Unassigned » toddejohnson

Thank You!!! I will get this added.

Leeteq’s picture

Great, are we far away from an updated -dev release for the project page? Hard to recommend others testing this module as long as that version is causing such messages.

toddejohnson’s picture

Status: Needs review » Fixed

I have committed #6's fix for this to the 7.x-2.x branch.

Status: Fixed » Closed (fixed)

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