Page MenuHomePhabricator

CXServer doesn't support section suggestions for "be-tarask" language code
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

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

  1. Send a request to cxserver to get section suggestions for an article existing in "be-tarask"

e.g. https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be-tarask

What happens?:
CXServer returns a response with 404 error code:
"Target article does not exist for en:Moon in be-tarask language"

What should have happened instead?:
CXServer should have returned a successful response, since the target article exists in be-tarask.


Derived Requirement

CXServer must support section suggestions for the "be-tarask" language code. When requesting section suggestions for an article that exists in this language variant, the server should return a valid list of section recommendations instead of a 404 Target article does not exist error.

Test Steps

Test Case 1: Section Suggestions with "be-tarask"

  1. Send a request to CXServer for section suggestions: https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be-tarask
  2. ✅❓❌⬜ AC1: Confirm the response does not return a 404 Target article does not exist.
  3. ✅❓❌⬜ AC2: Confirm the response includes section suggestions for the given article.

Test Case 2: Comparison with Standard "be"

  1. Send the same section suggestion request but with "be" as the target language: https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be
  2. ✅❓❌⬜ AC3: Confirm that the "be-tarask" response matches the expected behavior of the "be" request.
  3. ✅❓❌⬜ AC4: Confirm both requests return valid section suggestions if the article exists.

Test Case 3: Non-Existent Article

  1. Send a request for a non-existent article in "be-tarask".
  2. ✅❓❌⬜ AC5: Confirm CXServer correctly returns a 404 error only when the article does not exist in the target language.

QA Results - CXserver

Event Timeline

ngkountas changed the task status from Open to In Progress.May 13 2025, 8:57 AM
ngkountas claimed this task.
ngkountas triaged this task as Medium priority.

Change #1145104 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/services/cxserver@master] Fix language-domain mapping for be-tarask

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

Change #1145104 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Fix language-domain mapping for be-tarask

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

Change #1145456 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2025-05-14-005542-production

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

Change #1145456 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2025-05-14-005542-production

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

abi_ set the point value for this task to 1.May 16 2025, 12:17 PM
Nikerabbit changed the point value for this task from 1 to 2.
Nikerabbit subscribed.

For https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be-tarask I get the following after 60 seconds: {"error":{"message":"fetch failed"}}

https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/fi loads immediately.

Detailed output, but it seems not very useful.

$ curl -vk 'https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be-tarask'
* Host cxserver.wikimedia.org:443 was resolved.
* IPv6: 2001:df2:e500:ed1a::1
* IPv4: 103.102.166.224
*   Trying [2001:df2:e500:ed1a::1]:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / x25519 / id-ecPublicKey
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.wikipedia.org
*  start date: May 23 12:35:52 2025 GMT
*  expire date: Aug 21 12:35:51 2025 GMT
*  issuer: C=US; O=Google Trust Services; CN=WR1
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 1: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
*   Certificate level 2: Public key type RSA (4096/152 Bits/secBits), signed using sha256WithRSAEncryption
* Connected to cxserver.wikimedia.org (2001:df2:e500:ed1a::1) port 443
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be-tarask
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: cxserver.wikimedia.org]
* [HTTP/2] [1] [:path: /v2/suggest/sections/Moon/en/be-tarask]
* [HTTP/2] [1] [user-agent: curl/8.14.1]
* [HTTP/2] [1] [accept: */*]
> GET /v2/suggest/sections/Moon/en/be-tarask HTTP/2
> Host: cxserver.wikimedia.org
> User-Agent: curl/8.14.1
> Accept: */*
> 
* Request completely sent off
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/2 500 
< access-control-allow-origin: *
< access-control-allow-headers: accept, authorization, x-requested-with, content-type, x-wikimedia-debug
< access-control-expose-headers: etag
< x-xss-protection: 1; mode=block
< x-content-type-options: nosniff
< x-frame-options: SAMEORIGIN
< content-security-policy: default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'
< x-content-security-policy: default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'
< x-webkit-csp: default-src 'self'; object-src 'none'; media-src *; img-src *; style-src *; frame-ancestors 'self'
< content-type: application/json; charset=utf-8
< content-length: 36
< date: Wed, 02 Jul 2025 04:59:19 GMT
< server: production-tls
< age: 61
< vary: Accept-Encoding
< x-cache: cp5024 miss, cp5024 pass
< x-cache-status: pass
< server-timing: cache;desc="pass", host;desc="cp5024"
< strict-transport-security: max-age=106384710; includeSubDomains; preload
< report-to: { "group": "wm_nel", "max_age": 604800, "endpoints": [{ "url": "https://intake-logging.wikimedia.org/v1/events?stream=w3c.reportingapi.network_error&schema_uri=/w3c/reportingapi/network_error/1.0.0" }] }
< nel: { "report_to": "wm_nel", "max_age": 604800, "failure_fraction": 0.05, "success_fraction": 0.0}
< set-cookie: WMF-Last-Access=02-Jul-2025;Path=/;HttpOnly;secure;Expires=Sun, 03 Aug 2025 00:00:00 GMT
< x-client-ip: 2401:4900:8814:c29e:3a4d:9877:1a96:d9c0
< set-cookie: GeoIP=IN:MH:Mumbai:19.07:72.89:v4; Path=/; secure; Domain=.wikimedia.org
< set-cookie: NetworkProbeLimit=0.001;Path=/;Secure;SameSite=None;Max-Age=3600
< set-cookie: WMF-Uniq=8QCljWN7ojr3LC4LZsKmnQIkAAAAAFvdaMRbE03nHVIH_SImZaaxfF1K1Y2ZW0av;Domain=cxserver.wikimedia.org;Path=/;HttpOnly;secure;SameSite=None;Expires=Thu, 02 Jul 2026 00:00:00 GMT
< 
* Connection #0 to host cxserver.wikimedia.org left intact
{"error":{"message":"fetch failed"}}

Note that the following endpoints are working fine with be-tarask,

/v2/suggest/title/{title}/{from}/{to}
/v2/suggest/source/{title}/{to}
/v2/suggest/sections/{title}/{from}/{to}

Some additional debug information: The error suggests that multiple redirects are involved in retrieving the language code.

$curl -vk 'http://0.0.0.0:8080/v2/suggest/sections/Moon/en/be-tarask'
{"@timestamp":"2025-07-03T05:10:38.056Z","ecs.version":"8.10.0","error":{"Cause":"TypeError: fetch failed\n
    at Object.fetch (node:internal/deps/undici/undici:11576:11)\n
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n
    at async MWApiRequest.mwGet (file:///home/kartik/Development/WP/cxserver/lib/mw/MwApiRequest.js:106:20)\n
    at async SectionSuggester.getSections (file:///home/kartik/Development/WP/cxserver/lib/suggestion/SectionSuggester.js:102:20)\n
    at async Promise.all (index 1)\n    at async SectionSuggester.getMissingSections (file:///home/kartik/Development/WP/cxserver/lib/suggestion/SectionSuggester.js:158:54)\n
    at async suggestSections (file:///home/kartik/Development/WP/cxserver/lib/routes/v2.js:371:20) {\n
  cause: Error: redirect count exceeded\n
      at makeNetworkError (node:internal/deps/undici/undici:6893:35)\n
      at httpRedirectFetch (node:internal/deps/undici/undici:11149:16)\n
      at httpFetch (node:internal/deps/undici/undici:11125:28)\n
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n
      at async node:internal/deps/undici/undici:10925:18\n
      at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
      at async httpFetch (node:internal/deps/undici/undici:11125:22)\n
      at async node:internal/deps/undici/undici:10925:18\n
      at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
      at async httpFetch (node:internal/deps/undici/undici:11125:22) n
      at async node:internal/deps/undici/undici:10925:18\n
      at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
      at async httpFetch (node:internal/deps/undici/undici:11125:22)\n
      at async node:internal/deps/undici/undici:10925:18\n
      at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
      at async httpFetch (node:internal/deps/undici/undici:11125:22)\n}"
,"cause":"Error: redirect count exceeded\n
    at makeNetworkError (node:internal/deps/undici/undici:6893:35)\n
    at httpRedirectFetch (node:internal/deps/undici/undici:11149:16)\n
    at httpFetch (node:internal/deps/undici/undici:11125:28)\n
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n
    at async node:internal/deps/undici/undici:10925:18\n
    at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
    at async httpFetch (node:internal/deps/undici/undici:11125:22)\n
    at async node:internal/deps/undici/undici:10925:18\n
    at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
    at async httpFetch (node:internal/deps/undici/undici:11125:22)\n
    at async node:internal/deps/undici/undici:10925:18\n
    at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
    at async httpFetch (node:internal/deps/undici/undici:11125:22)\n
    at async node:internal/deps/undici/undici:10925:18\n
    at async mainFetch (node:internal/deps/undici/undici:10905:20)\n
    at async httpFetch (node:internal/deps/undici/undici:11125:22)","message":"fetch failed","stack_trace":"TypeError: fetch failed\n
    at Object.fetch (node:internal/deps/undici/undici:11576:11)\n
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n
    at async MWApiRequest.mwGet (file:///home/kartik/Development/WP/cxserver/lib/mw/MwApiRequest.js:106:20)\n
    at async SectionSuggester.getSections (file:///home/kartik/Development/WP/cxserver/lib/suggestion/SectionSuggester.js:102:20)\n
    at async Promise.all (index 1)\n    at async SectionSuggester.getMissingSections (file:///home/kartik/Development/WP/cxserver/lib/suggestion/SectionSuggester.js:158:54)\n
    at async suggestSections (file:///home/kartik/Development/WP/cxserver/lib/routes/v2.js:371:20)","type":"TypeError"},"http":{"request":{"id":"0942a1d8-f618-434a-ac75-e30d7bf5a8d1","method":"GET"}},"log.level":"error","message":"Error details: fetch failed","service":"cxserver-dev","url":{"path":"/v2/suggest/sections/Moon/en/be-tarask"}}

@ngkountas I was able to find some more debug traces as mentioned above. It seems this is very specific to be-tarask and redirection with it.

I see. be-tarask is a unique case. The wiki domain code is be-tarask (be-tarask.wikipedia.org), be-x-old code redirects to be-tarask (be-x-old.wikipedia.org --> be-tarask.wikipedia.org), but lllang prop expects the be-x-old code instead of be-tarask:

For all other special codes (als, bh, etc) this is not the case; lllang prop expects the same code as the corresponding wiki code. That means we need to handle be-tarask code separately, to address this issue.

Nikerabbit changed the task status from In Progress to Open.Aug 12 2025, 7:21 AM
Nikerabbit edited projects, added LPL Hypothesis; removed LPL Essential (2025 Jul-Oct).
Nikerabbit moved this task from Backlog to Incoming on the LPL Hypothesis board.

Change #1188786 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/services/cxserver@master] Map be-tarask to be-x-old for lllang parameter

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

Change #1188786 merged by jenkins-bot:

[mediawiki/services/cxserver@master] Map be-tarask to be-x-old for lllang parameter

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

Change #1189381 had a related patch set uploaded (by KartikMistry; author: KartikMistry):

[operations/deployment-charts@master] Update cxserver to 2025-09-16-161231-production

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

Change #1189381 merged by jenkins-bot:

[operations/deployment-charts@master] Update cxserver to 2025-09-16-161231-production

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

@SBisson Confirmed the response does not return a 404 Target article does not exist, as seen in the screenshots below. I will move this to Sign-off. Thanks for all your work!

Test Result - CXserver

Status: ✅ PASS
Environment: CXserver
OS: macOS Tahoe 26.0
Browser: Chrome 140
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Section Suggestions with "be-tarask"

  1. Send a request to CXServer for section suggestions: https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be-tarask
  2. AC1: Confirm the response does not return a 404 Target article does not exist.

2025-09-19_14-22-24.png (953×900 px, 158 KB)

  1. AC2: Confirm the response includes section suggestions for the given article.

See AC1

Test Case 2: Comparison with Standard "be"

  1. Send the same section suggestion request but with "be" as the target language: https://cxserver.wikimedia.org/v2/suggest/sections/Moon/en/be
  2. AC3: Confirm that the "be-tarask" response matches the expected behavior of the "be" request.

2025-09-19_14-23-33.png (1×893 px, 172 KB)

  1. AC4: Confirm both requests return valid section suggestions if the article exists.

See AC3

Test Case 3: Non-Existent Article

  1. Send a request for a non-existent article in "be-tarask".
  2. AC5: Confirm CXServer correctly returns a 404 error only when the article does not exist in the target language.

2025-09-19_14-26-37.png (304×1 px, 106 KB)

GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.