Follow

Shape Defense Mobile SDK Troubleshooting Guide - Android

Description

This section helps developers resolve common problems and describes common status and error codes reported by Mobile SDK.

 

Environment

  • Silverline Shape Defense
  • Shape Defense Mobile SDK
  • Android

 

Common scenarios and solutions

Problem Possible solution
Headers not added
  • Verify that getRequestHeaders() is called to add Shape headers to request.
  • Verify that SDK initialize() is called before any network calls intended for protection are sent from application. If SDK is not initialized, getRequestHeaders() will leave the request without Shape headers.
  • Confirm that the URL parameter value is absolute and includes the protocol (e.g. https://domain.com/post)
There are too many configuration fetches
  • This may occur in cases of Shape SDK integrated within another “host” SDK. If the host SDK is killed and started multiple times during the lifecycle of the application, there will be many configuration fetches. The solution is to ensure that Shape SDK starts only once during the lifecycle of the application.
Why do I not see configuration fetch after blocking action?
  • Confirm that parseResponseHeaders() was called inside the request completion handler.
  • Confirm that parseResponseHeaders() was used with the actual response from the server (inspect response contents).
  • Confirm that there is a “reload” header in the response from Silverline, by using Charles proxy, or making a manual request using Curl.
Which environment variables should I use?
  • The environment variable tells SDK which configuration update URL to use. Use “default” as the environment variable string.

Where do I get a base configuration file?
  • The base configuration file can be downloaded from the Silverline portal.

 

Status and error codes

The codes listed in the tables below are reported by APIGuard log() method.

Error code Description
M0 APIGuard was initialized successfully.
M1 Configuration update process has started.
M2 Configuration update process has succeeded.
Error code Possible cause Possible solution
F1 APIGuard failed to initialize

This error is usually combined with other status codes, which provide the primary cause.

E59 transformRequest() or getRequestHeaders() was called before APIGuard was initialized

Review solutions for E1.

On iOS, call APIGuard methods using APIGuard.sharedInstance()

Make sure APIGuard had initialized successfully.

Allow more time for APIGuard to initialize.

E60 parseResponse failed to execute

On iOS, call APIGuard methods using APIGuard.​sharedInstance()​.parseResponse(response);

Make sure APIGuard had initialized successfully.

E26

SDK encountered a problem downloading an updated configuration

Routing is not setup for the configuration update URL

There is an Internet connectivity problem. Confirm that device is connected to the Internet.

Connect the device to the Internet.

Ensure that routing for the configuration URL is setup.

Note​: This is a non-fatal error. Requests are decorated even when configuration fetch fails.

E42

The key used was not in the updateURLMap of the​ base configuration.

The key used was not in the updateURLMap of the​ cached configuration.

Use environment key from environments which are configured in the Shape policy.

Confirm that both base configuration and current configuration have the environment variable you are using.

Note​: This is a non-fatal error. Requests are decorated even when specific environment variable is not found.

E27, F4

SDK failed to parse base configuration (unrecoverable error)

SDK failed to parse remote configuration (SDK should still decorate).

Configuration fetch received a 200 response, but the contents were not configuration file (SDK should still decorate).

Confirm that a valid configuration file is used as a base configuration, or served by the server.

Confirm that the base configuration file matches the version of the SDK (both should be for 3.5).

Confirm that routing is setup for the configuration fetch.

Confirm that base configuration file is encoded as UTF-8 or ASCII.

E31 Failure to open base configuration. Make sure the file path to the base configuration is correct.

 

Related Content

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request