After updating ash from version 2.17.11 to 2.17.12, 9 test failures showed up in my test suite. All the failures were on API tests that use ash_graphql. I’m on ash_graphql 0.25.13. All the failures are the same: the response contains the "message": "forbidden"
error, the kind you get when the actor doesn’t have permission to access something. The logs did not contain any policy breakdown (it seems never to work during ash_graphql tests).
These are all the log entries that are logged for a failing test:
20:00:26.004 request_id=F8qg_y1LnSpDpzwAAA2B [info] POST /api/gql
20:00:26.029 request_id=F8qg_y1LnSpDpzwAAA2B [info] GF.Carts.PaymentMethodInput.create
20:00:26.029 request_id=F8qg_y1LnSpDpzwAAA2B [info] Sent 200 in 24ms
My config/test.exs contains this :ash, :policies
entry:
config :ash, :policies,
show_policy_breakdowns?: true,
log_policy_breakdowns: :info,
log_successful_policy_breakdowns: :debug
When changing it to log_policy_breakdowns: :warning
, this log entry changes from an info
to a warning
level:
20:00:26.029 request_id=F8qg_y1LnSpDpzwAAA2B [warning] GF.Carts.PaymentMethodInput.create
I tried bypassing ash_graphql, writing a test that only calls Ash.Changeset
and my Ash API module, but there was no authorization error, and I’m not sure I’m setting it up the same way that ash_graphql is.
Without a policy breakdown, and no details in the logs, how does one go about troubleshooting this issue?