{"record":{"id":"a55c114d188700d3","repo":"makeplane/plane","slug":"issue-identifier-is-required","errorCode":null,"errorMessage":"Issue identifier is required","messagePattern":"Issue identifier is required","errorType":"exception","errorClass":"CommandError","httpStatus":null,"severity":"error","filePath":"apps/api/plane/db/management/commands/fix_duplicate_sequences.py","lineNumber":37,"sourceCode":"        # Positional argument\n        parser.add_argument(\"issue_identifier\", type=str, help=\"Issue Identifier\")\n\n    def strict_str_to_int(self, s):\n        if not s.isdigit() and not (s.startswith(\"-\") and s[1:].isdigit()):\n            raise ValueError(\"Invalid integer string\")\n        return int(s)\n\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:","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/db/management/commands/fix_duplicate_sequences.py#L19-L55","documentation":"Raised by `fix_duplicate_sequences` when `issue_identifier` is falsy (lines 33-37). Because `issue_identifier` is a required positional argument (line 20), argparse rejects a missing value first, so this branch is only reachable via programmatic invocation (`call_command`) with a falsy value. The raise is before the try block, so it is a true CommandError.","triggerScenarios":"Calling `call_command('fix_duplicate_sequences', issue_identifier=None)` or `''`; otherwise argparse blocks the invocation.","commonSituations":"Wrapper scripts/tests that pass an empty identifier programmatically.","solutions":["Invoke via CLI with the identifier: `python manage.py fix_duplicate_sequences PLANE-42`.","If calling programmatically, pass a non-empty `PROJECT-N` string.","Add a guard in your wrapper before invoking."],"exampleFix":"# before\ncall_command('fix_duplicate_sequences', issue_identifier='')\n# after\ncall_command('fix_duplicate_sequences', issue_identifier='PLANE-42')","handlingStrategy":"validation","validationCode":"import sys\nissue_identifier = ''  # from your script\nif not issue_identifier:\n    sys.exit('issue_identifier is required')","typeGuard":"def is_valid_issue_identifier(value: str) -> bool:\n    return isinstance(value, str) and value.count('-') == 1 and value.split('-')[1].isdigit()","tryCatchPattern":"try:\n    call_command('fix_duplicate_sequences', issue_identifier)\nexcept CommandError as e:\n    if 'is required' in str(e):\n        # programmatic invocation passed an empty identifier\n        ...","preventionTips":["Invoke via CLI so argparse enforces the positional.","Validate non-empty + format in wrapper scripts.","Confirm the identifier matches a real issue sequence."],"tags":["django","management-command","validation","argparse","plane"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}