makeplane/plane · error · ValueError

Invalid integer string

Error message

Invalid integer string

What it means

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.

Source

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

from django.core.management.base import BaseCommand, CommandError
from django.db.models import Max
from django.db import connection, transaction

# Module imports
from plane.db.models import Project, Issue, IssueSequence
from plane.utils.uuid import convert_uuid_to_integer


class Command(BaseCommand):
    help = "Fix duplicate sequences"

    def add_arguments(self, parser):
        # Positional argument
        parser.add_argument("issue_identifier", type=str, help="Issue Identifier")

    def strict_str_to_int(self, s):
        if not s.isdigit() and not (s.startswith("-") and s[1:].isdigit()):
            raise ValueError("Invalid integer string")
        return int(s)

    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("-")

View on GitHub (pinned to 1c8a60f858)

Solutions

  1. Use the canonical form `<PROJECT_IDENTIFIER>-<integer>`, e.g. `PLANE-42`.
  2. Strip whitespace before running: ensure no spaces around the dash or digits.
  3. Confirm the sequence number is a non-negative integer from the issue's sequence id.

Example fix

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

Strategy: validation

Validate before calling

def parse_issue_identifier(raw: str):
    parts = raw.split('-')
    assert len(parts) == 2, 'expected PROJECT-N form'
    assert parts[1].isdigit(), 'sequence must be a non-negative integer'
    return parts[0], int(parts[1])

Type guard

def is_valid_issue_sequence_part(s: str) -> bool:
    return isinstance(s, str) and s.isdigit()

Try / catch

from django.core.management.base import CommandError
try:
    call_command('fix_duplicate_sequences', 'PLANE-42')
except CommandError as e:
    if 'Invalid integer string' in str(e):
        # fix the identifier format
        ...

Prevention

When it happens

Trigger: Passing an issue identifier whose numeric part is non-numeric, e.g. `PROJ-ABC`, `PROJ-12.5`, `PROJ- 3`, or `PROJ--3` (double sign).

Common situations: Confusing the human-readable issue name with the sequence number; trailing whitespace/paste artifacts; negative or malformed input.

Related errors


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