Hi, I am testing ABAC policies locally to change s...
# opal
m
Hi, I am testing ABAC policies locally to change some conditions in ABAC rules. My local PDP needs about 5 minutes to update the changed conditions... Is it possible to force an immediate update? Interestingly, when I change any state in the policy editor, it is updated immediately. PDP LOGS
Copy code
2025-10-15T09:25:08.891982+0000 | opal_client.policy.updater              | INFO  | Received policy update: topic=d7c2f5d674f54f82a21b401cf5190d32:policy:., message={'old_policy_hash': '9ed9fb1d2c4defae9d020e36f3c8510aa2930464', 'new_policy_hash': '7a919fe931c2403e183b134187a28abd8a8878d4', 'changed_directories': ['.', 'permit', 'permit/generated', 'permit/generated/conditionset']}
2025-10-15T09:25:08.892246+0000 | opal_client.policy.updater              | INFO  | Refetching policy code (delta bundle), base hash: '9ed9fb1d2c4defae9d020e36f3c8510aa2930464'
2025-10-15T09:25:08.892655+0000 | opal_client.policy.fetcher              | INFO  | Fetching policy bundle from <https://opal-v2.permit.io/scopes/d7c2f5d674f54f82a21b401cf5190d32/policy>
2025-10-15T09:25:10.461838+0000 | uvicorn.protocols.http.httptools_impl   | INFO  | 127.0.0.1:37394 - "GET /healthy HTTP/1.1" 200
2025-10-15T09:25:11.840135+0000 | opal_client.policy.fetcher              | INFO  | Fetched valid bundle, id: 7a919fe931c2403e183b134187a28abd8a8878d4
2025-10-15T09:25:11.841801+0000 | opal_client.policy.updater              | INFO  | got policy bundle (delta): '9ed9fb1d2c4defae9d020e36f3c8510aa2930464' -> '7a919fe931c2403e183b134187a28abd8a8878d4', manifest: ['permit/generated/conditionset/Large_5fquantity.rego'], deleted: None
2025-10-15T09:25:11.847489+0000 | opal_client.engine.logger               | INFO  | Received request.    PUT /v1/policies/permit/generated/conditionset/Large_5fquantity.rego
2025-10-15T09:25:11.994635+0000 | opal_client.engine.logger               | INFO  | Sent response.       PUT /v1/policies/permit/generated/conditionset/Large_5fquantity.rego -> 200
Any thoughts? Screenshot from activity logs for the condition change (there is my local time so 9:20 utc)
a
Hi @Michał Wójcik, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
Based on your logs, the policy update is actually happening quite quickly (about 3 seconds from receiving the update to completing it) . The 5-minute delay you're experiencing is likely the time between when you make changes and when OPAL detects and propagates them. You can trigger an immediate data update using the PDP's API endpoint (1) :
Copy code
curl -XPOST <http://localhost:7766/data-updater/trigger>
This will force the PDP to fetch the latest policy data immediately rather than waiting for the next polling interval . For debugging this ABAC policy update issue, could you please provide: 1. Which Workspace / Project / Env you are using 2. What calls you are performing (as SDK code or CURL) 3. Which PDP version you are running 4. Any additional relevant logs from your PDP The logs you've shown indicate the policy update is working correctly once triggered - the issue appears to be the initial detection delay rather than the update process itself.
To learn more, see the sources I considered: [[1] Send Consistent Updates (Read-Your-Own-Writes)](https://docs.permit.io/how-to/manage-data/local-facts-uploader)
m
workspace: sea.live project: dev env: default pdp version : the latest
a
Hey @Michał Wójcik, thanks for reaching out, we're investigate it and will circle back to you soon
✅ 1
Hey @Michał Wójcik, thanks for your patience! Could you check now if you're seeing any improvement on your end?
m
At this point, I can see in the pdp logs that opal detects the change and updates it immediately, but when I call the check function, it still returns the same result despite the change... Could this be a cache issue? After restarting, pdp works as it should. Is there any way I can get around this? I have a demo tomorrow and I wanted to show them ABAC :)
t
hey @Michał Wójcik what is your pdp config? also can you try and delete the local image
latest
and re pull
o
Also please share these recent PDP logs
m
@Thomas I did that.
Copy code
docker run -it -p 7766:7000 -p 8181:8181 --env PDP_API_KEY=secret--env PDP_DEBUG=True permitio/pdp-v2:latest
I changed policy then in logs observed first event about policy update so it should be fine, but I expected as a results true, but check endpoint retuned me still false, then after 30 seconds I got second policy update and result was as expected (without touching UI). I did it multiple times and synchronization time is various (30 seconds, 1 minute, 5 minutes) Full log: 2025-10-15T182922.261896+0000 | opal_client.data.rpc | INFO | Received notification of event: d7c2f5d674f54f82a21b401cf5190d32datapolicy_data 2025-10-15T182922.262898+0000 | opal_client.data.updater | INFO | Updating policy data, reason: Update on ConditionSet by id='b962f839-8dec-40e4-aedd-f11f499cb0e6' 2025-10-15T182922.263674+0000 | opal_client.data.updater | INFO | Triggering data update with id: 09f8c2c05b874fa98355910ba7a9d7cb 2025-10-15T182922.264033+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/internal/opal_data/aa6741c8-2672-4252-bbe8-7390cd2b1bea/e89b882c-4665-4433-85a9-41d285a3cd7b/2adb08e5-5e51-4573-b89f-16a6d1878f08/condition_sets/b962f8398dec40e4aeddf11f499cb0e6 2025-10-15T182922.682072+0000 | opal_client.data.updater | INFO | Saving fetched data to policy-store: source url='https://pdp-deltas.api.permit.io/v2/internal/opal_data/aa6741c8-2672-4252-bbe8-7390cd2b1bea/e89b882c-4665-4433-85a9-41d285a3cd7b/2adb08e5-5e51-4573-b89f-16a6d1878f08/condition_sets/b962f8398dec40e4aeddf11f499cb0e6', destination path='/condition_sets/userset_Seacom_5fUsers' 2025-10-15T182922.686693+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/data/condition_sets/userset_Seacom_5fUsers 2025-10-15T182922.693424+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/data/condition_sets/userset_Seacom_5fUsers -> 204 2025-10-15T182922.695592+0000 | opal_client.callbacks.reporter | INFO | Reporting the update to requested callbacks 2025-10-15T182922.695999+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/pdps/me/opal_data_callback 2025-10-15T182922.696776+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://opal-relay.api.permit.io/v2/pdp/callback?retry=0 2025-10-15T182924.790848+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182925.989458+0000 | opal_client.engine.logger | INFO | Received request. POST /v1/data/permit/root [2025-10-15T182925Z INFO pdp_server:opa client:allowed] permit.check("grzegorz@sea.com", "distribute", "market_order:anton03") -> true ->wrong it should be false 2025-10-15T182925.992136+0000 | opal_client.engine.logger | INFO | Sent response. POST /v1/data/permit/root -> 200 2025-10-15T182929.316801+0000 | opal_client.engine.logger | INFO | Logs uploaded successfully. {"plugin": "decision_logs", "time": "2025-10-15T182929Z"} 2025-10-15T182929.789516+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182936.762258+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182941.763062+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182946.763267+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182951.763592+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182954.203447+0000 | opal_client.policy.updater | INFO | Received policy update: topic=d7c2f5d674f54f82a21b401cf5190d32policy., message={'old_policy_hash': 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68', 'new_policy_hash': '08cecb6dc0f06e00a8d1d70cf43ff83489162bbc', 'changed_directories': ['.', 'permit', 'permit/generated', 'permit/generated/conditionset']} 2025-10-15T182954.204322+0000 | opal_client.policy.updater | INFO | Refetching policy code (delta bundle), base hash: 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68' 2025-10-15T182954.205152+0000 | opal_client.policy.fetcher | INFO | Fetching policy bundle from https://opal-v2.permit.io/scopes/d7c2f5d674f54f82a21b401cf5190d32/policy 2025-10-15T182954.833619+0000 | opal_client.policy.fetcher | INFO | Fetched valid bundle, id: dd095faa5fc81051dce9c5d0928bf4490c5c0d68 2025-10-15T182954.835244+0000 | opal_client.policy.updater | INFO | got policy bundle (delta): 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68' -> 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68', manifest: [], deleted: None 2025-10-15T182954.836915+0000 | opal_client.callbacks.reporter | INFO | Reporting the update to requested callbacks 2025-10-15T182954.837470+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/pdps/me/opal_data_callback 2025-10-15T182954.975112+0000 | opal_client.policy.updater | INFO | Received policy update: topic=d7c2f5d674f54f82a21b401cf5190d32policy., message={'old_policy_hash': 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68', 'new_policy_hash': '08cecb6dc0f06e00a8d1d70cf43ff83489162bbc', 'changed_directories': ['.', 'permit', 'permit/generated', 'permit/generated/conditionset']} 2025-10-15T182954.975607+0000 | opal_client.policy.updater | INFO | Refetching policy code (delta bundle), base hash: 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68' 2025-10-15T182954.976810+0000 | opal_client.policy.fetcher | INFO | Fetching policy bundle from https://opal-v2.permit.io/scopes/d7c2f5d674f54f82a21b401cf5190d32/policy 2025-10-15T182955.561865+0000 | opal_client.policy.fetcher | INFO | Fetched valid bundle, id: dd095faa5fc81051dce9c5d0928bf4490c5c0d68 2025-10-15T182955.562942+0000 | opal_client.policy.updater | INFO | got policy bundle (delta): 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68' -> 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68', manifest: [], deleted: None 2025-10-15T182955.564035+0000 | opal_client.callbacks.reporter | INFO | Reporting the update to requested callbacks 2025-10-15T182955.564254+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/pdps/me/opal_data_callback 2025-10-15T182956.035236+0000 | opal_client.policy.updater | INFO | Received policy update: topic=d7c2f5d674f54f82a21b401cf5190d32policy., message={'old_policy_hash': 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68', 'new_policy_hash': '08cecb6dc0f06e00a8d1d70cf43ff83489162bbc', 'changed_directories': ['.', 'permit', 'permit/generated', 'permit/generated/conditionset']} 2025-10-15T182956.035617+0000 | opal_client.policy.updater | INFO | Refetching policy code (delta bundle), base hash: 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68' 2025-10-15T182956.036687+0000 | opal_client.policy.fetcher | INFO | Fetching policy bundle from https://opal-v2.permit.io/scopes/d7c2f5d674f54f82a21b401cf5190d32/policy 2025-10-15T182956.565716+0000 | opal_client.policy.fetcher | INFO | Fetched valid bundle, id: 08cecb6dc0f06e00a8d1d70cf43ff83489162bbc 2025-10-15T182956.567145+0000 | opal_client.policy.updater | INFO | got policy bundle (delta): 'dd095faa5fc81051dce9c5d0928bf4490c5c0d68' -> '08cecb6dc0f06e00a8d1d70cf43ff83489162bbc', manifest: ['permit/generated/conditionset/Seacom_5fUsers.rego'], deleted: None 2025-10-15T182956.571783+0000 | opal_client.engine.logger | INFO | Received request. PUT /v1/policies/permit/generated/conditionset/Seacom_5fUsers.rego 2025-10-15T182956.685782+0000 | opal_client.engine.logger | INFO | Sent response. PUT /v1/policies/permit/generated/conditionset/Seacom_5fUsers.rego -> 200 2025-10-15T182956.687204+0000 | opal_client.callbacks.reporter | INFO | Reporting the update to requested callbacks 2025-10-15T182956.687438+0000 | opal_client.data.fetcher | INFO | Fetching data from url: https://pdp-deltas.api.permit.io/v2/pdps/me/opal_data_callback 2025-10-15T182956.764385+0000 | uvicorn.protocols.http.httptools_impl | INFO | 127.0.0.1:51776 - "GET /healthy HTTP/1.1" 200 2025-10-15T182959.503277+0000 | opal_client.engine.logger | INFO | Received request. POST /v1/data/permit/root [2025-10-15T182959Z INFO pdp_server:opa client:allowed] permit.check("grzegorz@sea.com", "distribute", "market_order:anton03") -> false -> correct after ~34 seconds since I changed rule on the UI
o
There are two types of updates in the system policy (code such as ABAC conditions) and facts (data such as permission or role assignment) fact updates are usually within 100ms policy updates should happen within a few seconds - 30 seconds is within bounds - 5 minutes is outside of expected bounds. We did have a server issue that we addressed, and working to investigate further that slowed down updates dramatically. There might be a few more slow effects here, that we’ll address further.
t
@Michał Wójcik can you try a manual call to the PDP to update the policy? https://pdp-api.permit.io/redoc#tag/Policy-Updater/operation/trigger_policy_update_policy_updater_trigger_post
m
Thomas, I tried to invoke these endpoints, but the update is not immediate. I keep my fingers crossed that the server problem will be solved. I tested ABAC some time ago and I remember that it worked without any problems :)
t
@Michał Wójcik for the sake of your demo you may need to reboot the PDP as a temporary workaround (just as an interim). The reason it can have up to 5 minute delay is that policy code doesn't change that often and thus has a max longer time to be updated. Normally people aren't doing live demos of ABAC policies that have to be consistently synced 😅
✅ 1
o
@Michał Wójcik looking at the logs you attached I can see the second update did arrive shortly after the first one ( see PUT /v1/policies/… ) After that arrived the pdp was up to date with the latest changes - it did happen ~30seconds after the data update, but do notice it can happen due to policy updates being slower than data updates as they include actual change of code ( similarly, a rollout deployment in k8s using helm or any other tool takes some time ) Can you attach the logs of the 5 minutes time ( preferably as a file I guess ), did it happen also after we improved the performance on our side ?