---
schema_version: "1"
id: c3106007c9ca2c0e342fe4054c7ea2948fb5e14d3de9d26a789ccef2b8e38be9
title: PDK Troubleshooting
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/pdk/1.4/policies-pdk-troubleshooting.md
canonical_url: https://docs.mulesoft.com/pdk/1.4/policies-pdk-troubleshooting
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 94ece213884a9b9e393f72ebfeb2d25fc0fa1fd3619ce4e873b4056e669e025c
description: MuleSoft Documentation Site
release: "1.4"
latest: false
---
---
product: Omni Gateway Policy Development Kit (PDK)
version: 1.4
---

# PDK Troubleshooting

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

When using Flex Gateway Policy Development Kit (PDK), you might encounter issues with PDK itself.
See the following sections to help you resolve these issues:

- [Cargo-Generate Error on a Mac Device](#cargo-generate)

- [Anypoint CLI Credentials Error](#cli-credential)

- [Group ID Error When Creating the Policy Project](#group-id-error)

- [401 Authorization Error When Running Make Setup](#authorization-error)

To debug issues with your custom policy, see:

- [Debugging Custom Policies with the PDK Debugging Playground](https://docs.mulesoft.com/pdk/1.4/policies-pdk-debug-local)

- [Debugging Deployed Custom Policies](https://docs.mulesoft.com/pdk/1.4/policies-pdk-debug-deployed-policies)

## Cargo-Generate Error on a Mac Device

When compiling Rust on a Mac Device for the first time, the following error might occur:

```ssh
$ cargo install cargo-generate
error: linking with `cc` failed: exit status: 1
[...]
```

To troubleshoot this error:

1.  Ensure Xcode is installed, then compile again.

    To install Xcode, execute the following command:

    ```ssh
    xcode-select --install
    ```

2.  If Xcode is installed and PDK still does not compile, create or edit the `~/.cargo/config.toml`
    file by adding the following:

    ```toml
    [target.x86_64-apple-darwin]
    rustflags = [
      "-C", "link-arg=-undefined",
      "-C", "link-arg=dynamic_lookup",
    ]
    [target.aarch64-apple-darwin]
    rustflags = [
      "-C", "link-arg=-undefined",
      "-C", "link-arg=dynamic_lookup",
    ]
    ```

## Anypoint CLI Credentials Error

Anypoint CLI requires multi-factor authentication (MFA) with a Connected App. Using any PDK command
without Connected App credentials results in an error similar to the following:

```ssh
Error: Failed to launch the browser process! undefined
[...]:ERROR:ozone_platform_x11.cc(239)] Missing X server or $DISPLAY
[21921:21921:1103/113335.217708:ERROR:env.cc(255)] The platform failed to initialize. Exiting.
TROUBLESHOOTING: https://pptr.dev/troubleshooting
```

To configure Anypoint CLI with MFA authentication using a Connected App, refer to
[Authentication to the Anypoint Platform CLI](https://docs.mulesoft.com/anypoint-cli/latest/auth).

## Group ID Error When Creating the Policy Project

Anypoint CLI uses the `ANYPOINT_ORG` environment variable. This variable can use either the
organization name or the organization ID as the value. If the variable is set to the organization
name, the [policy creation command](https://docs.mulesoft.com/pdk/1.4/policies-pdk-create-project) fails to infer the group ID of the
organization.

Use the organization ID for the value of `ANYPOINT_ORG`. However, if you cannot change the variable,
use one of the following methods to provide the group ID:

- If you run the create command and receive the following prompt:

  ```ssh
  Please provide a valid group-id (the id of the organization that will own the asset):
  ```

  Enter your group ID, then press Enter.

- Use the `--group-id` flag when creating the PDK project, for example:

  ```ssh
  anypoint-cli-v4 pdk policy-project create -n <policy-name> --group-id <organization-id>
  ```

## 401 Authorization Error When Running Make Setup

When executing \`make setup', the following error might occur:

```ssh
$ make setup
       Login token for `anypoint` saved
[...]

Caused by:
  failed to get successful HTTP response from `https://anypoint.mulesoft.com/crates[...]/download` [...], got 401
  body:
make: *** [install-cargo-anypoint] Error 101
```

This error occurs when your version of Rust is not v1.87.0 or later.

To solve this error, refer to
[Rust Requirements for Using PDK](https://docs.mulesoft.com/pdk/1.4/policies-pdk-prerequisites#rust-requirements) to ensure your Rust
software meets the required version.

## See Also

- [Policy Development Kit Architecture Overview](https://docs.mulesoft.com/pdk/1.4/policies-pdk-architecture)

- [Prerequisites for Flex Gateway Policy Development Kit (PDK)](https://docs.mulesoft.com/pdk/1.4/policies-pdk-prerequisites)

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