Page MenuHomePhabricator

wikimedia/metrics-platform 4.1.0 in composer.json causes errors
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

wikimedia/metrics-platform on 4.1.0 in composer.json in EventLogging extension on Local
visit http://localhost:8080/view/en/Z801
select type 'String'
enter a string
click Run function

Screen Recording 2024-06-12 at 2.03.04 AM.gif (1×2 px, 1 MB)

What happens?:

{
    "error": {
        "code": "internal_api_error_Error",
        "info": "[23476b0a2c17f0f13053375d] Exception caught: Interface \"Wikimedia\\MetricsPlatform\\EventSubmitter\" not found",
        "errorclass": "Error",
        "*": "Error at /var/www/html/w/extensions/EventLogging/includes/MetricsPlatform/EventSubmitter.php(12)\nfrom /var/www/html/w/extensions/EventLogging/includes/MetricsPlatform/EventSubmitter.php(12)\n#0 /var/www/html/w/includes/AutoLoader.php(225): require()\n#1 /var/www/html/w/extensions/EventLogging/includes/MetricsPlatform/MetricsClientFactory.php(39): AutoLoader::autoload()\n#2 /var/www/html/w/extensions/EventLogging/includes/EventLogging.php(58): MediaWiki\\Extension\\EventLogging\\MetricsPlatform\\MetricsClientFactory->newMetricsClient()\n#3 /var/www/html/w/extensions/WikiLambda/includes/ActionAPI/WikiLambdaApiBase.php(284): MediaWiki\\Extension\\EventLogging\\EventLogging::getMetricsPlatformClient()\n#4 /var/www/html/w/extensions/WikiLambda/includes/ActionAPI/ApiFunctionCall.php(205): MediaWiki\\Extension\\WikiLambda\\ActionAPI\\WikiLambdaApiBase->submitMetricsEvent()\n#5 /var/www/html/w/extensions/WikiLambda/includes/ActionAPI/ApiFunctionCall.php(187): MediaWiki\\Extension\\WikiLambda\\ActionAPI\\ApiFunctionCall->submitFunctionCallEvent()\n#6 /var/www/html/w/extensions/WikiLambda/includes/ActionAPI/ApiFunctionCall.php(50): MediaWiki\\Extension\\WikiLambda\\ActionAPI\\ApiFunctionCall->run()\n#7 /var/www/html/w/includes/api/ApiMain.php(1952): MediaWiki\\Extension\\WikiLambda\\ActionAPI\\ApiFunctionCall->execute()\n#8 /var/www/html/w/includes/api/ApiMain.php(928): ApiMain->executeAction()\n#9 /var/www/html/w/includes/api/ApiMain.php(899): ApiMain->executeActionWithErrorHandling()\n#10 /var/www/html/w/includes/api/ApiEntryPoint.php(158): ApiMain->execute()\n#11 /var/www/html/w/includes/MediaWikiEntryPoint.php(200): MediaWiki\\Api\\ApiEntryPoint->execute()\n#12 /var/www/html/w/api.php(44): MediaWiki\\MediaWikiEntryPoint->run()\n#13 {main}"
    },
    "servedby": "d0055c7e33f3"
}

What should have happened instead?:

The string should be displayed

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
1.43.0-alpha

Other information (browser name/version, screenshots, etc.):

Screen Recording 2024-06-12 at 9.41.09 AM.gif (1×2 px, 610 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change #1042314 had a related patch set uploaded (by Vaughn Walters; author: Vaughn Walters):

[mediawiki/extensions/EventLogging@master] Updating wikimedia/metrics-platform to 4.2.0 in composer.json

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

vaughnwalters triaged this task as Unbreak Now! priority.Wed, Jun 12, 4:57 PM
vaughnwalters added a subscriber: DMartin-WMF.

per @DMartin-WMF - the versioning issue is also preventing our new API metrics events to get through EventGate.

Thanks, @vaughnwalters ! Note that updating to version 4.2.0 is also needed for successful propagation of Wikifunctions' new API tracking events, because 4.2.0 includes this:

https://gitlab.wikimedia.org/repos/data-engineering/metrics-platform/-/merge_requests/43

Well this is terrifying 😱

v4.1.0 definitely includes the interface: https://gitlab.wikimedia.org/repos/data-engineering/metrics-platform/-/blob/4.1.0/php/src/EventSubmitter.php?ref_type=tags

Could you paste the output of composer update when run in your local MediaWiki root directory? i.e.

cd /path/to/mediawiki
composer update
# Or…
# docker compose exec mediawiki composer update

Could you paste the output of composer update when run in your local MediaWiki root directory? i.e.

➜  mediawiki git:(master) composer update
> MediaWiki\Composer\VersionChecker::onEvent
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 4 updates, 0 removals
  - Upgrading myclabs/deep-copy (1.11.1 => 1.12.0)
  - Upgrading symfony/console (v6.4.8 => v7.1.1)
  - Upgrading symfony/string (v6.4.8 => v7.1.1)
  - Upgrading symfony/var-dumper (v6.4.8 => v7.1.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 72 installs, 0 updates, 0 removals
  - Downloading doctrine/event-manager (2.0.1)
  - Downloading doctrine/dbal (3.8.4)
  - Downloading sebastian/resource-operations (3.0.4)
  - Downloading nikic/php-parser (v4.19.1)
  - Downloading myclabs/deep-copy (1.12.0)
  - Downloading phpunit/phpunit (9.6.19)
  - Downloading symfony/string (v7.1.1)
  - Downloading symfony/console (v7.1.1)
  - Downloading mediawiki/minus-x (1.1.3)
  - Downloading symfony/var-dumper (v7.1.1)
  - Downloading psy/psysh (v0.12.4)
  - Downloading seld/jsonlint (1.10.2)
  - Installing squizlabs/php_codesniffer (3.8.1): Extracting archive
  - Installing dealerdirect/phpcodesniffer-composer-installer (v1.0.0): Extracting archive
  - Installing composer/pcre (3.1.4): Extracting archive
  - Installing psr/cache (3.0.0): Extracting archive
  - Installing doctrine/event-manager (2.0.1): Extracting archive
  - Installing doctrine/deprecations (1.1.3): Extracting archive
  - Installing doctrine/cache (2.2.0): Extracting archive
  - Installing doctrine/dbal (3.8.4): Extracting archive
  - Installing doctrine/sql-formatter (1.1.3): Extracting archive
  - Installing giorgiosironi/eris (0.14.0): Extracting archive
  - Installing sebastian/version (3.0.2): Extracting archive
  - Installing sebastian/type (3.2.1): Extracting archive
  - Installing sebastian/resource-operations (3.0.4): Extracting archive
  - Installing sebastian/recursion-context (4.0.5): Extracting archive
  - Installing sebastian/object-reflector (2.0.4): Extracting archive
  - Installing sebastian/object-enumerator (4.0.4): Extracting archive
  - Installing sebastian/global-state (5.0.7): Extracting archive
  - Installing sebastian/exporter (4.0.6): Extracting archive
  - Installing sebastian/environment (5.1.5): Extracting archive
  - Installing sebastian/diff (4.0.6): Extracting archive
  - Installing sebastian/comparator (4.0.8): Extracting archive
  - Installing sebastian/code-unit (1.0.8): Extracting archive
  - Installing sebastian/cli-parser (1.0.2): Extracting archive
  - Installing phpunit/php-timer (5.0.3): Extracting archive
  - Installing phpunit/php-text-template (2.0.4): Extracting archive
  - Installing phpunit/php-invoker (3.1.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.6): Extracting archive
  - Installing theseer/tokenizer (1.2.3): Extracting archive
  - Installing nikic/php-parser (v4.19.1): Extracting archive
  - Installing sebastian/lines-of-code (1.0.4): Extracting archive
  - Installing sebastian/complexity (2.0.3): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.3): Extracting archive
  - Installing phpunit/php-code-coverage (9.2.31): Extracting archive
  - Installing phar-io/version (3.2.1): Extracting archive
  - Installing phar-io/manifest (2.0.4): Extracting archive
  - Installing myclabs/deep-copy (1.12.0): Extracting archive
  - Installing doctrine/instantiator (2.0.0): Extracting archive
  - Installing phpunit/phpunit (9.6.19): Extracting archive
  - Installing johnkary/phpunit-speedtrap (v4.0.1): Extracting archive
  - Installing phpcsstandards/phpcsutils (1.0.9): Extracting archive
  - Installing phpcsstandards/phpcsextra (1.1.2): Extracting archive
  - Installing composer/spdx-licenses (1.5.8): Extracting archive
  - Installing mediawiki/mediawiki-codesniffer (v43.0.0): Extracting archive
  - Installing tysonandre/var_representation_polyfill (0.1.3): Extracting archive
  - Installing symfony/string (v7.1.1): Extracting archive
  - Installing symfony/service-contracts (v3.5.0): Extracting archive
  - Installing symfony/console (v7.1.1): Extracting archive
  - Installing sabre/event (5.1.4): Extracting archive
  - Installing netresearch/jsonmapper (v4.4.1): Extracting archive
  - Installing microsoft/tolerant-php-parser (v0.1.2): Extracting archive
  - Installing webmozart/assert (1.11.0): Extracting archive
  - Installing phpstan/phpdoc-parser (1.29.1): Extracting archive
  - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
  - Installing phpdocumentor/type-resolver (1.8.2): Extracting archive
  - Installing phpdocumentor/reflection-docblock (5.4.1): Extracting archive
  - Installing felixfbecker/advanced-json-rpc (v3.2.1): Extracting archive
  - Installing composer/xdebug-handler (3.0.5): Extracting archive
  - Installing phan/phan (5.4.3): Extracting archive
  - Installing mediawiki/phan-taint-check-plugin (6.0.0): Extracting archive
  - Installing mediawiki/mediawiki-phan-config (0.14.0): Extracting archive
  - Installing mediawiki/minus-x (1.1.3): Extracting archive
  - Installing php-parallel-lint/php-console-color (v1.0.1): Extracting archive
  - Installing php-parallel-lint/php-console-highlighter (v1.0.0): Extracting archive
  - Installing php-parallel-lint/php-parallel-lint (v1.4.0): Extracting archive
  - Installing symfony/var-dumper (v7.1.1): Extracting archive
  - Installing psy/psysh (v0.12.4): Extracting archive
  - Installing seld/jsonlint (1.10.2): Extracting archive
  - Installing wikimedia/alea (1.0.0): Extracting archive
  - Installing wikimedia/langconv (0.4.2): Extracting archive
  - Installing wikimedia/testing-access-wrapper (3.0.0): Extracting archive
  - Installing hamcrest/hamcrest-php (v2.0.1): Extracting archive
  - Installing wmde/hamcrest-html-matchers (v1.0.0): Extracting archive
Generating optimized autoload files
50 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
PHP CodeSniffer Config installed_paths set to ../../mediawiki/mediawiki-codesniffer,../../phpcsstandards/phpcsextra,../../phpcsstandards/phpcsutils
> MediaWiki\Composer\ComposerVendorHtaccessCreator::onEvent
No security vulnerability advisories found

I don't see wikimedia/metrics-platform (4.1.0) in that. Have you configured the composer-merge-plugin? The instructions to configure it are here: https://www.mediawiki.org/wiki/Composer#Using_composer-merge-plugin

I don't see wikimedia/metrics-platform (4.1.0) in that. Have you configured the composer-merge-plugin? The instructions to configure it are here: https://www.mediawiki.org/wiki/Composer#Using_composer-merge-plugin

Yes, I do have it installed - this is what was inside of my composer.local.json at root

  {
      "extra": {
           "merge-plugin": {
               "include": [
                   "extensions/WikiLambda/composer.json"
               ]
           }
       }
  ] }
 
~

when I changed the include to be "extensions/*/composer.json" and then I run composer update at mediawiki root, then I get the following output:

➜  mediawiki git:(master) composer update
> MediaWiki\Composer\VersionChecker::onEvent
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
  - Locking composer/installers (v2.2.0)
  - Locking wikimedia/metrics-platform (4.2.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
  - Downloading composer/installers (v2.2.0)
  - Installing composer/installers (v2.2.0): Extracting archive
  - Installing wikimedia/metrics-platform (4.2.0): Extracting archive
Generating optimized autoload files
51 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> MediaWiki\Composer\ComposerVendorHtaccessCreator::onEvent
No security vulnerability advisories found

Previously (and to create the attached patch) I had just run composer update inside of extensions/EventLogging

Even though @vaughnwalters has gotten past his local installation issue, it's still urgent that EventLogging's composer.json be updated to indicate metrics-platform 4.2.0, for the reason I commented above. Wikifunctions is blocked on using its API tracking events; they are not getting past EventGate to the Analytics environment.

Jdforrester-WMF lowered the priority of this task from Unbreak Now! to High.Thu, Jun 13, 2:03 PM
Jdforrester-WMF subscribed.

No longer a train blocker, but a blocker to recent MP work.

Change #1043130 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/extensions/EventLogging@master] Use wikimedia/metrics-platform v4.2.0

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

Change #1043137 had a related patch set uploaded (by Phuedx; author: Phuedx):

[mediawiki/vendor@master] Update wikimedia/metrics-platform to v4.2.0

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

Change #1043137 merged by jenkins-bot:

[mediawiki/vendor@master] Update wikimedia/metrics-platform to v4.2.0

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

Change #1043130 merged by jenkins-bot:

[mediawiki/extensions/EventLogging@master] Use wikimedia/metrics-platform v4.2.0

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

Jdforrester-WMF reassigned this task from vaughnwalters to phuedx.

Fix will go out in next week's train. Thanks!

Change #1042314 abandoned by Vaughn Walters:

[mediawiki/extensions/EventLogging@master] Updating wikimedia/metrics-platform to 4.2.0 in composer.json

Reason:

Fix was made at 1043130

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