Skip to content

[BUG] Publisher returns 400 on namedValue validation error #722

@anotherRedbeard

Description

@anotherRedbeard

Release version

v6.0.1.3

Describe the bug

User has four named values, and one of them is causing the run to fail due to a 400.

Error:

2025-01-15T21:11:21.9043254Z info: publisher[0]
2025-01-15T21:11:21.9043509Z Putting named value "nameValueName"...
2025-01-15T21:11:21.9048080Z trce: HttpPipeline[0]
2025-01-15T21:11:21.9048306Z Starting request
2025-01-15T21:11:21.9048533Z Method: PUT
2025-01-15T21:11:21.9048935Z Uri: https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/namedValues/***?api-version=2023-09-01-preview
2025-01-15T21:11:21.9056031Z Content: {"properties":{"displayName":"name","secret":false,"tags":[],"value":"value"}}

2025-01-15T21:11:22.3571445Z trce: HttpPipeline[0]
2025-01-15T21:11:22.3571973Z Received response
2025-01-15T21:11:22.3572636Z Method: PUT
2025-01-15T21:11:22.3573114Z Uri: https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/namedValues/***?api-version=2023-09-01-preview
2025-01-15T21:11:22.3573517Z Status code: 201
2025-01-15T21:11:22.3573796Z Duration (hh:mm:ss): 00:00:00.4521093
2025-01-15T21:11:22.3574034Z Content: {
2025-01-15T21:11:22.3574411Z "id": "/subscriptions/subId/resourceGroups/rgName/providers/Microsoft.ApiManagement/service/serviceName/namedValues/nameValueName",
2025-01-15T21:11:22.3574795Z "type": "Microsoft.ApiManagement/service/namedValues",
2025-01-15T21:11:22.3575050Z "name": "name",
2025-01-15T21:11:22.3575262Z "properties": {
2025-01-15T21:11:22.3575502Z "ProvisioningState": "InProgress"
2025-01-15T21:11:22.3575713Z }
2025-01-15T21:11:22.3575896Z }

2025-01-15T21:11:23.6351174Z trce: HttpPipeline[0]
2025-01-15T21:11:23.6352000Z Received response
2025-01-15T21:11:23.6352266Z Method: GET
2025-01-15T21:11:23.6352717Z Uri: https://management.azure.com/subscriptions/***/resourceGroups/***/providers/Microsoft.ApiManagement/service/***/namedValues/***?api-version=2023-09-01-preview&asyncId=***&asyncCode=201
2025-01-15T21:11:23.6353178Z Status code: 400
2025-01-15T21:11:23.6353465Z Duration (hh:mm:ss): 00:00:00.2792674
2025-01-15T21:11:23.6353857Z Content: {"error":{"code":"ValidationError","message":"One or more fields contain incorrect values:","details":[{"code":"ValidationError","target":"name","message":"Property with the same name already exist."}]}}
2025-01-15T21:11:23.6547293Z crit: publisher[0]
2025-01-15T21:11:23.6547857Z Application failed.

When the user executes the PUT using the management APIs they work as expected outside of the pipeline. We've also confirmed that there is not another property with the same name using this endpoint: GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues?api-version=2024-05-01

Expected behavior

Named value is updated with the values from the json body

Actual behavior

Update doesn't occur b/c the GET fails after the PUT and causes the Publisher to shut down

Reproduction Steps

  • Make a change to a NamedValue
  • Run the extractor pipeline
  • Approve the PR that was created from extractor pipeline

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions