apache/superset · error · ExtensionNameError

Publisher must start with a letter and contain only lowercas

Error message

Publisher must start with a letter and contain only lowercase letters, numbers, and hyphens (e.g., 'my-org')

What it means

Thrown by the superset-extensions CLI when the publisher namespace passed to a scaffolding/validation command fails PUBLISHER_REGEX. The publisher is the top-level namespace of an extension (e.g. 'my-org') and must be a DNS-like slug: it must start with a lowercase letter and contain only lowercase letters, digits, and hyphens. It is raised before any files are generated so that invalid names never reach the package/module-federation layer.

Source

Thrown at superset-extensions-cli/src/superset_extensions_cli/utils.py:233

    if name.lower() in NPM_RESERVED:
        raise ExtensionNameError(f"'{name}' is a reserved npm package name")


def validate_publisher(publisher: str) -> None:
    """
    Validate publisher namespace format.

    Args:
        publisher: Publisher namespace (e.g., 'my-org')

    Raises:
        ExtensionNameError: If publisher is invalid
    """
    if not publisher:
        raise ExtensionNameError("Publisher cannot be empty")

    if not PUBLISHER_REGEX.match(publisher):
        raise ExtensionNameError(
            "Publisher must start with a letter and contain only lowercase letters, numbers, and hyphens (e.g., 'my-org')"
        )


def validate_technical_name(name: str) -> None:
    """
    Validate technical extension name format.

    Args:
        name: Technical extension name (e.g., 'dashboard-widgets')

    Raises:
        ExtensionNameError: If name is invalid
    """
    if not name:
        raise ExtensionNameError("Extension name cannot be empty")

    if not TECHNICAL_NAME_REGEX.match(name):

View on GitHub (pinned to f4587218dd)

Solutions

  1. Change the publisher to an all-lowercase slug starting with a letter: digits, hyphens allowed after the first character (e.g. 'my-org', 'acme1').
  2. If deriving from an org/domain automatically, normalize first: lowercase, strip whitespace, replace dots/underscores with hyphens, trim leading/trailing hyphens and strip any leading digits.
  3. If you intended a different namespace scheme, re-run the CLI command with the corrected publisher argument rather than editing generated files afterwards.

Example fix

# before
superset-extensions create My_Org dashboard-widgets
# ExtensionNameError: Publisher must start with a letter ...

# after
superset-extensions create my-org dashboard-widgets
Defensive patterns

Strategy: validation

Validate before calling

import re
PUBLISHER_RE = re.compile(r"^[a-z][a-z0-9-]*$")

def publisher_is_valid(publisher: str) -> bool:
    return bool(publisher) and bool(PUBLISHER_RE.match(publisher))

# before invoking the CLI:
assert publisher_is_valid(publisher), f"bad publisher: {publisher!r}"

Prevention

When it happens

Trigger: Running a CLI command that takes a publisher argument (e.g. `superset-extensions create <publisher> <name>`) with values like 'My-Org' (uppercase), 'my_org' (underscore), 'my-org-' as input beginning with a hyphen, '123org' (starts with a digit), an empty string, or a name with spaces. Also triggered by programmatic calls to validate_publisher() with the same bad inputs.

Common situations: Teams scaffolding extensions from an existing GitHub org name that contains dots or underscores (e.g. 'my_org.io'), copy-pasting publisher names with trailing whitespace or capitalization from internal tooling, or scripts that interpolate publisher from environment variables that were never normalized.

Related errors


AI-assisted analysis of apache/superset@f4587218dd (2026-08-14). Data as JSON: /api/errors/1ea025afcb0e5331. Report an issue: GitHub.