makeplane/plane · error · CommandError

User email is required and should have signed in plane

Error message

User email is required and should have signed in plane

What it means

Raised by the interactive `create_dummy_data` management command when the value typed at the 'Your email:' prompt is empty OR does not match any row in the `User` table (line 29: `creator == "" or not User.objects.filter(email=creator).exists()`). The command needs an existing, signed-in Plane user to become the workspace owner and first member, so it aborts. Because the whole handler is wrapped in `except Exception` (lines 72-74), the CommandError is actually caught and printed via `self.style.ERROR` then the command returns 0 rather than exiting non-zero.

Source

Thrown at apps/api/plane/db/management/commands/create_dummy_data.py:30

class Command(BaseCommand):
    help = "Create dump issues, cycles etc. for a project in a given workspace"

    def handle(self, *args: Any, **options: Any) -> str | None:
        try:
            workspace_name = input("Workspace Name: ")
            workspace_slug = input("Workspace slug: ")

            if workspace_slug == "":
                raise CommandError("Workspace slug is required")

            if Workspace.objects.filter(slug=workspace_slug).exists():
                raise CommandError("Workspace already exists")

            creator = input("Your email: ")

            if creator == "" or not User.objects.filter(email=creator).exists():
                raise CommandError("User email is required and should have signed in plane")

            user = User.objects.get(email=creator)

            members = input("Enter Member emails (comma separated): ")
            members = members.split(",") if members != "" else []
            # Create workspace
            workspace = Workspace.objects.create(slug=workspace_slug, name=workspace_name, owner=user)
            # Create workspace member
            WorkspaceMember.objects.create(workspace=workspace, role=20, member=user)
            user_ids = User.objects.filter(email__in=members)

            _ = WorkspaceMember.objects.bulk_create(
                [WorkspaceMember(workspace=workspace, member=user_id, role=20) for user_id in user_ids],
                ignore_conflicts=True,
            )

            project_count = int(input("Number of projects to be created: "))

View on GitHub (pinned to 1c8a60f858)

Solutions

  1. Confirm the user row exists: `python manage.py shell -c "from plane.db.models import User; print(User.objects.filter(email='you@example.com').exists())"`
  2. Have the user sign in through the web UI once so the `User` record is created, then re-run the command.
  3. Re-type the exact stored email (lower-cased) at the 'Your email:' prompt.

Example fix

# before
creator = input("Your email: ")   # typed '' or wrong email
# after
creator = input("Your email: ")   # enter the exact lowercased email of an existing User
Defensive patterns

Strategy: validation

Validate before calling

# Pre-flight: ensure the owner user exists before running the command
python manage.py shell -c "from plane.db.models import User; import sys; sys.exit(0 if User.objects.filter(email='owner@example.com').exists() else 1)"

Type guard

def is_existing_plane_user(email: str) -> bool:
    from plane.db.models import User
    return bool(email) and User.objects.filter(email=email).exists()

Try / catch

# create_dummy_data swallows CommandError internally (returns 0), so a shell-level
# try/catch will NOT see it. Validate inputs beforehand instead.

Prevention

When it happens

Trigger: Running `python manage.py create_dummy_data` and (a) pressing Enter on an empty email, or (b) typing an email for a user who never signed in / has no `User` row.

Common situations: Freshly seeded DB with no users yet; user registered but with different email casing (User.save lowercases); typo at the prompt; running before the intended owner has completed first sign-in.

Related errors


AI-assisted analysis of makeplane/plane@1c8a60f858 (2026-08-12). Data as JSON: /api/errors/761a3745a8fce0e8. Report an issue: GitHub.