Skip to content

fix(redis, rabbitmq): pass region and instance ID in the correct order on update - #1681

Open
johannes-engler-mw wants to merge 2 commits into
stackitcloud:mainfrom
johannes-engler-mw:fix/redis-rabbitmq-partial-update-region-arg-order
Open

fix(redis, rabbitmq): pass region and instance ID in the correct order on update#1681
johannes-engler-mw wants to merge 2 commits into
stackitcloud:mainfrom
johannes-engler-mw:fix/redis-rabbitmq-partial-update-region-arg-order

Conversation

@johannes-engler-mw

Copy link
Copy Markdown

Description

relates to #1677

PartialUpdateInstance is declared in the redis and rabbitmq SDKs as (ctx, projectId, regionId, instanceId), but both resources call it as (ctx, projectId, instanceId, region). Both parameters are string, so the transposition compiles cleanly and only shows up at runtime.

The SDK interpolates positionally into the path template:

localVarPath := ".../v2/projects/{projectId}/regions/{regionId}/instances/{instanceId}"
localVarPath = strings.Replace(localVarPath, "{regionId}", ...r.regionId..., -1)

so the instance UUID ends up in the {regionId} segment and the API rejects it:

│ Error: Error updating instance
│ Calling API: undefined response type, status code 400, Body: Bad Request: Invalid region specified.

Every other call in the same two files already passes (projectId, region, instanceId) — including the PartialUpdateInstanceWaitHandler a few lines below each defect, which is what makes the two call sites look correct at a glance.

Impact

This breaks every in-place update of stackit_redis_instance and stackit_rabbitmq_instance, not only changes to parameters. #1677 reports it via maxmemory_policy, but sgw_acl goes through the same call, so ACL changes are equally affected.

Worth noting for anyone hitting #1677: setting region explicitly in the configuration works around the plan-time symptom (the spurious force-replacement), but not this — the value is still passed into the wrong parameter slot at apply time.

Scope

I checked every service calling PartialUpdateInstance against its own SDK signature, since the argument order legitimately differs between SDKs. Only these two are wrong:

Service Call site SDK signature
redis (projectId, instanceId, region) (projectId, regionId, instanceId)
rabbitmq (projectId, instanceId, region) (projectId, regionId, instanceId)
mongodbflex (projectId, instanceId, region) (projectId, instanceId, region)
logme, mariadb, opensearch, postgresflex, sqlserverflex (projectId, region, instanceId) (projectId, region/regionId, instanceId)

mongodbflex looks like the same shape but its SDK genuinely declares (projectId, instanceId, region), so it is correct as written.

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory) — not applicable, no schema or usage change
  • Docs are up-to-date: make generate-docs (will be checked by CI) — no doc-affecting change
  • Unit tests got implemented or updated — see note below
  • Acceptance tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

On tests: the existing unit tests for these resources cover the helpers (mapFields, toCreatePayload, ...) and pass both before and after this change — they never reach the Update method, so they cannot catch this class of defect. Verifying it genuinely requires an acceptance test that performs an update against the API, which I cannot run here. Happy to add one if you would like it in this PR, though it may fit better as a follow-up covering the DSA services together.

…r on update

PartialUpdateInstance in the redis and rabbitmq SDKs is declared as
(ctx, projectId, regionId, instanceId), but both resources called it as
(ctx, projectId, instanceId, region). Both parameters are strings, so
the transposition compiles cleanly and only surfaces at runtime: the
instance UUID is interpolated into the {regionId} path segment, and the
API rejects the request with

    status code 400, Body: Bad Request: Invalid region specified.

Every other call in the same two files — including the
PartialUpdateInstanceWaitHandler a few lines below the defect — already
passes (projectId, region, instanceId).

This makes every in-place update of stackit_redis_instance and
stackit_rabbitmq_instance fail, not only changes to `parameters`.

The other services calling PartialUpdateInstance were checked against
their own SDK signatures and are correct: logme, mariadb, opensearch,
postgresflex and sqlserverflex take (projectId, region, instanceId),
while mongodbflex's SDK genuinely declares (projectId, instanceId,
region) and is called accordingly.

relates to stackitcloud#1677
@johannes-engler-mw
johannes-engler-mw requested a review from a team as a code owner August 12, 2026 09:49
@johannes-engler-mw

Copy link
Copy Markdown
Author

@GokceGK Any update when this will be released? Its blocking our whole infra deployments.

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.

2 participants