Contact Us 1-800-596-4880

Troubleshoot API Provisioning Issues

After you provision an adapter, you must create an API, to which you then bind the service. You might encounter errors when you provision an API if you provide invalid credentials. The following section provides possible causes and solutions for your API provisioning issues:

Client Secret is Incorrectly Configured

If using a secret when you create an API, you must verify that you are correctly referencing the secret.

Cause

If you provide incorrect credentials, the following error occurs:

Credentials error when provisioning APIs

Diagnosis

To diagnose the issue:

Describe your service instance using the kubectl describe serviceinstance api_instance_name command:

+ $ kubectl describe serviceinstance inventory-resource-api In the Status field, a detailed description of the error is displayed:

+ image::error-with-params-error-display-api-prov-service-mesh.png[Error with parameters when provisioning APIs]

In the following example, an error occurred due to an extra comma in the stringData section that is provided after the client secret segment:

apiVersion: v1
kind: Secret
metadata:
  name: my-credentials
  namespace: nto-payment
type: Opaque
stringData:
  user-pass:
    '{
      "clientId": "<id>",
      "clientSecret": "<secret>",
    }'

Solution

To resolve this issue:

  1. Delete the API.

  2. Resolve the credentials error.

  3. Re-create the API.

API Specification File Exceeds Supported Size

When provisioning an API with a specification file that is larger than 550 KB, you might encounter issues with the provision operation or the Service Mesh services.

Cause

If you use a large file, the pods might be restarted due to Service Catalog limitations:

E0605 21:13:58.080886       1 controller_instance.go:1968] ServiceInstance "default/flights-api-v1" v8611662: Failed to update status: rpc error: code = ResourceExhausted desc = trying to send message larger than max (2554151 vs. 2097152)
I0605 21:13:58.080907       1 controller.go:408] Dropping ServiceInstance "default/flights-api-v1" out of the queue: rpc error: code = ResourceExhausted desc = trying to send message larger than max (2554151 vs. 2097152)

Diagnosis

To diagnose the issue:

  1. Check the status of the Service Catalog pods:

    $ kubectl get pods -n service-mesh

    If a status other than Running is displayed , the Service Catalog pods might be failing due to lack of resources.

  2. If the pod is running correctly, check the logs for rpc errors:

    $ kubectl logs -f deployment/service-mesh-catalog-controller-manager -n service-mesh --tail=250 | grep "rpc error"

Solution

To resolve this issue:

  1. If the Service Catalog pods are failing, increase their resource limits:

    $ kubectl -n service-mesh set resources deployment service-mesh-catalog-controller-manager --limits=memory=64Mi

    $ kubectl -n service-mesh set resources deployment service-mesh-catalog-webhook --limits=memory=64Mi

  2. Delete the service instance.

  3. Create the API from Anypoint Platform.

API Provisioning Failure

When you provision an API by using Anypoint Service Mesh, the asset (in Exchange) and the API instance (in API Manager) might not be successfully created in Anypoint Platform.

Causes

This error can occur if you are attempting to:

  • Re-create an asset in Exchange that was more than seven days old before being deleted

  • Provision an API with invalid values

Diagnose

To diagnose this issue:

  1. Run the $ asmctl api list command.

    The status of the API is displayed as ProvisionCallFailed.

  2. Run the asmctl api logs --name=<replace_with_api_name> --namespace=<replace_with_namespace> command.

    The following output illustrates provisioning an API with an invalid version:

    DATE                   MESSAGE
    2020-05-29T17:12:36Z   Error provisioning ServiceInstance of ClusterServiceClass (K8S: "1c3b2100-5cdc-49ea-9423-dd7170e674b4" ExternalName: "anypoint-platform-api-instance") at ClusterServiceBroker "service-mesh-incluster-broker": Status: 400; ErrorMessage: Bad Request; Description: version: should match pattern "^\d+\.\d+\.\d+(-.+)?$" (ID: 49724b5d-7fad-4cc3-980e-695c2e47b383); ResponseError: <nil>
  3. If no information is displayed, run the kubectl describe serviceinstances <replace_with_api_name> -n <replace_with_namespace> command.

    The status section of the resource displays an error message explaining the issue:

    Error provisioning ServiceInstance of ClusterServiceClass (K8S: "1c3b2100-5cdc-49ea-9423-dd7170e674b4"
    ExternalName: "anypoint-platform-api-instance") at ClusterServiceBroker "service-mesh-incluster-broker": Status: 410; ErrorMessage: Gone; Description: Error from Exchange: There is no asset matching given parameters. (ID: 79d0cc7f-9969-477b-816d-c822916c0290); ResponseError: <nil>' reason: ProvisionCallFailed

In this case, the error is caused by an attempt to re-create an asset in Exchange that was more than seven days old before being deleted. Because Exchange does not allow that operation, provide a new assetId to create a new asset.

Solution

To resolve this issue:

  1. Delete your API:

    asmctl api delete --name=<replace_with_api_name> --namespace=<replace_with_namespace>

  2. Fix the error by providing a new asset ID.

  3. Re-create the API.