When I clear the cache in Windows and access the admin/content page, all the developers that are using Linux (Ubuntu 14) gets this error.

Fatal error: Call to undefined function Drupal\Component\Uuid\com_create_guid()

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

felribeiro created an issue. See original summary.

felribeiro’s picture

Issue summary: View changes
catch’s picture

Version: 8.0.0-rc3 » 8.0.x-dev
Priority: Critical » Major

This is because the uuid class is registered in container build.

Can you confirm whether rebuild.php fixes it?

If so then container portability between environments isn't critical for me, but it certainly would be major/rc target.

catch’s picture

Also could you confirm if you're using a shared development database - i.e. each developer connecting from their own machine to the same database server?

felribeiro’s picture

If I execute "drush cache-rebuild" in a Linux, it return to works fine.

We are using a shared development database.

catch’s picture

Title: Fatal error: Call to undefined function Drupal\Component\Uuid\com_create_guid() » CoreServiceProvider::registerUuid() assumes all environments have the same functions available

Re-titling.

Chetabahana’s picture

From PHP 5.4.5, COM and DOTNET is no longer built into the php core.
Applying extension=php_com_dotnet.dll on Windows to add COM support in php.ini seems to work.

I'm installing Zircon 8 on Linux Apache/2.4.16 (Amazon) OpenSSL/1.0.1k-fips PHP/5.6.17 here, I have tried to add extension=php_com_dotnet.so in php.ini but the error is still persist.

Finaly by enable debugging I can solve this problem by create GUIDs manually:
Take a look on the core/lib/Drupal/Component/Uuid/Com.php file.

Change the following code:

return strtolower(trim(com_create_guid(), '{}'));

with this code:

mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.
$charid = strtoupper(md5(uniqid(rand(), true)));
$hyphen = chr(45);// "-"
$uuid = chr(123)// "{"
            .substr($charid, 0, 8).$hyphen
            .substr($charid, 8, 4).$hyphen
            .substr($charid,12, 4).$hyphen
            .substr($charid,16, 4).$hyphen
            .substr($charid,20,12)
            .chr(125);// "}";
return strtolower(trim($uuid, '{}'));
alexpott’s picture

Status: Active » Needs review
FileSize
797 bytes

So the container being moved to the database as caused this. One simple solution would be to add the OS into the container key. This can be done by setting the deployment_identifier in settings.php. Another solution would to do this...

@hyipscript we already have a php implementation for UUID generation - see Drupal\Component\Uuid\Php which is the fallback is OS specific methods aren't available.

dawehner’s picture

You could also run into a case with once a pecl extension installed and once without it. In general I think we should document why we are adding specific bits here.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Tregonia’s picture

I have been getting these errors on a D7 -> D8 migration. Applying patch 2614202.8.patch from #8 resolved the issue.

Fatal error: Call to undefined function Drupal\Component\Uuid\com_create_guid() in E:\drupal\core\lib\Drupal\Component\Uuid\Com.php on line 21
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Call to undefined function
Drupal\Component\Uuid\com_create_guid() in
E:\drupal\core\lib\Drupal\Component\Uuid\Com.php,
line 21
PHP Fatal error:  Call to undefined function Drupal\Component\Uuid\com_create_guid() in E:\drupal\core\lib\Drupal\Component\Uuid\Com.php on line 21

Note:: this is from a WAMP environment

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

I doubt we can really test this.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Let's add the docs mentioned in #9.

alexpott’s picture

Status: Needs work » Needs review
FileSize
1.31 KB

Expanded the docs.

alexpott’s picture

I've created #2709769: DrupalKernel::getContainerCacheKey() should include some dynamics about PHP to discuss whether we should include a few more things in the container key.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Cool

tim.plunkett’s picture

+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -750,11 +750,20 @@ public function updateModules(array $module_list, array $module_filenames = arra
+   * - The operating system running PHP. This allows compiler passes to optimise

optimize

alexpott’s picture

oh lol

alexpott’s picture

dawehner’s picture

He, well I couldn't see a problem with that.

  • catch committed 9067e6f on 8.2.x
    Issue #2614202 by alexpott, felribeiro, dawehner, catch:...

  • catch committed 066188e on 8.1.x
    Issue #2614202 by alexpott, felribeiro, dawehner, catch:...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.2.x and cherry-picked to 8.1.x. Thanks!

Status: Fixed » Closed (fixed)

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