Page MenuHomePhabricator

Production error: AttributeError: 'NoneType' object has no attribute 'keys'
Closed, ResolvedPublic2 Estimated Story Points

Description

https://logstash.wikimedia.org/app/discover#/doc/0001c630-87fc-11f0-a6ef-d336524cfa1c/ecs-ml-1-1.11.0-7-2025.44?id=feOWOZoBlLUf3R62Iu77

This has been happening for about a month as a consequence of the recommendation api being unable to reach CX Server. This is documented in T405004: High volume of requests from rec-api to cxserver fail with 503 service unavailable

Screenshot 2025-10-31 at 1.30.12 PM.png (672×1 px, 56 KB)


Test Steps

Test Case 1: Verify Recommendation API Does Not Produce 'NoneType' AttributeError When CX Server Is Unreachable

  1. Trigger a recommendation API request that requires CX Server (e.g., a section or article recommendation request).
  2. Ensure CX Server returns a 503 response or is unavailable.
  3. Observe the API response.
  4. Review Logstash for associated logs tied to the request.
  5. ✅❓❌⬜ AC1: Confirm no unhandled exception (AttributeError: 'NoneType' object has no attribute 'keys') is generated.

QA Results - Logstash

ACStatusDetails
1T408934#11374869

Event Timeline

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

[research/recommendation-api@master] Gracefully handle empty section sizes

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

SBisson triaged this task as High priority.Oct 31 2025, 5:42 PM
SBisson moved this task from Backlog to Needs Code Review on the LPL Hypothesis board.

Change #1200393 merged by jenkins-bot:

[research/recommendation-api@master] Gracefully handle empty section sizes

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

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

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-05-230545-production

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

Change #1202376 merged by jenkins-bot:

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-05-230545-production

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

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

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-07-162011-production

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

Change #1203450 merged by jenkins-bot:

[operations/deployment-charts@master] Update Recommnedation API to 2025-11-07-162011-production

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

@SBisson No errors in Logstash since it has been updated on 11/1, as seen in the screenshot. I will move this to Sign-off. Thanks for all your work!

**Test Result - Logstash*

Status: ✅ PASS
Environment: Logstash
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify Recommendation API Does Not Produce 'NoneType' AttributeError When CX Server Is Unreachable

  1. Trigger a recommendation API request that requires CX Server (e.g., a section or article recommendation request).
  2. Ensure CX Server returns a 503 response or is unavailable.
  3. Observe the API response.
  4. Review Logstash for associated logs tied to the request.
  5. AC1: Confirm no unhandled exception (AttributeError: 'NoneType' object has no attribute 'keys') is generated.

2025-11-12_11-28-50.png (914×1 px, 642 KB)

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from Needs QA to Design Signoff on the LPL Hypothesis board.

no design review needed for this task so moving it to product signoff.

Nikerabbit set the point value for this task to 2.