IBM Support

API Connect v5 Gateway- Troubleshooting unable to retrieve policy information error

Troubleshooting


Problem

In API Connect version 5 and the v5 compatible DataPower Gateway in later editions, users might observe their API calls for a specific API are returning a 500 response code.

Symptom

In the DataPower logs you might see entries like:



Mon May 17 2021 18:15:00 [0x80e0013a][mpgw][info] source-https(webapi-https): tid(536425)[XX.XXX.XXX.XXX]: Received HTTP/1.1 POST for /api/acme/v1/product-collections from XX.XXX.XXX.XXX
...
Mon May 17 2021 18:15:00 [0x80e003aa][xmlparse][error] mpgw(webapi): tid(536425)[request][XX.XXX.XXX.XXX] gtid(ded5a08e5f15b4f400067d62): illegal character 0x1f at offset 263298 of http://127.XXX.XXX.XXX:2444/swagger/v1/catalogs/67d8fd5gf5c1272066ee668e/apis/6g217dg75c15f29224g67egMon May 17 2021 18:15:00 [0x80e00041][network][error] mpgw(webapi): tid(536425)[request][XX.XXX.XXX.XXX] gtid(ded5a08e5f15b4f400067d62): url-open: Error parsing response from 'http://127.XXX.XXX.XXX:2444/swagger/v1/catalogs/67d8fd5gf5c1272066ee668e/apis/6g217dg75c15f29224g67eg'
Mon May 17 2021 18:15:00 [0x80000001][xsltmsg][error] mpgw(webapi): tid(536425)[request][XX.XXX.XXX.XXX] gtid(ded5a08e5f15b4f400067d62): HTTP/1.1 500 Internal Server Error: Unable to retrieve policy information
Mon May 17 2021 18:15:00 [0x80c00010][xslt][error] mpgw(webapi): tid(536425)[request][XX.XXX.XXX.XXX] gtid(ded5a08e5f15b4f400067d62): Processing of 'local:///isp/unified-request-select-and-set-policies.xsl' stopped: local://isp/error_template.xsl:85: xsl:message terminate=yes value='HTTP/1.1 500 Internal Server Error: Unable to retrieve policy information'

Cause

The error log message illegal character 0x1f at offset 263298 of http://127.XXX.XXX.XXX:2444/swagger/v1/catalogs/67d8fd5gf5c1272066ee668e/apis/6g217dg75c15f29224g67eg is indicating there is a character in the APIC metadata, which cannot be parsed.  As shown in the example log message, the actual character causing the issue is a hex 1F.
DataPower attempts to parse XML as UTF-8 characters, and when the character is not a valid UTF-8 character it cannot be parsed.

Diagnosing The Problem

To identify the character, which cannot be parsed, you can configure a probe trigger within the webapi-internal multi-protocol Gateway within your API Connect domain.

The probe is designed for use in specific debugging only. Development encourages its use only for low-volume debugging due to its invasive nature relative to a multi-step process.
If you need help with interpreting the probe, please raise a case with IBM support and upload the probe export and error report containing the logs from after you re-create the issue for review.

To configure the probe trigger:
1. In the webgui, open the webapi-internal MPGW with the objects menu, that is, from the navigation, Objects -> Service Configuration -> Multi-Protocol Gateway
2. Open the webapi-internal MPGW
3. Navigate to the Probe Settings Tab, if the Probe is disabled change the state to enabled but do NOT apply just yet
4. Navigate to the Probe Triggers Tab
5. Click the Add button and in the add dialog provide in the Inbound URL Match property the text for the URL experiencing issue and click Apply to add
For example, based on the sample logs the Inbound URL Match would be:
.*v1/catalogs/67d8fd5gf5c1272066ee668e/apis/6g217dg75c15f29224g67eg.*
6. Click Apply on the MPGW to apply the probe settings

7. Next, republish your API
8. After publishing completes, please run multiple requests of your API request and verify you are still seeing the same failure.
Assuming so,

9. View the probe for the webapi-internal MPGW and ensure a transaction for the URL was captured.  Export the probe.
10. Create an error report for your application domain to capture the logs, which show the failure and upload that file as well.

Resolving The Problem

Generally you need to update the source yaml and remove the character that cannot be parsed.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSMNED","label":"IBM API Connect"},"ARM Category":[{"code":"a8m0z000000cxxVAAQ","label":"API Connect->Developer (DV)->Encoding"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
09 June 2021

UID

ibm16458179