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

Issues with loading initial data (SearchPromotion) #447

Open
lb- opened this issue Sep 12, 2023 · 0 comments
Open

Issues with loading initial data (SearchPromotion) #447

lb- opened this issue Sep 12, 2023 · 0 comments

Comments

@lb-
Copy link
Member

lb- commented Sep 12, 2023

I am using wagtail-docker-develop and on the latest main I am having trouble re-syncing the database with the initial data.

Steps to reproduce

  1. Run docker make start
  2. SSH into bakerydemo make ssh
  3. In the SSH session run the migrate ./manage.py migrate
  4. Then run the initial data loading ./manage.py load_initial_data

django.db.utils.IntegrityError: Problem installing fixture '/code/bakerydemo/bakerydemo/base/fixtures/bakerydemo.json': Could not load wagtailsearchpromotions.SearchPromotion(pk=3): null value in column "external_link" violates not-null constraint

Docker output.

db        | 2023-09-12 21:06:33.707 UTC [31] ERROR:  null value in column "external_link" violates not-null constraint
db        | 2023-09-12 21:06:33.707 UTC [31] DETAIL:  Failing row contains (3, 0, , 36, 5, null, null).
db        | 2023-09-12 21:06:33.707 UTC [31] STATEMENT:  INSERT INTO "wagtailsearchpromotions_searchpromotion" ("id", "query_id", "page_id", "sort_order", "description") VALUES (3, 5, 36, 0, '') RETURNING "wagtailsearchpromotions_searchpromotion"."id"

Note that this is on an existing docker image, not sure if that will cause issues.

When I try to flush the DB I get a different error

root@3ed86aae1d34:/code/bakerydemo# python manage.py flush
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the "wagtail" database,
and return each table to an empty state.
Are you sure you want to do this?

    Type 'yes' to continue, or 'no' to cancel: yes
CommandError: Database wagtail couldn't be flushed. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the expected database tables doesn't exist.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.

Maybe this issue should move to the Wagtail docker repo instead?

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

1 participant