Sometimes getting error "The supplied set of access grants is not valid" when creating a meta def

Following up on this issue posted a few days ago in the old forum:

I’ve updated my access grants to the recommended ones in this migration but it still getting this error sometimes.

I’ve had to wrap my functions that do this in a retry mechanism. After the 2nd or 3rd retry it usually works, but would like to get this fixed.

Hey @muchisx :waving_hand: - I’m from the Shopify Dev Support team. Would you be able to share an X-Request-ID from the API response header for an example of the issue?

I wasn’t able to replicate the error on my end here (based on the example you shared in the old forum - the metafield definition created successfully for me), so I do think you may be right that it’s related to access scopes/authentication potentially.

If you don’t have a request ID handy, no worries - if you’re able to share the shop ID and your app ID as well as a general time of when the issue popped up (if you can share a specific time down to the second, that would be helpful too), I can take a look in our logs for you.

If you can share the full access scopes your app has as well, I can try to recreate a similar app on my end and see if I can trigger the error.

Hope to hear from you soon!

2 Likes

Hi @Alan_G !

Thanks for jumping in!
We don’t log the response headers on error (we should, will add that!).

So here’s the other info:
Shop ID: 61739335754
App ID: 85266137089
Time: April 1st 2025 - 08:03:29.479 PM UTC
Scopes : read_customers,read_locations,read_metaobject_definitions,read_metaobjects,read_orders,read_products,read_shipping,unauthenticated_read_content,unauthenticated_read_metaobjects,write_metaobject_definitions,write_metaobjects,write_shipping

Error:
{
field: [ ‘definition’ ],
message: ‘The supplied set of access grants is not valid.’,
code: ‘INVALID_INPUT’
}


So just to confirm, this error happens 2-3 times and then after it doesn’t happen anymore for the same mutation.

For that given mutation it was the metafieldDefinitionUpdate but I’ve seen it happen with metafieldDefinitionCreate too

Let me know if I can give more info that would be helpful for you, thanks !

Thanks @muchisx - I think I was able to trace the error in our logs here, I’ll ping our devs internally to see if we can narrow down why you’re seeing this pop up intermittently. I wasn’t able to replicate the issue on my end here though - very strange.

I’ll loop back with you once I have some more info to share!

1 Like

Thank you @Alan_G !

Let me know if you need any more info to help debug. This is still happening