makeplane/plane · error · ValueError

Invalid issue identifier format

Error message

Invalid issue identifier format

What it means

Raised as a `ValueError` by `fix_duplicate_sequences` when `issue_identifier.split('-')` does not yield exactly 2 parts (lines 41-44). This means zero dashes (`PLANE42`), more than one dash (`PLANE-42-EXTRA`), or an empty string. Thrown inside the try block, so it is re-wrapped by `except Exception as e: raise CommandError(str(e))` (lines 94-95) — message text preserved. NOTE: because split is on '-', project identifiers containing a dash would also fail here.

Source

Thrown at apps/api/plane/db/management/commands/fix_duplicate_sequences.py:44

    def handle(self, *args, **options):
        workspace_slug = input("Workspace slug: ")

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

        issue_identifier = options.get("issue_identifier", False)

        # Validate issue_identifier
        if not issue_identifier:
            raise CommandError("Issue identifier is required")

        # Validate issue identifier
        try:
            identifier = issue_identifier.split("-")

            if len(identifier) != 2:
                raise ValueError("Invalid issue identifier format")

            project_identifier = identifier[0]
            issue_sequence = self.strict_str_to_int(identifier[1])

            # Fetch the project
            project = Project.objects.get(identifier__iexact=project_identifier, workspace__slug=workspace_slug)

            # Get the issues
            issues = Issue.objects.filter(project=project, sequence_id=issue_sequence)
            # Check if there are duplicate issues
            if not issues.count() > 1:
                raise CommandError("No duplicate issues found with the given identifier")

            self.stdout.write(self.style.SUCCESS(f"{issues.count()} issues found with identifier {issue_identifier}"))
            with transaction.atomic():
                # This ensures only one transaction per project can execute this code at a time
                lock_key = convert_uuid_to_integer(project.id)

View on GitHub (pinned to 1c8a60f858)

Solutions

  1. Use the exact form `<PROJECT_IDENTIFIER>-<SEQUENCE>`, e.g. `PLANE-42`.
  2. Confirm the project identifier has no embedded dash (this parser cannot handle that).
  3. Trim stray characters or extra segments before invoking.

Example fix

# before
python manage.py fix_duplicate_sequences 'PLANE-42-1'
# after
python manage.py fix_duplicate_sequences 'PLANE-42'
Defensive patterns

Strategy: validation

Validate before calling

parts = issue_identifier.split('-')
assert len(parts) == 2, 'expected exactly one dash: PROJECT-N'

Type guard

def is_single_dash_identifier(value: str) -> bool:
    return isinstance(value, str) and value.count('-') == 1 and all(parts for parts in value.split('-'))

Try / catch

try:
    call_command('fix_duplicate_sequences', raw)
except CommandError as e:
    if 'Invalid issue identifier format' in str(e):
        # identifier had != 2 dash-separated parts
        ...

Prevention

When it happens

Trigger: Passing `PLANE42` (no dash), `PLANE-42-1` (two dashes), or any identifier that does not match exactly `<nonempty>-<nonempty>`.

Common situations: Including the workspace prefix; trailing dash; project identifier that legitimately contains a hyphen; copy-paste of a URL fragment.

Related errors


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