Page MenuHomePhabricator

PHP fatal error: syntax error, unexpected T_CONST, expecting T_VARIABLE
Closed, ResolvedPublicBUG REPORT

Description

I believe this was caused by https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/540696/.

Steps to Reproduce: $ curl https://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&meta=siteinfo

Actual Results:

Oct  5 16:24:43 deployment-mediawiki-09: {
    "message": "syntax error, unexpected T_CONST, expecting T_VARIABLE",
    "file": "/srv/mediawiki/php-master/includes/title/NamespaceInfo.php",
    "line": 59,
    "context": [],
    "backtrace": [
        {
            "file": "/srv/mediawiki/php-master/includes/title/NamespaceInfo.php",
            "line": 59
        },
        {
            "file": "/srv/mediawiki/php-master/includes/AutoLoader.php",
            "line": 109,
            "function": "include",
            "args": [
                "/srv/mediawiki/php-master/includes/title/NamespaceInfo.php"
            ]
        },
        {
            "file": "/srv/mediawiki/php-master/includes/Setup.php",
            "line": 468,
            "function": "autoload",
            "class": "AutoLoader",
            "type": "::",
            "args": [
                "NamespaceInfo"
            ]
        },
        {
            "file": "/srv/mediawiki/php-master/includes/WebStart.php",
            "line": 81,
            "function": "include",
            "args": [
                "/srv/mediawiki/php-master/includes/Setup.php"
            ]
        },
        {
            "file": "/srv/mediawiki/php-master/api.php",
            "line": 36,
            "function": "include",
            "args": [
                "/srv/mediawiki/php-master/includes/WebStart.php"
            ]
        },
        {
            "file": "/srv/mediawiki/w/api.php",
            "line": 3,
            "function": "include",
            "args": [
                "/srv/mediawiki/php-master/api.php"
            ]
        }
    ]
}

Event Timeline

It's definitely culprit, but... WTF? That error can only happen on HHVM, and we're not running on HHVM anymore, right???

Interestingly, for me, requests from Chromium are served with PHP7.2 and are fine, but all other clients (FF, curl, MCS) are served with HHVM and hit the error.

Update: https://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&meta=siteinfo is now completing successfully (powered by php7.2) when I request it with Firefox.

It's definitely culprit, but... WTF? That error can only happen on HHVM, and we're not running on HHVM anymore, right???

I think we haven't properly switched over the beta API server to use PHP 7 yet.

added

profile::mediawiki::vhost_feature_flags:
  php72_only: true

to deployment-mediawiki-09, like we did with deployment-mediawiki-07 the other day

looks fine:

$ curl 'https://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&meta=siteinfo' -Is | head -n1
HTTP/2 200 

should probably roll this across the rest of the beta cluster VMs, and uninstall HHVM. Can someone confirm it's all looking okay for them too?

shinken seems happy: <shinken-wm> RECOVERY - App Server Main HTTP Response on deployment-mediawiki-09 is OK: HTTP OK: HTTP/1.1 200 OK - 48091 bytes in 0.798 second response time