Hi, I'm currently having inconsistencies with conn...
# permit-saas
e
Hi, I'm currently having inconsistencies with connecting to the PDP server. Would love to dm someone to resolve this
a
Hi @Ethan Kong, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
p
Hey, thanks for reaching out ! It seems our team is a little busy right now, a human will be with you within the next hour or so. In the meantime, can I help you ?
a
* PDP connection issues can stem from a few common causes: ​*Networking/DNS issues*​ – If the client cannot connect to the server, you may see logs like:
Copy code
Trying to connect to Pub/Sub server - <ws://localhost:7002/ws>
RPC connection was refused by server
(1) ​*Common fixes:*​ • Verify your
PDP_URL
is correct (e.g.,
<http://localhost:7766>
for local Docker, or
<https://cloudpdp.api.permit.io>
for cloud PDP) (2) • Check DNS resolution from within your container – in some cases (especially WSL/Docker setups) , DNS configuration can cause failures to resolve
<http://api.permit.io|api.permit.io>
(3) • Ensure your
PDP_API_KEY
environment variable is set correctly (2) ​*To run a local PDP:*​
Copy code
docker run -it \
  -p 7766:7000 \
  --env PDP_API_KEY=<your-permit-api-key> \
  --env PDP_DEBUG=True \
  permitio/pdp-v2:latest
* To help our engineers investigate further, could you please share: 1. Which ​*Workspace / Project / Environment*​ you are using 2. What ​*calls*​ you are performing (SDK code or cURL) 3. Which ​*PDP version*​ you are running 4. ​*Relevant logs*​ from your PDP You can also reach out directly via Email for further assistance.
To learn more, see the sources I considered: [[1] Troubleshooting](https://docs.opal.ac/getting-started/running-opal/troubleshooting) [[2] Permit's PDP (Policy Decision Point)](https://docs.permit.io/concepts/pdp/overview) [[3] Docker image errors out - cannot get config from control plane](https://github.com/permitio/PDP/issues/251)
e
I am able to successfully sync a user to the PDP, however I run into a 403 error immediately after when attempting to run a check with the same user.
n
Hi @Ethan Kong - thanks for reaching out. Our team will get back to you first thing tomorrow.
o
you're probably using the wrong API, for starters make sure you're using the same environment API key for both SDK and PDP
a
Weis, that could be the case - how do we go about where Ethan has multiple projects in permit but i want to run pdp ( which takes only one api key ) in the same eks cluster
o
since there's seem to be some confusion on your side. I'd start with running a separate API key for pdp and not using a project key you can use a project key and passing them environment ID but it starts with a basic setup and then upgrade it to avoid confusion. Also from a security perspective we discourage using project or org keys, as this conflicts with the least privilege principal @Ask Inkeep please share how to setup a PDP with a project key.
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
* To set up a PDP with a ​*Project API Key*​, you need to understand the API key hierarchy and how to pass the environment context. ​*API Key Types*​ (1) : 1. ​*Organization API Keys*​ – Access your entire Permit workspace (all projects and environments) 2. ​*Project API Keys*​ – Access a single project and all environments within it 3. ​*Environment API Keys*​ – Access a single environment only. ​*Only this type can be used by the PDP container*​ ​*Important*​: The documentation states that only ​*Environment API Keys*​ can be used directly by the PDP container. ​*Recommended Approach*​: As mentioned by the team, using environment-level keys aligns with the least-privilege principle. For each PDP instance, use the environment-specific API key. ​*To run a PDP*​ (2) :
Copy code
docker run -it \
  -p 7766:7000 \
  -p 8181:8181 \
  --env PDP_API_KEY=<YOUR_API_KEY> \
  --env PDP_DEBUG=True \
  permitio/pdp-v2:latest
​*To get your Environment API Key via API*​ (3) : First, get your project:
Copy code
curl '<https://api.permit.io/v2/projects>' \
  -H 'authorization: Bearer API_SECRET_KEY'
Then get environments for that project:
Copy code
curl '<https://api.permit.io/v2/projects/project_id_or_key/envs>' \
  -H 'authorization: Bearer API_SECRET_KEY'
You can also retrieve or manage environment API keys through the Settings -&gt; API Keys screen in the dashboard. (1) ​*For multiple projects in the same EKS cluster*​: You would typically run separate PDP instances (or deployments) , each configured with its own environment-level API key for the specific environment it serves.
To learn more, see the sources I considered: [[1] Using the API](https://docs.permit.io/api/api-with-cli) [[2] Deploy Permit to Production](https://docs.permit.io/how-to/deploy/deploy-to-production) [[3] Overview](https://docs.permit.io/api/examples/get-project-and-env)
o
@Ask Inkeep you forgot to include the instructions on how to use a project key with. a PDP and the environment variable to pass the env id
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
* You're right, my apologies! Here's how to run the PDP with a ​*Project API Key*​ or ​*Organization API Key*​: (1) ​*Using a Project API Key:*​ You need to set
PDP_PROJECT_API_KEY
and specify the environment with `PDP_ACTIVE_ENV`:
Copy code
docker run -it \
  -p 7766:7000 \
  --env PDP_PROJECT_API_KEY=<YOUR_PROJECT_API_KEY> \
  --env PDP_ACTIVE_ENV=<YOUR_ENVIRONMENT_ID_OR_KEY> \
  --env PDP_DEBUG=True \
  permitio/pdp-v2:latest
​*Using an Organization API Key:*​ You need to set
PDP_ORG_API_KEY
and specify both the project and environment:
Copy code
docker run -it \
  -p 7766:7000 \
  --env PDP_ORG_API_KEY=<YOUR_ORG_API_KEY> \
  --env PDP_ACTIVE_PROJECT=<YOUR_PROJECT_ID_OR_KEY> \
  --env PDP_ACTIVE_ENV=<YOUR_ENVIRONMENT_ID_OR_KEY> \
  --env PDP_DEBUG=True \
  permitio/pdp-v2:latest
This approach is useful when you want a single API key for multiple environments or to reduce secrets management overhead. However, as mentioned, environment-level keys are recommended from a least-privilege security perspective.
To learn more, see the sources I considered: [[1] Deploy Permit to Production](https://docs.permit.io/how-to/deploy/deploy-to-production)
a
sorry what do u mean
API key for hpvp
?
currently we do have project/environment key set up on pdp
but ethan is trying to access a different project and hence the problem
a
Thanks for tagging me @Or Weis. I'll look through relevant sources and get back to you shortly.
* Got it — if Ethan needs to access a ​*different project*​, then the current PDP setup (configured for one project/environment) won't work for that other project. ​*The core issue*​: A single PDP instance is tied to ​*one environment*​ at a time. If you're using a Project API Key with
PDP_ACTIVE_ENV
, that PDP will only serve policy decisions for that specific environment within that project. (1) ​*Options for multiple projects in the same EKS cluster*​: 1. ​*Run separate PDP instances*​ — Each PDP deployment uses its own Environment API Key (or Project API Key +
PDP_ACTIVE_ENV
) for the specific project/environment it needs to serve. This is the recommended approach. 2. ​*Use an Organization API Key*​ — If you need one PDP to serve a specific environment across projects, you can use:
Copy code
docker run -it \
  -p 7766:7000 \
  --env PDP_ORG_API_KEY=<YOUR_ORG_API_KEY> \
  --env PDP_ACTIVE_PROJECT=<YOUR_PROJECT_ID_OR_KEY> \
  --env PDP_ACTIVE_ENV=<YOUR_ENVIRONMENT_ID_OR_KEY> \
  --env PDP_DEBUG=True \
  permitio/pdp-v2:latest
But note: even with an Org API Key, you still specify ​*one*​ project and ​*one*​ environment per PDP instance. ​*Bottom line*​: For Ethan to access a different project, you'll need a separate PDP instance configured for that project's environment. * To help our engineers investigate the 403 error Ethan mentioned earlier, could you share: 1. Which ​*Workspace / Project / Environment*​ Ethan is using 2. The ​*SDK code or cURL calls*​ being performed 3. The ​*PDP version*​ you're running 4. ​*Relevant PDP logs*​
To learn more, see the sources I considered: [[1] Deploy Permit to Production](https://docs.permit.io/how-to/deploy/deploy-to-production)
o
sorry typo, menat "pdp"
I recommend you DON'T USE project keys
a
so use organization keys instead ?
o
No. only environment keys.
a
Weis, can we please schedule 30 mins next week. We have some questions around this.
p
Hey, thanks for reaching out ! It seems our team is a little busy right now, a human will be with you within the next hour or so. In the meantime, can I help you ?
a
sorry we didnt get it Weis, as when we try to create the env key to a tied to a Project and Ethan is trying to access a different project than the one PDP is running as
p
Hey, thanks for reaching out ! It seems our team is a little busy right now, a human will be with you within the next hour or so. In the meantime, can I help you ?
t
you should only use env keys for PDP. A PDP is tied to an env
a
can we please schedule 30 mins next week. We have some questions around this.
Yes — you can book 30 minutes with Thomas here: https://calendly.com/thomas-permitio/30min
👀 1