Azure / Azure/api-management-self-hosted-gateway

STDOUT producing malform JSON

Open
#386 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Mustache
Stars
90
Forks
39
Avg merge
5m
Merged PRs (30d)
2

Description

### Report

Report
Following issues:

HTTP error value incorrectly set
```
{"level":"Verbose","timestamp":"2026-03-02T21:01:19.4676972Z","eventType":"ResponseReceivedInFull","apiId":"open-wilcosandbox2-api-api","operationId":"open-wilcosandbox2-api-operation-420","tags":0,"httpMethod":"POST","source":"Http1UpstreamResponseHandler","serviceName":"apim-gateway","transportError":0,"httpError":0,"payloadBuffered":0}{
azure-apim-gateway-azure-api-management-gateway-db97fb964-pbjdv "isRequestSuccess":true{"level":"Verbose","timestamp":",2026-03-02T21:01:19.4677028Z","eventType":"ChannelLeaseReturned","apiId":"open-wilcosandbox2-api-api","operationId":"totalTime":"open-wilcosandbox2-api-operation-420","tags":0,"267httpMethod":,"category""POST","source"::"Http1Connections-ChannelPool#9#100.64.28.241:443#tls=weil-sand.opensandbox2.company.com:Tls12:False:False:-464039545;proxy=;port=443","serviceName":""apim-gateway"GatewayLogs","message":,"callerIpAddress":""channel=[id: 0x5691b4a0, L:100.112.7.140:57728 - R:100.64.28.241:443]","transportError":0,"httpError":100.112.16.138","timeGenerated":"2026-03-02T21:01:19.2003054Z"0,"payloadBuffered":,"region":"eastus"0}
```
Another issue,
```
{"level":"Verbose","timestamp":"2026-03-02T21:29:57.2022958Z","eventType":"ResourceCountChanged","message":{"2 -> 3","source":"isRequestSuccess":true,"totalTime":141,"category":"GatewayLogs","callerIpAddress":"100.112.16.138""Http1Connections-ChannelPool#1#100.64.28.241:443#tls=cohenseglias-sand.opensandbox2.company.com:Tls12:False:False:-810888139;proxy=;port=443"}
,"timeGenerated":"2026-03-02T21:29:57.0607332Z","region":"eastus","correlationId":"2e573d72-d273-47e1-8c58-ac37b1b3c4d6","method":"PATCH","url":"https://cohenseglias-sand.opensandbox2.company.com/open/wilcosandbox2/api/api/api/common/v1/clients/57550","backendResponseCode":200,"responseCode":200,"responseSize":2991,"cache":"none","backendTime":140,"requestSize":1625,"apiId":"open-wilcosandbox2-api-api","operationId":"open-wilcosandbox2-api-operation-63","clientProtocol":"HTTP/1.1","backendProtocol":"HTTP/1.1","backendId":"open-wilcosandbox2-api-backend","apiRevision":"1","clientTlsVersion":"1.3","backendMethod":"PATCH","backendUrl":"https://wilcosandbox2-api.open.svc.cluster.local/api/api/common/v1/clients/57550"}

```

### Expected Behavior

Shall not produce error

### Actual Behavior

```
{"level":"Verbose","timestamp":"2026-03-02T21:01:19.4676972Z","eventType":"ResponseReceivedInFull","apiId":"open-wilcosandbox2-api-api","operationId":"open-wilcosandbox2-api-operation-420","tags":0,"httpMethod":"POST","source":"Http1UpstreamResponseHandler","serviceName":"apim-gateway","transportError":0,"httpError":0,"payloadBuffered":0}{
azure-apim-gateway-azure-api-management-gateway-db97fb964-pbjdv "isRequestSuccess":true{"level":"Verbose","timestamp":",2026-03-02T21:01:19.4677028Z","eventType":"ChannelLeaseReturned","apiId":"open-wilcosandbox2-api-api","operationId":"totalTime":"open-wilcosandbox2-api-operation-420","tags":0,"267httpMethod":,"category""POST","source"::"Http1Connections-ChannelPool#9#100.64.28.241:443#tls=weil-sand.opensandbox2.company.com:Tls12:False:False:-464039545;proxy=;port=443","serviceName":""apim-gateway"GatewayLogs","message":,"callerIpAddress":""channel=[id: 0x5691b4a0, L:100.112.7.140:57728 - R:100.64.28.241:443]","transportError":0,"httpError":100.112.16.138","timeGenerated":"2026-03-02T21:01:19.2003054Z"0,"payloadBuffered":,"region":"eastus"0}
```

### Steps to Reproduce the Problem

1.
2.
3.

### Logs from self-hosted gateway

```
{"level":"Verbose","timestamp":"2026-03-02T21:01:19.4676972Z","eventType":"ResponseReceivedInFull","apiId":"open-wilcosandbox2-api-api","operationId":"open-wilcosandbox2-api-operation-420","tags":0,"httpMethod":"POST","source":"Http1UpstreamResponseHandler","serviceName":"apim-gateway","transportError":0,"httpError":0,"payloadBuffered":0}{
azure-apim-gateway-azure-api-management-gateway-db97fb964-pbjdv "isRequestSuccess":true{"level":"Verbose","timestamp":",2026-03-02T21:01:19.4677028Z","eventType":"ChannelLeaseReturned","apiId":"open-wilcosandbox2-api-api","operationId":"totalTime":"open-wilcosandbox2-api-operation-420","tags":0,"267httpMethod":,"category""POST","source"::"Http1Connections-ChannelPool#9#100.64.28.241:443#tls=weil-sand.opensandbox2.company.com:Tls12:False:False:-464039545;proxy=;port=443","serviceName":""apim-gateway"GatewayLogs","message":,"callerIpAddress":""channel=[id: 0x5691b4a0, L:100.112.7.140:57728 - R:100.64.28.241:443]","transportError":0,"httpError":100.112.16.138","timeGenerated":"2026-03-02T21:01:19.2003054Z"0,"payloadBuffered":,"region":"eastus"0}
```

### Self-hosted Gateway Version

2.11.0

### Deployment

Self-Managed (YAML/Helm)

### Platform

Microsoft Azure

### Kubernetes Version

1.26

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the malformed stdout logs with self-hosted gateway version 2.11.0 deployed through YAML/Helm on Kubernetes 1.26 in Azure. Compare the reported ResponseReceivedInFull and ChannelLeaseReturned records with the expected JSON structure; done means each emitted log record is valid JSON without interleaved or corrupted fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, helm, json, kubernetes
Domain
devops, observability-sre
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.