Hi, I would like to track lost messages so I can r...
# permit-saas
h
Hi, I would like to track lost messages so I can recover them @Ask Inkeep
a
Thanks for tagging me @Huy. I'll look through relevant sources and get back to you shortly.
Based on the available sources, I don't have specific information about tracking and recovering lost messages in Permit.io. The documentation covers audit logs for authorization decisions (1) (2) , policy decision points (3) , and deployment patterns (4) , but doesn't directly address message tracking or recovery mechanisms. If you're experiencing issues with lost messages or data synchronization, could you provide more details about: • What type of messages you're referring to (policy updates, authorization requests, audit logs) ? • What symptoms you're seeing that indicate messages are being lost? • Your deployment setup (sidecar, centralized, cloud PDP) ? This will help me provide more targeted guidance. You might also want to reach out over Email for assistance with specific troubleshooting.
To learn more, see the sources I considered: [[1] Audit Types & Filtering](https://docs.permit.io/how-to/use-audit-logs/types-and-filtering) [[2] Best Practices for Authorization Audit Logs](https://www.permit.io/blog/audit-logs) [[3] Permit's PDP (Policy Decision Point)](https://docs.permit.io/concepts/pdp/overview) [[4] On-Premises Deployment](https://docs.permit.io/how-to/deploy/on-prem/landing)
d
what do you mean by 'lost messages'?
h
Thanks for your response. I'm trying to use endpoint statistics according to the documentation to view messages for tracking PDP update activities, but it's not working. https://docs.permit.io/api/pdp-statistics
image.png
d
A few things to check • Project/environment mismatch. The
{{projId}}
and
{{envId}}
in your URL must match the project and environment your PDP is bound to — i.e. the env that owns the API key your PDP container was started with. If your PDP is running against environment A but you're querying stats for environment B, you'll get an empty array (no error). Easy way to sanity-check: open Permit dashboard → switch to the same env → confirm your PDP is listed/active there. •
{{apiKeyPermit}}
scope.
The stats API accepts any Environment API Key, but it returns PDPs for whatever `{{projId}}`/`{{envId}}` is in the path — those need to point to the env where the PDP actually lives. The key in the header just authenticates you; it doesn't auto-scope the query. • Is the PDP actually reaching Permit cloud? Check the PDP container logs for the
PDP ID is <uuid>
line (it logs this on startup). If you don't see it, or you see auth/connection errors to the Permit backend, the PDP never successfully registered and won't show up in stats. Outbound egress to
*.<http://permit.io|permit.io>
needs to be open. • Is the PDP recent enough? Older PDP versions (pre-
0.2.x
) didn't report into the stats API. If you're on a very old image, upgrade and restart. • *Try the org-level endpoint as a sanity check.*`GET https://pdp-statistics.api.permit.io/v2/stats/{org_id}/pdps` lists every PDP across your whole org — if your PDP shows up there but not in the env-scoped call, that confirms it's a project/env mismatch in the URL.
h
here is my pdp-id , i run
GET <https://pdp-statistics.api.permit.io/v2/stats/{org_id}/pdps>
it return result but it is old pdp 'org_id': '1c42cdd96a4e4e5d83ab1db54a7766c8', 'project_id': 'e1361e7a8ff34886b1c453ad14dbb8ad', 'env_id': '20df7c9764a54f7b9de170804f7e88e1'
Oh, I saw the results appear, but the status is currently "active false" even though my PDP is still working
d
There are two things happening: 1. Your running PDP is bound to a different project/env than the one you're querying stats for. Your PDP logs (Docker Desktop screenshot) show it's reporting against: •
project_id: e1361e7a8ff34886b1c453ad14dbb8ad
•
env_id: 20df7c9764a54f7b9de170804f7e88e1
•
pdp_id: dc52de97-5353-4f07-b247-973d6fbeb535
But the org-wide stats response (
/v2/stats/{orgId}/pdps
) only shows PDPs under: •
project_id: 62a17c26-e831-41b7-8874-bed53abb9b6f
•
env_id: f3404f33-3de3-4fc8-a685-42591608bc5c
Your currently-running PDP (
dc52de97...
) isn't in the org list at all. So when you called
/v2/stats/{projId}/{envId}/pdps
earlier and got
data: []
, that wasn't a bug — your
{{projId}}
/
{{envId}}
vars were pointing at the older project/env (the one matching the API key on the dashboard side), while the PDP is bound to a different one via the API key set on the PDP container (
PDP_API_KEY
env var). Fix: make sure all three are aligned: • The API key passed to the PDP container (
PDP_API_KEY
) • The
{{projId}}
and
{{envId}}
you put in the stats URL • The
{{apiKeyPermit}}
you use as the Bearer token All three need to refer to the same project + environment. Easiest way: in the Permit dashboard, switch to the env you want to monitor, copy that env's API key, restart the PDP with it, and use that same env's project/env keys (or IDs) in the stats URL. 2. The 404 on
/pdps/{{pdpId}}
is expected given the above.
You queried
/v2/stats/{{projId}}/{{envId}}/pdps/dc52de97-...
but `{{projId}}`/`{{envId}}` were pointing at the other project/env where that PDP doesn't exist — hence the
"PDP with id ... was not found"
. Once you align the project/env in the URL with the project/env the PDP is actually bound to, that lookup will return 200 and you'll then be able to query the messages endpoint with
?state=assumed_lost
for that env to track lost messages. Quick sanity check after you fix the alignment: hit
/v2/stats/{projId}/{envId}/pdps
again with the corrected vars — you should see
dc52de97-5353-4f07-b247-973d6fbeb535
in the response with
active: true
.
h
Thank you, but I think I've set the values ​​correctly, and I've tried all the endpoints 'org_id': '1c42cdd96a4e4e5d83ab1db54a7766c8', 'project_id': 'e1361e7a8ff34886b1c453ad14dbb8ad', 'env_id': '20df7c9764a54f7b9de170804f7e88e1' pdp-id: dc52de97-5353-4f07-b247-973d6fbeb535
I expect pdp active true because I'm still using it at the moment
d
Okay I will look into this more and get back to you
Can you send me your full pdp logs?
h
1. Containers 2. permit-pdp permit-pdp 7876c42b3f92 permitio/pdp-v2:latest 7000:7000⁠ STATUS Running (1 second ago) [2026-05-20T092156Z INFO watchdog::service] Starting health checks watchdog for 'python3' in 5s 2026-05-20T092205.452340+0000 | 15 | horizon.state | INFO | PDP ID is dc52de97-5353-4f07-b247-973d6fbeb535 2026-05-20T092205.452678+0000 | 15 | horizon.startup.remote_config | INFO | Fetching PDP config from control plane: https://api.permit.io/v2/pdps/me/config⁠ 2026-05-20T092209.516861+0000 | 15 | horizon.startup.remote_config | INFO | Received remote config with the following context: {'customer_id': '1c42cdd96a4e4e5d83ab1db54a7766c8', 'client_id': 'c70a9e89a22a4a58aeeec507e94ed493', 'backend_tier': 'https://api.permit.io', 'component': 'sidecar', 'org_id': '1c42cdd96a4e4e5d83ab1db54a7766c8', 'project_id': 'e1361e7a8ff34886b1c453ad14dbb8ad', 'env_id': '20df7c9764a54f7b9de170804f7e88e1'} 2026-05-20T092209.517412+0000 | 15 | horizon.pdp | INFO | Applying config overrides from cloud control plane... 2026-05-20T092209.517795+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_FETCHING_CALLBACK_TIMEOUT 2026-05-20T092209.518615+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_AUTH_PUBLIC_KEY 2026-05-20T092209.518832+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_DATA_TOPICS 2026-05-20T092209.518995+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_CLIENT_TOKEN 2026-05-20T092209.519166+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_SERVER_URL 2026-05-20T092209.519327+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_SERVER_WS_URL 2026-05-20T092209.519489+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_SERVER_PUBSUB_URL 2026-05-20T092209.519694+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_DEFAULT_DATA_SOURCES_CONFIG_URL 2026-05-20T092209.519880+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_SCOPE_ID 2026-05-20T092209.520050+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_SHOULD_REPORT_ON_DATA_UPDATES 2026-05-20T092209.520488+0000 | 15 | horizon.pdp | INFO | Overriden config key: OPAL_DEFAULT_UPDATE_CALLBACKS 2026-05-20T092209.520687+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_BACKEND_SERVICE_URL 2026-05-20T092209.520850+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_OPA_DECISION_LOG_ENABLED 2026-05-20T092209.520969+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_OPA_DECISION_LOG_INGRESS_ROUTE 2026-05-20T092209.521104+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_OPA_DECISION_LOG_INGRESS_BACKEND_TIER_URL 2026-05-20T092209.521218+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_CONTROL_PLANE_RELAY_JWT_TIER 2026-05-20T092209.521309+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_CONTROL_PLANE_RELAY_API 2026-05-20T092209.522127+0000 | 15 | horizon.pdp | INFO | Overriden config key: PDP_CONTROL_PLANE_PDP_DELTAS_API 2026-05-20T092209.522298+0000 | 15 | horizon.pdp |*WARNING | Ignored non-existing config key: PDP_FACTDB_BACKUP_SERVER_URL* 2026-05-20T092209.522454+0000 | 15 | horizon.pdp | INFO | PDP started at: 2026-05-20T092209.522691+0000 | 15 | horizon.pdp | INFO | org_id: 1c42cdd9-6a4e-4e5d-83ab-1db54a7766c8 2026-05-20T092209.522914+0000 | 15 | horizon.pdp | INFO | project_id: e1361e7a-8ff3-4886-b1c4-53ad14dbb8ad 2026-05-20T092209.523681+0000 | 15 | horizon.pdp | INFO | env_id: 20df7c97-64a5-4f7b-9de1-70804f7e88e1 2026-05-20T092209.524712+0000 | 15 | horizon.enforcer.opa.config_maker | INFO | Uploading decision logs to backend tier: https://decision-log-ingress.api.permit.io⁠ 2026-05-20T092209.749685+0000 | opal_client.policy_store.opa_client | INFO | Authentication mode for policy store: PolicyStoreAuth.TOKEN 2026-05-20T092209.750524+0000 | opal_client.callbacks.register | INFO | Callbacks register loaded 2026-05-20T092209.794429+0000 | opal_common.fetcher.fetcher_register | INFO | Loading FetcherProvider 'FastApiRpcFetchProvider' found at: <class 'opal_common.fetcher.providers.fastapi_rpc_fetch_provider.FastApiRpcFetchProvider'> 2026-05-20T092209.794853+0000 | opal_common.fetcher.fetcher_register | INFO | Loading FetcherProvider 'HttpFetchProvider' found at: <class 'opal_common.fetcher.providers.http_fetch_provider.HttpFetchProvider'> 2026-05-20T092209.795355+0000 | opal_common.fetcher.fetcher_register | INFO | Fetcher Register loaded
2026-05-20T092221.274518+0000 | opal_client.callbacks.reporter | INFO | Reporting the update to requested callbacks 2026-05-20T092221.276208+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/pdps/me/opal_data_callback⁠ 2026-05-20T092221.276723+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://opal-relay.api.permit.io/v2/pdp/callback?retry=0⁠ 2026-05-20T092221.279001+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:57900 - "GET /healthy HTTP/1.1" 503 2026-05-20T092221.323139+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/data/role_assignments/user:a 2026-05-20T092221.331525+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/policies/permit/debug/rebac/codes.rego 2026-05-20T092221.331929+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/data/role_assignments/user:a -> 204 2026-05-20T092221.333442+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/internal/opal_data/1c42cdd9-6a4e-4e5d-83ab-1db54a7766c8/e1361e7a-8ff3-4886-b1c4-53ad14dbb8ad/20df7c97-64a5-4f7b-9de1-70804f7e88e1/role_assignments/518ff656837f4a8380a8665818cd53e6⁠ 2026-05-20T092221.334016+0000 | opal_client.callbacks.reporter | INFO | Reporting the update to requested callbacks 2026-05-20T092221.334292+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/pdps/me/opal_data_callback⁠ 2026-05-20T092221.334607+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://opal-relay.api.permit.io/v2/pdp/callback?retry=0⁠ 2026-05-20T092221.506486+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/policies/permit/debug/rebac/codes.rego -> 200 2026-05-20T092221.527451+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/policies/permit/debug/rebac/debugger.rego 2026-05-20T092221.725124+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/policies/permit/debug/rebac/debugger.rego -> 200 2026-05-20T092221.730577+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/policies/permit/debug/debugger.rego 2026-05-20T092221.917541+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/policies/permit/debug/debugger.rego -> 200 2026-05-20T092221.925104+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/policies/permit/root.rego 2026-05-20T092222.054109+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/policies/permit/root.rego -> 200 2026-05-20T092222.059791+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/policies/custom/root.rego 2026-05-20T092222.139806+0000 | opal_client.data.updater | INFO | Saving fetched data to policy-store: source url='https://pdp-deltas.api.permit.io/v2/internal/opal_data/1c42cdd9-6a4e-4e5d-83ab-1db54a7766c8/e1361e7a-8ff3-4886-b1c4-53ad14dbb8ad/20df7c97-64a5-4f7b-9de1-70804f7e88e1/users/518ff656837f4a8380a8665818cd53e6', destination path='/users/a' 2026-05-20T092222.148313+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/data/users/a 2026-05-20T092222.156579+0000 | opal_client.data.updater | INFO | Saving fetched data to policy-store: source url='https://pdp-deltas.api.permit.io/v2/internal/opal_data/1c42cdd9-6a4e-4e5d-83ab-1db54a7766c8/e1361e7a-8ff3-4886-b1c4-53ad14dbb8ad/20df7c97-64a5-4f7b-9de1-70804f7e88e1/role_assignments/518ff656837f4a8380a8665818cd53e6', destination path='/role_assignments/user:a'
d
Please run these and send the output
Copy code
docker logs permit-pdp > pdp.log 2>&1
wc -l pdp.log
tail -200 pdp.log
docker exec permit-pdp curl -s <http://localhost:8181/health>
docker exec permit-pdp curl -s <http://localhost:7000/healthy>
h
pdp.log
d
Thank you for the data. After conferring with the team this API is deprecated and is not suggested to be used. We will update the docs accordingly. Why would you like to search for lost messages? If we understand your use-case more specifically, I can offer guidance
h
I plan to deploy multiple PDPs, so I want to ensure that all PDPs have the exact same state