Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple warnings about "policy" field validation in Directus v11 #3

Open
paulrudy opened this issue Aug 13, 2024 · 6 comments
Open

Comments

@paulrudy
Copy link

paulrudy commented Aug 13, 2024

Installing the website-cms template on a fresh deployment of Directus v11 causes errors regarding policy field validation.

Steps to reproduce

Basically, follow the instructions on the README for this repo using Directus's v11 (latest as of this writing). In summary:

  1. Deploy using the latest Directus image (v11.x) directus/directus:latest
  2. Create an Admin static token
  3. Open a shell in the app and npx directus-template-cli@latest apply
  4. Choose official templates (maybe it's called community templates)
  5. Choose Headless CMS template

Outcome: 250 warnings: Warning: Status 400 • "Validation failed for field \"policy\". Value is required." like this:

...
Loading translations... done
Loaded translations
 ›   Warning: Status 400 • "Validation failed for field \"policy\". Value is required."

<<n=250 of the above warning>>

Loading 267 permissions... done
Loaded permissions
------------------
Template applied successfully.

Note that the template did install successfully. I didn't immediately find any issue with the Directus app and the installed template afterwards, so it's possible that the warnings weren't important, but I have no way of knowing.

Installing on Directus v10 produces no such warnings. I'm assuming this has to do with Directus v11 introducing policies. Perhaps the template(s) need to be updated? It's also unclear whether these warnings can be safely ignored.

@SN3-K
Copy link

SN3-K commented Aug 21, 2024

@paulrudy , try to purge your directus instance and re create a new database.

My Team is not currently experiencing this in our directus deployments ( EC2 + Postgres ).

I am wondering if something just got out of whack with your instance.

@paulrudy
Copy link
Author

@paulrudy , try to purge your directus instance and re create a new database.

My Team is not currently experiencing this in our directus deployments ( EC2 + Postgres ).

I am wondering if something just got out of whack with your instance.

Thanks for the reply. I think this has something to do with the repo not being updated for the policies introduced in v11.

I ran into this issue on a brand new database running Directus v11. When I created a new Directus running v10, there were no warnings. Upgrading from v10 to v11 presented no issues.

I got feedback on Directus Discord:

Just confirming - The templates will need to be updated to support v11 correctly

@SN3-K
Copy link

SN3-K commented Aug 23, 2024

Interesting, so this issue occurred when you deployed directly from v11, but when deploying from v10 , then upgrading to v11 this issue is resolved? @paulrudy

@SN3-K
Copy link

SN3-K commented Aug 23, 2024

Can you edit this issue to include all steps to reproduce the bug?

@paulrudy
Copy link
Author

Interesting, so this issue occurred when you deployed directly from v11, but when deploying from v10 , then upgrading to v11 this issue is resolved? @paulrudy

Yes, exactly. Or at least, there is no indication of any problem when upgrading.

Can you edit this issue to include all steps to reproduce the bug?

The steps are essentially following the README of this repo while using a fresh deploy of Directus v11, but I've added them for clarity.

@SN3-K
Copy link

SN3-K commented Aug 23, 2024

This is actually covered here:

directus-labs/directus-template-cli#61
@paulrudy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants