How to troubleshoot 504 status code in TIBCO Cloud API Management?

How to troubleshoot 504 status code in TIBCO Cloud API Management?

book

Article ID: KB0071615

calendar_today

Updated On:

Products Versions
TIBCO Cloud API Management -

Description

CAPIM or CAPIM-LE(formerly Mashery Local) is a gateway between the clients and backends.
'504' is the status code used for any kind of network/communication issue between CAPIM-LE and its backend.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504
And 'Gateway Timeout' is the default reason phrase.

So the phrase doesn't always mean there was a timeout; it could be a connection issue too.

Issue/Introduction

This article provides inputs to troubleshoot 504 errors in CAPIM or CAPIM-LE(Local Edition)

Environment

All Support Platforms

Resolution

#time concepts
remote_total_time
- is the time taken for the exchange between CAPIM-LE and Backend;
-- includes time taken for transfer as well Backed processing time

exec_time
- includes remote_total_time plus any processing time CAPIM-LE takes.

connect_time
- time taken by CAPIM-LE to make a connection

#responsestr
- 504 Gateway Timeout(Proxy) indicates the trafficmanager or proxy_worker is returning this error.
- 504 Gateway Timeout(API) indicates this response is from the backend and that tm/proxy_worker got the response in time.

#things to check
Please review the enriched access logs and check for patterns:
- genuine timeouts(remote_total_time ~ ResponseTimeout on the EP)
- connection issues(remote_total_time < ResponseTimeout) (for e.g. connect resets etc)
- connection is refused or not established(remote_total_time=0) (for e.g: backend is down, ssl handshake error etc)

#CAPIM
- For CAPIM Support can check access logs and proxy logs for patterns and more information on the 504 errors.
- If ECLE/ECLS is enabled on the area, customer already has access to the enriched access to check for patterns and timestamps.

#CAPIM-LE
- On CAPIM-LE, enriched access logs can be found on the log pod(s) in the below location:
/mnt/data/trafficmanager/enriched/access
- To check for connection and other errors, proxy logs are available in the below location in tm pod(s):
/var/log/mashery/tml-tm