-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Requests to /api/insights/v1/system/<uuid>/reports lack trailing slash #895
Comments
Also tracked in https://issues.redhat.com/browse/SAT-27374 |
I'm happy to submit a patch or PR for this, I'm just struggling to see where this URL is constructed or comes from. |
@PaulWay Could you provide the steps to reproduce the issue? Thanks. |
Sure. Simply watch the requests going out to URLs starting with https://console.redhat.com/api/insights/v1/ - you'll see that they don't contain a trailing slash. The requests library being used automatically follows the 301 redirect so the request eventually resolves, but it wastes an entire request/response cycle. Look in the foreman log. |
This should work with any of the Satellite versions I gave above. |
@PaulWay I ran [root@satellite ~]# tail -f /var/log/foreman/production.log | grep -i reports
2024-11-05T15:33:55 [I|app|37b67a45] Started GET "/redhat_access/r/insights/platform/insights/v1/system/9e5f25ae-985d-4137-ac15-f31ff57af003/reports/" for 108.61.158.191 at 2024-11-05 15:33:55 -0500
2024-11-05T15:33:55 [I|app|37b67a45] Parameters: {"path"=>"platform/insights/v1/system/9e5f25ae-985d-4137-ac15-f31ff57af003/reports"}
2024-11-05T15:35:41 [I|app|cd0cde98] Started GET "/redhat_access/r/insights/platform/insights/v1/system/9e5f25ae-985d-4137-ac15-f31ff57af003/reports/" for 108.61.158.191 at 2024-11-05 15:35:41 -0500
2024-11-05T15:35:41 [I|app|cd0cde98] Parameters: {"path"=>"platform/insights/v1/system/9e5f25ae-985d-4137-ac15-f31ff57af003/reports"} |
Hi @chris1984 - thanks for that. I can see that system having recently checked in using the Satellite compatibility API: (Sorry for the image, it's hard to copy and paste log text directly from Kibana.) The logs are most recent at top so they should be read from the bottom up. So you can see there that even though Foreman says it's requesting the |
@PaulWay Thanks for your reply. |
Hi @lfu - I'm sorry, I'm not the expert in how Satellite and Foreman work. I can show you that Satellite is making those requests. I need your help to find out why. |
@PaulWay 😄 Just show me how the Satellite is making those requests. And I'm here to help find out the reason. |
I'm asking you to find out how Satellite is making those requests. I don't know. All I know is that it's making them. |
@PaulWay 😄 This is funny. |
|
@lfu to add to what Paul has described: in Foreman, the part that is responsible to make the actual call to the cloud is here:
I suppose we should investigate deeper to understand why some requests do get the trailing slash and some don't. Also make sure to sync with @chris1984, since I think he was working on this. |
At the moment the Foreman client seems to be making requests on behalf of the Insights client to:
/api/insights/v1/system/<uuid>/reports?branch_id=<branch_id>
.This lacks a trailing slash, which causes the API to return a 301 redirect to:
/api/insights/v1/system/<uuid>/reports/?branch_id=<branch_id>
.Which the client immediately follows. This causes two requests and two jobs to process one request, leading to increased work and delays in both Satellite and the Insights Advisor API.
We would like to make sure that only the latter URL is requested.
Versions affected:
Satellite 6.11.5.6, 6.11.5.7, 6.12.5.3, 6.13.1, 6.13.7, 6.14.2, 6.14.4, 6.14.4.1, 6.15.1, 6.15.2
foreman_rh_cloud 5.0.46, 6.0.45, 7.0.45, 7.0.48, 8.0.51, 9.0.56
insights-client 3.1.9, 3.2.2
The text was updated successfully, but these errors were encountered: