After running drush up I got this error when installing uuid:

[ec2-user@ip-172-31-16-134 d7]$ drush en -y uuid
uuid was not found. [warning]
The following projects provide some or all of the extensions not found: [ok]
uuid
Would you like to download them? (y/n): y
Project uuid (7.x-1.0-alpha6) downloaded to sites/all/modules/uuid. [success]
Project uuid contains 4 modules: uuid_services_example, uuid_path, uuid_services, uuid.
The following extensions will be enabled: uuid
Do you really want to continue? (y/n): y
PHP Fatal error: Only variables can be passed by reference in /var/www/html/drupal-7.29/sites/all/modules/uuid/uuid.inc on line 164
PHP Stack trace:
PHP 1. {main}() /home/ec2-user/drush-6.x/drush.php:0
PHP 2. drush_main() /home/ec2-user/drush-6.x/drush.php:16
PHP 3. _drush_bootstrap_and_dispatch() /home/ec2-user/drush-6.x/drush.php:61
PHP 4. drush_dispatch() /home/ec2-user/drush-6.x/drush.php:92
PHP 5. call_user_func_array() /home/ec2-user/drush-6.x/includes/command.inc:182
PHP 6. drush_command() /home/ec2-user/drush-6.x/includes/command.inc:182
PHP 7. _drush_invoke_hooks() /home/ec2-user/drush-6.x/includes/command.inc:214
PHP 8. call_user_func_array() /home/ec2-user/drush-6.x/includes/command.inc:362
PHP 9. drush_pm_enable() /home/ec2-user/drush-6.x/includes/command.inc:362
PHP 10. drush_module_enable() /home/ec2-user/drush-6.x/commands/pm/pm.drush.inc:1009
PHP 11. module_enable() /home/ec2-user/drush-6.x/commands/core/drupal/environment_7.inc:143
PHP 12. drupal_load() /var/www/html/drupal-7.29/includes/module.inc:434
PHP 13. include_once() /var/www/html/drupal-7.29/includes/bootstrap.inc:1112
PHP 14. module_load_include() /var/www/html/drupal-7.29/sites/all/modules/uuid/uuid.module:11

Fatal error: Only variables can be passed by reference in /var/www/html/drupal-7.29/sites/all/modules/uuid/uuid.inc on line 164

Call Stack:
0.0003 258584 1. {main}() /home/ec2-user/drush-6.x/drush.php:0
0.0162 2497384 2. drush_main() /home/ec2-user/drush-6.x/drush.php:16
0.1035 6645208 3. _drush_bootstrap_and_dispatch() /home/ec2-user/drush-6.x/drush.php:61
0.4233 28981728 4. drush_dispatch() /home/ec2-user/drush-6.x/drush.php:92
0.6304 29537552 5. call_user_func_array() /home/ec2-user/drush-6.x/includes/command.inc:182
0.6304 29537888 6. drush_command() /home/ec2-user/drush-6.x/includes/command.inc:182
0.6305 29538456 7. _drush_invoke_hooks() /home/ec2-user/drush-6.x/includes/command.inc:214
2.5431 31887704 8. call_user_func_array() /home/ec2-user/drush-6.x/includes/command.inc:362
2.5431 31888040 9. drush_pm_enable() /home/ec2-user/drush-6.x/includes/command.inc:362
2.5435 31888656 10. drush_module_enable() /home/ec2-user/drush-6.x/commands/pm/pm.drush.inc:1009
2.5435 31888688 11. module_enable() /home/ec2-user/drush-6.x/commands/core/drupal/environment_7.inc:143
2.6686 32777704 12. drupal_load() /var/www/html/drupal-7.29/includes/module.inc:434
2.6689 32817384 13. include_once('/var/www/html/drupal-7.29/sites/all/modules/uuid/uuid.module') /var/www/html/drupal-7.29/includes/bootstrap.inc:1112
2.6689 32817648 14. module_load_include() /var/www/html/drupal-7.29/sites/all/modules/uuid/uuid.module:11

Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Only variables can be passed by reference in /var/www/html/drupal-7.29/sites/all/modules/uuid/uuid.inc, line 164

Comments

tripper54’s picture

Try changing line 164 of uuid.inc:

return uuid_create(UUID_TYPE_DEFAULT);

to

return uuid_create();

I can't check this as I don't have the PECL extension installed on my dev machine.

tripper54’s picture

Actually, after a bit more reading this is slightly complicated as a server could have one of two implementations of uuid_create().

If you have the PECL package installed, you'll get the fatal error above.

However if you have the OSSP module installed, you'll error out if a parameter is not passed to the function.

See http://codingforums.com/php/89152-php5-uuid.html

I guess a robust solution might be

$default = UUID_TYPE_DEFAULT;
return uuid_create($default);

Someone with the time to set up a couple of environments with the variants of uuid packages would need to test this.

skwashd’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

That error comes from using the OSSP UUID library. UUID for Drupal only supports the PECL UUID library. What I find strange here is that uuid_generate() checks to ensure that it is PECL UUID, not OSSP is being used before calling _uuid_generate_pecl().

dsteplight’s picture

The PECL UUID library not being installed makes sense. But have folks tried this patch https://www.drupal.org/node/2354877 ?

dsteplight’s picture

It should also be worth checking to see if Apache's Unique ID module is being loaded.

dsteplight’s picture

I spent a good amount of time finally solving this problems with the Director of IT at my job. Make sure PHP isn't loading the uuid module in it's config files. That was the case for us but also make sure Apache or your web sever isn't loading the module either.