Page MenuHomePhabricator

SpecialCreateAccount instrumentation: Record event on error page
Closed, ResolvedPublic

Description

Summary

We currently don't record an event when a user submits the Special:CreateAccount form and receives the "Account creation error" page. We should log an event to mediawiki_product_metrics_special_create_account using the same funnel entry token so that we can better understand account creation failures.

Acceptance criteria

  • an event is recorded in mediawiki_product_metrics_special_create_account, with the message key used in the error page, and the funnel entry token

Event Timeline

Change #1203461 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] OutputPage: Export the error message key as a client-side config var

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

Change #1203463 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikimediaEvents@master] ext.wikimediaEvents.createAccount: Instrument error page erros

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

Change #1203461 merged by jenkins-bot:

[mediawiki/core@master] OutputPage: Export the error message key as a client-side config var

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

Change #1203463 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] ext.wikimediaEvents.createAccount: Instrument error page erros

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

Change #1203801 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@wmf/1.46.0-wmf.2] OutputPage: Export the error message key as a client-side config var

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

Change #1203802 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] ext.wikimediaEvents.createAccount: Instrument error page erros

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

Change #1203801 merged by jenkins-bot:

[mediawiki/core@wmf/1.46.0-wmf.2] OutputPage: Export the error message key as a client-side config var

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

Change #1203802 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@wmf/1.46.0-wmf.2] ext.wikimediaEvents.createAccount: Instrument error page erros

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

Mentioned in SAL (#wikimedia-operations) [2025-11-11T13:36:12Z] <kharlan@deploy2002> Started scap sync-world: Backport for [[gerrit:1203801|OutputPage: Export the error message key as a client-side config var (T409431)]], [[gerrit:1203802|ext.wikimediaEvents.createAccount: Instrument error page erros (T409431)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-11T13:38:26Z] <kharlan@deploy2002> kharlan: Backport for [[gerrit:1203801|OutputPage: Export the error message key as a client-side config var (T409431)]], [[gerrit:1203802|ext.wikimediaEvents.createAccount: Instrument error page erros (T409431)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-11-11T13:48:34Z] <kharlan@deploy2002> Finished scap sync-world: Backport for [[gerrit:1203801|OutputPage: Export the error message key as a client-side config var (T409431)]], [[gerrit:1203802|ext.wikimediaEvents.createAccount: Instrument error page erros (T409431)]] (duration: 12m 22s)

@kostajh What counts as an "Account creation error" page? On testwiki, I have tried entering passwords which don't match, usernames starting with ~2025, usernames with WMF in them, and usernames which already exist. I don't see any requests to either /beacon/statsv or https://intake-analytics.wikimedia.org that appear to relate to errors.

@kostajh What counts as an "Account creation error" page? On testwiki, I have tried entering passwords which don't match, usernames starting with ~2025, usernames with WMF in them, and usernames which already exist. I don't see any requests to either /beacon/statsv or https://intake-analytics.wikimedia.org that appear to relate to errors.

The two examples I know of are an account creation from a local or globally blocked IP address, or an account creation via a Tor proxy.

Trying to create an account using a Tor proxy, here is the request to https://intake-analytics.wikimedia.org. Is this right @kostajh?

{
  "action": "hcaptcha-execute",
  "funnel_entry_token": "2c0b434868fac6f8c6a1",
  "action_source": "form",
  "action_context": "55.978",
  "funnel_name": "create_account",
  "funnel_event_sequence_position": 12,
  "$schema": "/analytics/product_metrics/web/base/1.3.0",
  "agent": {
    "client_platform_family": "desktop_browser",
    "client_platform": "mediawiki_js"
  },
  "performer": {
    "language": "en",
    "pageview_id": "8d6b620a6ca7e02b9d37",
    "session_id": "1caa8c7320a723b6d03f",
    "active_browsing_session_token": "caac5d2e70b0c34cf8c5"
  },
  "dt": "2025-11-18T08:57:48.956Z",
  "meta": {
    "stream": "mediawiki.product_metrics.special_create_account",
    "domain": "test.wikipedia.org"
  }
}

Trying to create an account using a Tor proxy, here is the request to https://intake-analytics.wikimedia.org. Is this right @kostajh?

{
  "action": "hcaptcha-execute",
  "funnel_entry_token": "2c0b434868fac6f8c6a1",
  "action_source": "form",
  "action_context": "55.978",
  "funnel_name": "create_account",
  "funnel_event_sequence_position": 12,
  "$schema": "/analytics/product_metrics/web/base/1.3.0",
  "agent": {
    "client_platform_family": "desktop_browser",
    "client_platform": "mediawiki_js"
  },
  "performer": {
    "language": "en",
    "pageview_id": "8d6b620a6ca7e02b9d37",
    "session_id": "1caa8c7320a723b6d03f",
    "active_browsing_session_token": "caac5d2e70b0c34cf8c5"
  },
  "dt": "2025-11-18T08:57:48.956Z",
  "meta": {
    "stream": "mediawiki.product_metrics.special_create_account",
    "domain": "test.wikipedia.org"
  }
}

No, on the error page (after the form submission), you should see form_error (from this patch)

Thanks. Trying again I do see this request:

{
  "action": "form_error",
  "funnel_entry_token": "14f0e2cb45ebf6ad700d",
  "action_source": "form",
  "action_context": "rawmessage",
  "funnel_name": "create_account",
  "funnel_event_sequence_position": 1,
  "$schema": "/analytics/product_metrics/web/base/1.3.0",
  "agent": {
    "client_platform_family": "desktop_browser",
    "client_platform": "mediawiki_js"
  },
  "performer": {
    "language": "en",
    "pageview_id": "1700b6b2ad7f5163b4df",
    "session_id": "c0c2f8d0dace1cd099ee",
    "active_browsing_session_token": "c4de71eb9ce48acd475d"
  },
  "dt": "2025-11-24T11:30:24.556Z",
  "meta": {
    "stream": "mediawiki.product_metrics.special_create_account",
    "domain": "test.wikipedia.org"
  }
}

Thanks. Trying again I do see this request:

{
  "action": "form_error",
  "funnel_entry_token": "14f0e2cb45ebf6ad700d",
  "action_source": "form",
  "action_context": "rawmessage",
  "funnel_name": "create_account",
  "funnel_event_sequence_position": 1,
  "$schema": "/analytics/product_metrics/web/base/1.3.0",
  "agent": {
    "client_platform_family": "desktop_browser",
    "client_platform": "mediawiki_js"
  },
  "performer": {
    "language": "en",
    "pageview_id": "1700b6b2ad7f5163b4df",
    "session_id": "c0c2f8d0dace1cd099ee",
    "active_browsing_session_token": "c4de71eb9ce48acd475d"
  },
  "dt": "2025-11-24T11:30:24.556Z",
  "meta": {
    "stream": "mediawiki.product_metrics.special_create_account",
    "domain": "test.wikipedia.org"
  }
}

Hmm, rawmessage in action_context isn't intended or helpful from a data analysis perspective. What was the error message you saw on the page?

Hmm, rawmessage in action_context isn't intended or helpful from a data analysis perspective. What was the error message you saw on the page?

The title of the page is Account creation error.

There are two bullet points:

  • Your IP address, <ip>, has been automatically identified as a Tor exit node...
  • Your IP address has been blocked on all wikis...

We should update the code to log a more informative error message (other than rawmessage)

sguebo_WMF changed the task status from Open to In Progress.Dec 9 2025, 3:29 AM
sguebo_WMF claimed this task.

Change #1230926 had a related patch set uploaded (by Harroyo-wmf; author: Harroyo-wmf):

[mediawiki/core@master] signup: Pass wgErrorPageMessageKey on error

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

Let's verify the data after the patch (just +2'ed) is in production for a few days.

Change #1230926 merged by jenkins-bot:

[mediawiki/core@master] signup: Pass wgErrorPageMessageKey on error

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

hector.arroyo closed this task as Resolved.EditedFeb 24 2026, 3:47 PM

Verified in auth.wikimedia.org: The event is being submitted with the action_context set to the error code (instead of being rawmessage). The same funnel_entry_token value is used for every event.

image.png (875×1 px, 334 KB)