Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API endpoint /api/action/organization_list frequently times out #461

Open
simon-20 opened this issue Aug 29, 2024 · 7 comments
Open

API endpoint /api/action/organization_list frequently times out #461

simon-20 opened this issue Aug 29, 2024 · 7 comments
Assignees

Comments

@simon-20
Copy link

Brief Description
The API endpoint /api/action/organization_list can be called with various parameters, or none.

As parameters are specified to include more information, the request time takes longer and longer.

With all_fields=true it takes around ~20 seconds.

With all_fields=true&include_extras=true it routinely takes 30+ seconds.

If you try to fetch all the available data, e.g., with:

http "https://iatiregistry.org/api/action/organization_list?all_fields=true&include_extras=true&include_tags=true&include_groups=true&include_users=true"

the request very often times out:

504 Gateway Time-out
nginx/1.24.0

Severity
Medium

Issue Location

https://iatiregistry.org/api/action/organization_list?all_fields=true&include_extras=true&include_tags=true&include_groups=true&include_users=true

Steps to Reproduce

Try to fetch the list of organisations with all the data possible.

@siwhitehouse
Copy link
Contributor

Thanks @simon-20 - I was able to reproduce the 504 error immediately.

@robredpath I think this is another issue for the future, unless you think it should have a high priority.

@robredpath
Copy link

@simon-20 if I use paging (using limit and offset) then I get responses quite quickly - is that a suitable workaround for your current work?

@jarofgreen
Copy link

With all_fields=true it takes around ~20 seconds.
With all_fields=true&include_extras=true it routinely takes 30+ seconds.

Now they both regularly time out with a 504 error, both after 1 minute. Might this be related to today's go live?

This makes this issue more important.

@siwhitehouse
Copy link
Contributor

@cormachallinanderilinx please see @jarofgreen 's comment above. I could recreate this by entering

https://iatiregistry.org/api/action/organization_list?all_fields=true

in the address bar of my browser. After a wait, I received a 504 Bad Gateway error. I've moved this to the top of "In Progress" on the project board. Please could you look into it as a matter of prioirty.

@simon-20
Copy link
Author

@jarofgreen @siwhitehouse @cormachallinanderilinx

I think something has definitely changed with the release to the live Registry site today. The Bulk Data Service has been using the same Registry API URL for two weeks now, and up until today we hadn't had one 504, but since 2025-01-29T14:00:00Z every request made to that URL return 504.

I can get a response if I remove all the extra parameter flags, but in that case all that is returned is a bare list of publishers.

Even with just the single parameter, all_fields=true (which doesn't actually return all fields, of course, since it doesn't include the extras), the request times out.

@siwhitehouse
Copy link
Contributor

@cormachallinanderilinx Do you have an update, please? This is the second time that an update to the Admin UI has - seemingly - had a negative impact on the API.

@cormachallinanderilinx
Copy link
Collaborator

The reason for this is because there are over 2 thousand publishers being returned and with extra fields, this makes it a huge returning payload.
We would not recommend using the organization_list with include fields, without using paging as Rob mentioned above
Typically we would limit the number of organizations being returned.

The reason it was timing out from last week is because with the changes to the publisher search meant we were returning new/additional fields on each publisher/org which caused the returning payload to increase in size.
Therefore, in the next release I will ensure that the API calls will call the current code and on the UI will call the new code.
However this may cause issues in the future as the number of publishers grow and I would strong suggest using paging.

Example the current response is 4.3MB which is a relatively response and will continue to grow as publishers are added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants