Skip to content

openstack: guard WriteChangeID volume lookup + enable token reauth - #178

Open
bredy0 wants to merge 1 commit into
vexxhost:mainfrom
bredy0:fix/writechangeid-guard-and-reauth
Open

bredy0 wants to merge 1 commit into
vexxhost:mainfrom
bredy0:fix/writechangeid-guard-and-reauth

Conversation

@bredy0

@bredy0 bredy0 commented Sep 23, 2026

Copy link
Copy Markdown

Two related issues surface on long‑running migrations (large disks / slow links), where the Keystone token can expire mid‑copy:

  1. No token refresh. NewClientSet builds the provider from AuthOptionsFromEnv() but never sets AllowReauth, so the token obtained at start is never renewed. A migration that runs longer than the token TTL fails its end‑of‑copy Cinder calls with 401 Unauthorized. Fix: opts.AllowReauth = true (credentials come from env, so gophercloud can re‑authenticate transparently).

  2. WriteChangeID panics on any non‑"not found" error. It only handles ErrorVolumeNotFound from GetVolumeForDisk; for any other error (incl. the 401 above, "multiple volumes found", or a list/get error) it falls through and dereferences a nil volume, crashing the process after the copy completed and leaving the target volume attached. GetCurrentChangeID already has the correct guard. Fix: add else if err != nil { return err } and initialise volume.Metadata if nil.

Together: long copies now complete (token refreshes), and any genuine volume‑lookup error is returned cleanly and retryably instead of crashing.

Signed-off-by: Tomas Bredar <tomas.bredar@telekom.sk>
@bredy0
bredy0 force-pushed the fix/writechangeid-guard-and-reauth branch from a28cea5 to 62040ad Compare September 24, 2026 09:33
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

Successfully merging this pull request may close these issues.

1 participant