x-openstack-request-id changed at redirected request

Bug #2000742 reported by Vadym Markov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
keystoneauth
Fix Released
Undecided
Unassigned

Bug Description

For now, issue affects only Heat requests. Patch to Keystoneauth can fix the issue system-wide and with the minimal efforts.

Heat uses 302 response for most of common requests, like stack create, delete, etc. At first, it returns id of requested entity, and then redirects to URL which points to this entity. Heatclient uses keystoneauth to handle this redirect, and it works correctly, except logging. Heat API logs two requests with different req-id, but Heat engine logs only second req-id. It is very confusing and makes logs investigation more difficult

Affected version: any recent Openstack setup with enabled Heat

Steps to reproduce:

1. Create Heat stack using any valid template

Actual behavior:

Heat API log:
2022-09-19 05:31:46.476 13 DEBUG heat.api.middleware.version_negotiation [req-6558aea5-0ea5-45d5-82c9-05027f265c2e admin - - - -] Processing request: DELETE /v1/bf3c4ddae2464f899aa858a632f1d14d/stacks/refapp-test/de8173d1-c1c9-49ad-836a-ec144ffeb88c Accept: application/json process_request /var/lib/openstack/lib/python3.8/site-packages/heat/api/middleware/version_negotiation.py:57
2022-09-19 05:31:46.477 13 DEBUG heat.api.middleware.version_negotiation [req-6558aea5-0ea5-45d5-82c9-05027f265c2e admin - - - -] Matched versioned URI. Version: 1.0 process_request /var/lib/openstack/lib/python3.8/site-packages/heat/api/middleware/version_negotiation.py:69

Heat engine log:
2022-09-19 05:31:46.504 1 INFO heat.engine.service [req-829ea58a-74f6-42a4-918f-b633228252a9 admin - - - -] Deleting stack refapp-test
022-09-19 05:31:46.562 1 DEBUG heat.engine.stack [req-829ea58a-74f6-42a4-918f-b633228252a9 admin - - - -] Persisting stack refapp-test status DELETE IN_PROGRESS _send_notification_and_add_event /var/lib/openstack/lib/python3.8/site-packages/heat/engine/stack.py:1109
2022-09-19 05:31:46.683 1 INFO heat.engine.worker [req-829ea58a-74f6-42a4-918f-b633228252a9 admin - - - -] [refapp-test(de8173d1-c1c9-49ad-836a-ec144ffeb88c)] Stopped all active workers for stack DELETE

We see different req-id in every log, despite they are processing the same request.

Changed in keystoneauth:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystoneauth (master)

Reviewed: https://review.opendev.org/c/openstack/keystoneauth/+/864309
Committed: https://opendev.org/openstack/keystoneauth/commit/c800dcee75144e96aef23abaaa3a78078e7f0992
Submitter: "Zuul (22348)"
Branch: master

commit c800dcee75144e96aef23abaaa3a78078e7f0992
Author: Vadym Markov <email address hidden>
Date: Mon Nov 7 19:55:01 2022 +0200

    Keep request-id at redirect

    Currently when redirects are used, the request id can get lost on redirect.
    Proposed patch reuses req-id from redirect response and passes it to
    actual request

    Closes-Bug: #2000742
    Change-Id: I98d5d4490b3d5667677cdd19f3c7b39abe6044ef

Changed in keystoneauth:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/keystoneauth 5.4.0

This issue was fixed in the openstack/keystoneauth 5.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.