Page MenuHomePhabricator

MW 1.39 installation error: Call to undefined function Wikimedia\UUID\getmyuid()
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue

  • Install MediaWiki 1.39 with PHP 8.0 and/or 8.1

What happens?
An error occurs on the account creation step of fresh installation (no idea about if it's occurs on updates too). When I rollback to PHP 7.4, installation of MW 1.39 completing successfully.

What should have happened instead?

  • It should have created first account of a fresh install without any error, and continue to complete installation.

Software version

  • MediaWiki: 1.39
  • PHP: 8.0 and/or 8.1
  • Apache: 2.4.54
  • MySQL: 10.3.37-MariaDB
  • OS: Linux

Other information

mw-139-php8081-error.jpg (1×2 px, 1 MB)

Event Timeline

Aklapper renamed this task from MW 1.39 installation error on PHP 8.0/8.1 to MW 1.39 installation error: Call to undefined function Wikimedia\UUID\getmyuid().Dec 5 2022, 9:32 PM

The function was added to fix T268420

The call to getmyuid() is in namespaced code, but php search first in the global namespace for the function and when there is no such function, it is using the namespaced one. So the error with the namespaced name indicates (for me) that the global function getmyuid does not exists.

It is possible that the server host disabled this function?

https://www.php.net/manual/en/function.getmyuid.php

You're right @Umherirrender, I've contacted my service provider and they say that they've disabled getmyuid for security reasons (shared hosting).

But isn't it weird that I don't get this error on PHP 7.4?

From the code I see no reason why for the same MediaWiki version, but different php version, the function should work/exists and for the other not.

Maybe the provider has only security aspects on the newer php8 and has not disabled it on older php or the way to disable this function has not worked on older php.
Not sure about that.

Code is at https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/REL1_39/includes/libs/uuid/GlobalIdGenerator.php#100

Change 865167 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] uuid/GlobalIdGenerator: Check if getmyuid() exists

https://gerrit.wikimedia.org/r/865167

Change 865167 merged by jenkins-bot:

[mediawiki/core@master] uuid\GlobalIdGenerator: Check if getmyuid() exists

https://gerrit.wikimedia.org/r/865167

Change 867229 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@REL1_39] uuid\GlobalIdGenerator: Check if getmyuid() exists

https://gerrit.wikimedia.org/r/867229

Change 867229 merged by jenkins-bot:

[mediawiki/core@REL1_39] uuid\GlobalIdGenerator: Check if getmyuid() exists

https://gerrit.wikimedia.org/r/867229

Umherirrender claimed this task.
Umherirrender removed a project: Patch-For-Review.