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

Gateways Server API: Bulk stats endpoint replies 404 #6713

Closed
2 of 4 tasks
dsepulvedar opened this issue Nov 17, 2023 · 3 comments
Closed
2 of 4 tasks

Gateways Server API: Bulk stats endpoint replies 404 #6713

dsepulvedar opened this issue Nov 17, 2023 · 3 comments
Assignees
Labels
bug Something isn't working c/identity server This is related to the Identity Server
Milestone

Comments

@dsepulvedar
Copy link

Summary

I’ve been using the Gateways Server API, specifically the bulk stats endpoint, to retrieve stats from my gateways.
Recently I hit a roadblock which defeats the purpose of the endpoint: when a gateway is not found, because it is offline and there’s no stats in the server, the endpoint replies with a 404 error response code, and says some of the gateways aren't found (see Current results)

As a next approach I decided to query the gateways' stats individually, and them remove the ones which were not found, and then query the bulk stats again with I thought was a list of gw that di have stats.
To my surprise, I still had the same 404 error response code, as seen below:
image

Steps to Reproduce

  1. Read gateways using the /api/v3/search/gateways endpoint
  2. Process the request and build a compatible payload for the Gateways Server API
  3. Retrieve the stats and if there are gateways not found, the endpoint will reply with the 404 error response code.

Current Result

This is response from the endpoint

{
 'code': 5,
 'message': 'error:pkg/identityserver:some_gateways_not_found (some gateways not found)',
 'details': [{
  '@type': 'type.googleapis.com/ttn.lorawan.v3.ErrorDetails',
  'namespace': 'pkg/identityserver',
  'name': 'some_gateways_not_found',
  'message_format': 'some gateways not found',
  'correlation_id': '1689af4e405f428e9059f8b02af7f602',
  'code': 5
 }]
}

Expected Result

The endpoint should reply with the gateways' stats that are indeed found, and simply leave the devices that have been offline for more than 24 hours out from the response.

Relevant Logs

No response

URL

https://.nam1.cloud.thethings.industries/api/v3/gs/gateways/connection/stats

Deployment

The Things Stack Cloud

The Things Stack Version

No response

Client Name and Version

Python 3.11 with requests package

Other Information

No response

Proposed Fix

No response

Contributing

  • I can help by doing more research.
  • I can help by implementing a fix after the proposal above is approved.
  • I can help by testing the fix before it's released.

Code of Conduct

@dsepulvedar dsepulvedar added the needs/triage We still need to triage this label Nov 17, 2023
@adriansmares
Copy link
Contributor

adriansmares commented Nov 20, 2023

This should be fixed by #6711 and will be part of the v3.28.1 release. The root cause seems to be that the caller (i.e. the admin user) is not a collaborator, and the batch rights assertion did not take into account the admin universal rights.

I will leave the issue open for confirmation, and we can close it afterwards.

@adriansmares adriansmares self-assigned this Nov 20, 2023
@adriansmares adriansmares added bug Something isn't working c/identity server This is related to the Identity Server labels Nov 20, 2023
@adriansmares adriansmares added this to the v3.28.1 milestone Nov 20, 2023
@KrishnaIyer KrishnaIyer removed the needs/triage We still need to triage this label Nov 23, 2023
@adriansmares
Copy link
Contributor

@dsepulvedar do you still encounter this issue ?

@adriansmares adriansmares modified the milestones: v3.28.1, v3.28.2 Nov 30, 2023
@dsepulvedar
Copy link
Author

@adriansmares thank you for you heads up. I tested the endpoint again and I'm no longer getting the 404 "some_gateways_not_found" error.
This to me has been solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c/identity server This is related to the Identity Server
Projects
None yet
Development

No branches or pull requests

3 participants