---
schema_version: "1"
id: 5a397ff32cb737ff6c42f13ccbccfab46e57ee3f77ec73fefffd283694e39eb7
title: Troubleshooting with the CLI
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/latest/troubleshoot-admin-api.md
canonical_url: https://docs.mulesoft.com/gateway/latest/troubleshoot-admin-api
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 537748b2dd719defcc7fe695b5b6e8fbeb335400b26bc4e366f1ba667be94391
description: MuleSoft Documentation Site
release: "1.14"
latest: true
---
---
product: Omni Gateway
version: 1.14
is-latest-version: true
---

# Troubleshooting with the CLI

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Omni Gateway includes a `flexctl dump` CLI that collects a full snapshot of the gateway’s runtime
state and writes it to a single ZIP file. The snapshot includes information related to a gateway’s
API instances, services, configuration, and available extensions (policies), along with logs, Envoy
statistics, and other diagnostic data.

The dump is assembled by the gateway and streamed directly to the CLI. Each source is collected on a
best-effort basis: if a particular source is unavailable, that entry is omitted and the rest of the
ZIP is still produced.

As an example, the following inline configuration snippet defines a single API instance named
`jsonplaceholder-api` in the default namespace (it remains `default` because namespace is not
explicitly defined.) Additionally, the snippet defines one included policy:
`http-basic-authentication-flex`.

> [!NOTE] To run `flexctl dump` for Linux deployments, either add the user to the `flex` user group
> or run `flexctl dump` with the `sudo` command. To learn more, see
> [Troubleshooting Linux Permissions](https://docs.mulesoft.com/gateway/latest/troubleshoot-linux-permissions).

## Configuration Example

apiVersion: gateway.mulesoft.com/v1alpha1 kind: ApiInstance metadata: name: jsonplaceholder-api
spec: address: http://0.0.0.0:8080 services: jsonplaceholder: address:
https://jsonplaceholder.typicode.com:443/ routes: - rules: - path: /api(/users/.\*) - path:
/api(/comments/.\*) policies: - policyRef: name: http-basic-authentication-flex config: username:
chris password: admin

## Run the CLI

1.  To collect a snapshot of the gateway’s runtime state, run the following command:

    ```ssh
    flexctl dump
    ```

    By default, the command writes the snapshot to a file named `dump.zip` in the current directory.

    > [!NOTE] When running in a Docker or Podman container, either run the command in the container
    > itself or stream the ZIP out of the container without entering it. To learn more, see
    > [Change the Output Location](#change-output-location).

2.  Extract the ZIP file to view its contents. The ZIP includes the following entries, among others:

    <table><colgroup><col> <col></colgroup><thead><tr><th>Entry</th><th>Description</th></tr></thead><tbody><tr><td><p><code>resources/ApiInstance.json</code></p></td><td><p>All API instances known to the gateway.</p></td></tr><tr><td><p><code>resources/Service.json</code></p></td><td><p>All services known to the gateway.</p></td></tr><tr><td><p><code>resources/Configuration.json</code></p></td><td><p>The gateway’s effective configuration.</p></td></tr><tr><td><p><code>resources/Extension.json</code></p></td><td><p>All extensions (policies) available in the gateway.</p></td></tr><tr><td><p><code>resources/PolicyBinding.json</code></p></td><td><p>All policy bindings.</p></td></tr><tr><td><p><code>logs/current</code></p></td><td><p>The current log file.</p></td></tr><tr><td><p><code>envoy/stats.json</code>, <code>envoy/config_dump.json</code>, <code>envoy/memory.json</code></p></td><td><p>Envoy statistics, configuration, and memory usage.</p></td></tr><tr><td><p><code>env/vars.json</code></p></td><td><p>The gateway process environment variables, with sensitive values redacted.</p></td></tr></tbody></table>

    > [!NOTE] Some entries appear only when the corresponding data is available in your deployment.

3.  View the contents of any extracted JSON file by running `cat` followed by the file name. For
    example, the extracted files resemble the following:

    - Api Instances

    - Services

    - Configuration

    - Extensions

    ```ssh
    cat resources/ApiInstance.json
    ```

    The `resources/ApiInstance.json` file contents resemble the following:

    \[ { "address":"http://0.0.0.0:8080", "kind":"ApiInstance", "name":"jsonplaceholder-api",
    "namespace":"default", "policies":\[ { "config":{ "password":"admin", "username":"chris" },
    "extension":{ "kind":"Extension", "name":"http-basic-authentication-flex", "namespace":"default"
    }, "kind":"Policy", "name":"jsonplaceholder-api-http-basic-authentication-flex-1",
    "namespace":"default" }, { "config":{ "destinationRef":{ "kind":"Service",
    "name":"jsonplaceholder-api-jsonplaceholder", "namespace":"default" } } "extension":{
    "kind":"Extension", "name":"route", "namespace":"default" }, "kind":"Policy",
    "name":"jsonplaceholder-api-jsonplaceholder-route-1", "namespace":"default", "order":50,
    "rules":\[ { "path":"/api(/users/.\*)" }, { "path":"/api(/comments/.\*)" } \] }, { "extension":{
    "kind":"Extension", "name":"envoy.filters.http.router", "namespace":"default" },
    "kind":"Policy", "name":"envoy.filters.http.router", "namespace":"default", "order":2147483647 }
    \] } \]

    ```ssh
    cat resources/Service.json
    ```

    The `resources/Service.json` file contents resemble the following:

    \[ { "address":"https://jsonplaceholder.typicode.com:443/", "kind":"Service",
    "name":"jsonplaceholder-api-jsonplaceholder", "namespace":"default" } \]

    ```ssh
    cat resources/Configuration.json
    ```

    The `resources/Configuration.json` file contents resemble the following:

    { "internalMetrics": { "enabled": false }, "logging": {}, "platformConnection": { "anypoint": {
    "url": "https://anypoint.mulesoft.com" }, "environment": { "cluster\_id":
    "4aa281e9-1a1d-4c56-8669-2d887b2e1938", "env\_id": "ad067f80-69ee-4abb-9d05-bec98ece1e20",
    "org\_id": "1caa0b9b-4f4d-43c4-a1b6-f925a8c77baa" }, "logging": { "certificate": { "cert":
    "demo-local.pem", "key": "demo-local.key" }, "url":
    "https://logging.ingestion.us-east-1.msap.io/ingestion/api/v1/logging" }, "metering": {
    "certificate": { "cert": "demo-local.pem", "key": "demo-local.key" }, "url":
    "https://metering.ingestion.us-east-1.msap.io/ingestion/api/v1/metering" }, "mode": "offline",
    "monitoring": { "certificate": { "cert": "demo-local.pem", "key": "demo-local.key" }, "url":
    "https://monitoring.ingestion.us-east-1.msap.io/ingestion/api/v1/monitoring" }, "runtimeEvents":
    { "certificate": { "cert": "demo-local.pem", "key": "demo-local.key" }, "url":
    "https://anypoint.mulesoft.com/apiruntime/v1/events" } }, "resourceLimits": { "apiInstances":
    100, "policies": 400 }, "sharedStorage": {}, "version": "1.1.0" }

    ```ssh
    cat resources/Extension.json
    ```

    The `resources/Extension.json` file contains all the policies available in Omni Gateway. The
    file contents resemble the following:

    { "extends": \[ { "kind": "Extension", "labels": { "flex.mulesoft.com/created-by":
    "flex-filesystem", "flex.mulesoft.com/managed-by": "flex-filesystem" }, "name":
    "extension-definition", "namespace": "default" }, { "kind": "Extension", "labels": {
    "flex.mulesoft.com/created-by": "flex-filesystem", "flex.mulesoft.com/managed-by":
    "flex-filesystem" }, "name": "extension-qos", "namespace": "default" } \], "kind": "Extension",
    "labels": { "flex.mulesoft.com/created-by": "flex-filesystem", "flex.mulesoft.com/managed-by":
    "flex-filesystem" }, "name": "header-injection-definition", "namespace": "default",
    "properties": \[ { "name": "config", "properties": \[ { "items": { "name": "inboundHeaders",
    "properties": \[ { "name": "key", "type": "stringOrDataweave" }, { "name": "value", "type":
    "stringOrDataweave" } \], "type": "object" }, "name": "inboundHeaders", "type": "array" }, {
    "items": { "name": "outboundHeaders", "properties": \[ { "name": "key", "type":
    "stringOrDataweave" }, { "name": "value", "type": "stringOrDataweave" } \], "type": "object" },
    "name": "outboundHeaders", "type": "array" } \], "type": "object" } \] }

## Change the Output Location

Use the `-o` (or `--output`) flag to write the ZIP file to a specific path, including the file name.
For example, to write the dump to `/tmp/my-dump.zip`, run the following command:

```ssh
flexctl dump -o /tmp/my-dump.zip
```

To stream the ZIP file to standard output instead of writing it to a file, pass either `-` or
`/dev/stdout` to the `-o` flag, and redirect the output:

```ssh
flexctl dump -o - > dump.zip
```

Streaming to standard output also lets you capture a dump from a container without entering it:

```ssh
docker exec flex-gateway flexctl dump -o - > dump.zip
```

## Change Verbosity Level

You can change the amount of information output by the `flexctl dump` CLI. For example, to increase
verbosity to a value of `10`, run `flexctl dump` with the following:

```ssh
flexctl dump -v 10
```

## See Also

- [Known Issues](https://help.salesforce.com/s/issues)
