Page MenuHomePhabricator

Unable to mark page as reviewed due to missing pagetriage_page_tags
Open, Needs TriagePublicBUG REPORT

Description

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

What happens?:

  • A console error is logged
  • The page does not appear to have been reviewed
  • The page remains in the SQL query results

What should have happened instead?:

  • The page is marked as reviewed

Software version (skip for WMF-hosted wikis like Wikipedia):

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

Uncaught ReferenceError: noteTarget is not defined
    anonymous https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript line 687 > Function:3
    template https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:687
    render https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:35
    show https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:7
    click https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:6
    place https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:8
    jQuery 8
    place https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:8
    render https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:3
    forEach https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:673
    render https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:3
    success https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:6
    success https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:693
    jQuery 6
    sync https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:711
    fetch https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:693
    js https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:6
    jQuery 11
    js https://en.wikipedia.org/wiki/Demographics_of_Northern_Cyprus line 10 > injectedScript:6
    runScript https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:12
    cssHandle https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:12
    flushCssBuffer https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:4
    addEmbeddedCSS https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:5
    execute https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:13
    doPropagation https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:6
    setAndPropagate https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:7
    markModuleReady https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:11
    runScript https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:12
    cssHandle https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:12
    flushCssBuffer https://en.wikipedia.org/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector:4
Demographics_of_Northern_Cyprus line 10 > injectedScript line 687 > Function:3:1316

Event Timeline

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

For some reason pagetriage_page_tags rows weren't generated for this page properly. Only the copyvio pagetag was generated.

The output of the query select ptrpt_page_id, ptrt_tag_name, ptrpt_value from pagetriage_page_tags join pagetriage_tags on ptrpt_tag_id = ptrt_tag_id where ptrpt_page_id=20555094:

ptrpt_page_idptrt_tag_nameptrpt_value
20555094copyvio1117169112

An IP user converted this redirect into an article. This might have led to the issue.

WP:ITSTHURSDAY. Can we query the database to see if there are any more of these, and what the dates on them are? Worth checking to see if this is a regression.

Here's some other cases of pagetriage_page_tags only having 1 tag for a particular page. Some of these may also be affected by the same bug. Worth some further study.

https://quarry.wmcloud.org/query/68193

image.png (1×1 px, 74 KB)

The ones with empty values for title and namespace in https://quarry.wmcloud.org/query/68196 are related to T256704: updatePageTriageQueue doesn't remove old records if the page doesn't exist. Ignoring those.

I checked a few of the others, at random. Nothing recent had happened with them related to PageTriage.

wrt. regression, I don't think it is (though I'll note that in https://quarry.wmcloud.org/query/66115, which was last run 19 Jul 2022, the page Demographics of Northern Cyprus is not present)

I'm leaning towards seeing if we can just delete these 7 mainspace rows from the table and be done with it..


Edit: ref getting these removed from/marked reviewed in the table manually, I've started this on-wiki discussion (permalink)

Here's some other cases of pagetriage_page_tags only having 1 tag for a particular page. Some of these may also be affected by the same bug. Worth some further study.

https://quarry.wmcloud.org/query/68193

I've just gone through and re-added these to the new pages queue — that's at least (re)generated some page triage columns. Now has the same error if I try to mark these as reviewed.

Could write something like...

cron/fixOrphanedMetadata.php

class FixOrphanedMetadata extends Maintenance {
    public function execute() {
        // Delete any tag that is by itself, i.e. that page only has 1 tag instead of the normal 19-ish
        // DELETE FROM pagetriage_page_tags WHERE ptrpt_page_id IN (SELECT ptrpt_page_id
FROM pagetriage_page_tags
LEFT JOIN pagetriage_page ON ptrp_page_id = ptrpt_page_id
LEFT JOIN page ON page_id = ptrpt_page_id
GROUP BY ptrpt_page_id
HAVING COUNT(*) = 1;)

        // Now go look for pages in the new pages feed (pagetriage_page table) that don't have any metadata
        // TODO: select query
        foreach
            $acp = ArticleCompileProcessor::newFromPageId( $pageId );
            if ( $acp ) {
                $acp->registerComponent( 'UserData' );
                // safe to use replica db for data compilation
                $acp->configComponentDb( [ 'UserData' => DB_REPLICA ] );
                $acp->compileMetadata(); // regenerate that metadata
            }
        }
    }
}

Or could just ask a DBA to delete it.

Makes me nervous not to find the root cause though. Is there such a thing as a freak database error? More likely there is a bug somewhere in the PageTriage code.

A steps to reproduce that works on a localhost wiki would be really helpful but perhaps hard to get. If we had that we could just step debug it.

Whatever solution we execute, we should throw these same pages into the New Pages Feed again and make sure they are mark as reviewable this time.

Band aid fix easier than all the stuff I mentioned above (credit to TheresNoTime): make a null edit to the page. That runs Hooks.php -> onLinksUpdateComplete(), which runs $acp->compileMetadata(), which regenerates the metadata.

TheresNoTime claimed this task.

This specific issue resolved, follow-up work would be either to find a root cause as to why these pages weren't correctly added to the table and/or T256704

Novem_Linguae renamed this task from Unable to mark a specific page as reviewed to Unable to mark page as reviewed due to missing pagetriage_page_tags.Oct 21 2022, 12:35 PM
Novem_Linguae reopened this task as Open.

If you don't mind, I'm leaning towards keeping this one open, since the PHP bug is probably still in the code somewhere.