{"record":{"id":"39b0fa2db842207e","repo":"makeplane/plane","slug":"invalid-issue-identifier-format","errorCode":null,"errorMessage":"Invalid issue identifier format","messagePattern":"Invalid issue identifier format","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"apps/api/plane/db/management/commands/fix_duplicate_sequences.py","lineNumber":44,"sourceCode":"\n    def handle(self, *args, **options):\n        workspace_slug = input(\"Workspace slug: \")\n\n        if not workspace_slug:\n            raise CommandError(\"Workspace slug is required\")\n\n        issue_identifier = options.get(\"issue_identifier\", False)\n\n        # Validate issue_identifier\n        if not issue_identifier:\n            raise CommandError(\"Issue identifier is required\")\n\n        # Validate issue identifier\n        try:\n            identifier = issue_identifier.split(\"-\")\n\n            if len(identifier) != 2:\n                raise ValueError(\"Invalid issue identifier format\")\n\n            project_identifier = identifier[0]\n            issue_sequence = self.strict_str_to_int(identifier[1])\n\n            # Fetch the project\n            project = Project.objects.get(identifier__iexact=project_identifier, workspace__slug=workspace_slug)\n\n            # Get the issues\n            issues = Issue.objects.filter(project=project, sequence_id=issue_sequence)\n            # Check if there are duplicate issues\n            if not issues.count() > 1:\n                raise CommandError(\"No duplicate issues found with the given identifier\")\n\n            self.stdout.write(self.style.SUCCESS(f\"{issues.count()} issues found with identifier {issue_identifier}\"))\n            with transaction.atomic():\n                # This ensures only one transaction per project can execute this code at a time\n                lock_key = convert_uuid_to_integer(project.id)\n","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/db/management/commands/fix_duplicate_sequences.py#L26-L62","documentation":"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.","triggerScenarios":"Passing `PLANE42` (no dash), `PLANE-42-1` (two dashes), or any identifier that does not match exactly `<nonempty>-<nonempty>`.","commonSituations":"Including the workspace prefix; trailing dash; project identifier that legitimately contains a hyphen; copy-paste of a URL fragment.","solutions":["Use the exact form `<PROJECT_IDENTIFIER>-<SEQUENCE>`, e.g. `PLANE-42`.","Confirm the project identifier has no embedded dash (this parser cannot handle that).","Trim stray characters or extra segments before invoking."],"exampleFix":"# before\npython manage.py fix_duplicate_sequences 'PLANE-42-1'\n# after\npython manage.py fix_duplicate_sequences 'PLANE-42'","handlingStrategy":"validation","validationCode":"parts = issue_identifier.split('-')\nassert len(parts) == 2, 'expected exactly one dash: PROJECT-N'","typeGuard":"def is_single_dash_identifier(value: str) -> bool:\n    return isinstance(value, str) and value.count('-') == 1 and all(parts for parts in value.split('-'))","tryCatchPattern":"try:\n    call_command('fix_duplicate_sequences', raw)\nexcept CommandError as e:\n    if 'Invalid issue identifier format' in str(e):\n        # identifier had != 2 dash-separated parts\n        ...","preventionTips":["Use exactly one dash: PROJECT-N.","Project identifiers must not contain a dash (the parser cannot handle it).","Trim extra segments/URL fragments before invoking."],"tags":["django","management-command","validation","parsing","plane"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}