All Products
Search
Document Center

Mobile Platform as a Service:How to troubleshoot MGS call error

Last Updated:Apr 08, 2021

Problem description

  • Prerequisites:

    • The client has correctly accessed the Mobile Gateway Service (MGS) component.
    • The backend APIs have been well configured on the MGS console.
  • Problem:

    • The client initiates a PRC call through coding, but fails to get the expected result.
  • Common errors:

    • No response returned from MGS (an error occured on the client).
    • No response returned from MGS (timed out).
    • There is response returned from MGS, but the result code shows that there is an error.
    • There is response returned from MGS without error, but the returned value does not meet the expectation.

Troubleshooting

For the four common types of errors mentioned above, the basic troubleshooting ideas are as follows:

  • No response returned from MGS (an error occured on the client):

    1. Determine the error source based on the detailed exception to the client.
    2. Check the access issues.
    3. Check type conversion issues.
    4. Check empty value issues.
    5. Check network connections.
  • No response returned from MGS (timed out):

    • The timeout scenarios would be complicated. The time limit may be from timeout setting of clients, timeout limit of intermediate devices, API timeout setting of MGS gateway, and timeout setting of servers at the backend.
    • In the case of timeout, the first thing to do is to confirm where the timeout comes from (client, network or server), then make further replication and analysis based on the specific timeout scenario.
  • There is response returned from MGS, but the result code shows that there is an error:

    • Refer to Description of gateway result code, to determine the source of error.
    • In general, the error code on the gateway side is related to the configuration of MGS client or server capabilities, including permission, encryption, decryption, signature verification, and API flow restriction. In such a case, check the access method, signature verification configuration, encryption, decryption configuration carefully according to the error.
    • In general, the error on the business side is related to the application service at the backend. Be sure to combine the logs and errors of the back-end application services to troubleshoot the business-side services for exceptions.
  • There is response returned from MGS without error, but the returned value does not meet the expectation:

    • These errors perhaps relate to application logic.
    • Check whether the mapping relationship between the call request value and the return value is as expected.
    • Check whether the request value received on the business-side service is as expected.
    • Check whether the request value processed by the business-side service is as expected.
    • Check whether the data format returned by the business-side service is as expected.

Tools and means

It is essential to capture HTTP packets or network packets to help with problem analysis in troubleshooting issues involving gateway calls.