{"record":{"id":"7a2f51a95549c980","repo":"makeplane/plane","slug":"invalid-integer-string","errorCode":null,"errorMessage":"Invalid integer string","messagePattern":"Invalid integer string","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"apps/api/plane/db/management/commands/fix_duplicate_sequences.py","lineNumber":24,"sourceCode":"from django.core.management.base import BaseCommand, CommandError\nfrom django.db.models import Max\nfrom django.db import connection, transaction\n\n# Module imports\nfrom plane.db.models import Project, Issue, IssueSequence\nfrom plane.utils.uuid import convert_uuid_to_integer\n\n\nclass Command(BaseCommand):\n    help = \"Fix duplicate sequences\"\n\n    def add_arguments(self, parser):\n        # 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","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/db/management/commands/fix_duplicate_sequences.py#L6-L42","documentation":"Raised as a `ValueError` by `strict_str_to_int` in `fix_duplicate_sequences` (lines 22-25) when the second segment of the issue identifier is not a pure digit string (and not a valid negative integer). It is thrown inside the command's `try` block, so the outer `except Exception as e: raise CommandError(str(e))` (lines 94-95) re-raises it as a CommandError carrying the same text. The check `s.isdigit()` rejects signs, whitespace, decimals, and hex.","triggerScenarios":"Passing an issue identifier whose numeric part is non-numeric, e.g. `PROJ-ABC`, `PROJ-12.5`, `PROJ- 3`, or `PROJ--3` (double sign).","commonSituations":"Confusing the human-readable issue name with the sequence number; trailing whitespace/paste artifacts; negative or malformed input.","solutions":["Use the canonical form `<PROJECT_IDENTIFIER>-<integer>`, e.g. `PLANE-42`.","Strip whitespace before running: ensure no spaces around the dash or digits.","Confirm the sequence number is a non-negative integer from the issue's sequence id."],"exampleFix":"# before\npython manage.py fix_duplicate_sequences 'PLANE-ABC'\n# after\npython manage.py fix_duplicate_sequences 'PLANE-42'","handlingStrategy":"validation","validationCode":"def parse_issue_identifier(raw: str):\n    parts = raw.split('-')\n    assert len(parts) == 2, 'expected PROJECT-N form'\n    assert parts[1].isdigit(), 'sequence must be a non-negative integer'\n    return parts[0], int(parts[1])","typeGuard":"def is_valid_issue_sequence_part(s: str) -> bool:\n    return isinstance(s, str) and s.isdigit()","tryCatchPattern":"from django.core.management.base import CommandError\ntry:\n    call_command('fix_duplicate_sequences', 'PLANE-42')\nexcept CommandError as e:\n    if 'Invalid integer string' in str(e):\n        # fix the identifier format\n        ...","preventionTips":["Use the canonical PROJECT-N form.","Ensure the sequence part is pure digits (no decimals, signs, spaces).","Validate the format in a wrapper 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-12T23:17:12.415Z"}