canonical / canonical/ubuntu-com-security-api

Notices API returns 504 errors intermittently when limit is set

Open
#266 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
22
Forks
9
Avg merge
1d 3h
Merged PRs (30d)
2

Description

We use the notices API, retrieving 20 per call (the limit so far) and sorting by newest so we can stop requesting when we've covered the notices we have already processed. When requesting https://ubuntu.com/security/notices.json?limit=20&order=newest&offset=0 we frequently see HTTP 504 gateway timeout errors, and when we do, these continue for many hours before resolving without a change on our side. This cycle of requests failing and working again has repeated over the past few weeks and we haven't yet identified a pattern to suggest why this intermittency exists. These errors do not happen when requesting the bare URL https://ubuntu.com/security/notices.json which returns the first 10 notices but not in the order we want. Reducing the limit to 10 does work, but only on the first request and only if the order is not set. Specifying a limit of 10 but requesting an offset also results in 504s.

To clarify:
No limit set, no order, no offset: works
Limit 10, no order, offset 0: works
Limit higher than 10: 504
Order set to newest: 504
Offset anything other than 0: 504

This appears related to previous issue [178](https://github.com/canonical/ubuntu-com-security-api/issues/178), but as it appears connected to any results other than the first ten, no matter how they are retrieved, it may be a different root cause.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the listed notices.json request variants, especially combinations of limit, order, and offset, and compare them with the bare URL. Inspect the API entry point serving /security/notices.json and use issue 178 as related context. Done means supported requests no longer intermittently return HTTP 504 errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.