guardian / guardian/dotcom-rendering
Investigate recent alarms: Failed to parse football match info
- Dominant language
- TypeScript
- Stars
- 274
- Forks
- 34
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 121
Description
We have recently seen several alarms with error messages relating to football match parsing. These are due to the PA sending empty `` tags which seems like a bug on their end.
## The problem
Here is a specific example:
We received this response at **2026-08-23T18:27:56Z** for the game of **Venezia vs Lecce** in **Serie A**. The score is **empty**,
```xml
Lecce
0
```
Moments later we received the **correct response**:
```xml
Lecce
2
0
```
## Why is this happening?
I this this might be due to Scala not throwing an error when parsing empty strings. Documentation of String.toInt states: "Throws java.lang.NumberFormatException if the string does not contain a parsable Int."
Therefore in **pa-football-client** no error is thrown when the score is empty and instead an undefined score is returned. In frontend the score is optional and so the missing score is not caught and thus is passed to DCAR where finally we check that the score exists, and as it doesn't we return a 500 error.
## What the user sees
The user should then see a cached version of the page, and for every example I can find the next request to PA provides the correct score data so the issue resolves itself within a minute. This is much shorter than the "time to live" of the cache so user's shouldn't be affected other than possibly be a minute behind the live game, which we are sometimes anyway.
## Contacting PA and historical data
I can't currently see instances of this error before 26th August so can't confirm how much this has been happening. Here are the three recent matches this has happened on for future reference.
* 2026-08-26 21:37:13 - bradford-v-burnley
* 2026-08-29 15:59:11 - kilmarnock-v-dundeeunited
* 2026-08-29 19:20:58 - tottenham-hotspur-v-newcastleunited
As we don't have many examples it might be worth holding off mentioning it to PA until we can prove it's a significant and ongoing problem. In the meantime we can explore the following options.
## Possible solutions
I see two possible options:
* **No change:** The error message is correct, the score should not be empty, so perhaps it is best to leave it as is
* **Ignore invalid data:** We could check the score in Frontend, and if it's empty we ignore that payload and get the next one. This avoids invalid data being stored in the football agent and thus avoids DCAR receiving invalid data. This would also mean we could theoretically simplify the parsing logic in DCAR.
Contributor guide
Assessment
This issue has not been assessed yet.