affaan-m/ECC · error · FileExistsError

asset output already exists; choose a new --name

Error message

asset output already exists; choose a new --name: {path}

What it means

mint3d.py's _check_outputs refuses to start any billable work if any candidate output artifact for the asset stem already exists - the .glb, .json, plate PNG, retopo glb, part*.glb files, or turntable directory/mp4. Existing paths (or symlinks) raise FileExistsError pointing at the first collision.

Solutions

  1. Choose a new --name for the asset
  2. Delete or move the reported existing path(s) under the stylepack's props/ and turntables/ directories if the old asset is no longer needed
  3. Inspect the reported path: if it is a stale symlink from a crashed run, remove it
  4. Automate cleanup of partial artifacts before retrying the same asset name

Example fix

// before
python mint3d.py noir --prompt "rusty lamp" --name hero_lamp  # FileExistsError
// after
rm stylepacks/noir/props/hero_lamp.glb stylepacks/noir/turntables/hero_lamp.mp4
python mint3d.py noir --prompt "rusty lamp" --name hero_lamp
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
sp = Path(root) / genre
stale = [p for p in sp.glob("props/*") ] + [p for p in sp.glob("turntables/*") if asset in p.name]
existing = [p for p in stale if p.exists() or p.is_symlink()]
if existing:
    raise SystemExit(f"clean up first: {existing}")

Try / catch

try:
    mint3d(...)
except FileExistsError as e:
    print(e); prompt operator to pick a new --name or archive old outputs

Prevention

When it happens

Trigger: Re-running mint3d for the same genre with the same asset --name after a previous successful (or partially successful) run left outputs in the stylepack's props/turntables directories.

Common situations: Re-running a failed pipeline after a partial crash left some artifacts; accidentally reusing a common name like 'prop_lamp'; turntable video from a prior render still present.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/28465af1249aa025. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/mint3d.py:84

    asset = name if name is not None else "prop_" + (words[0] if words else "lifted")
    if (not asset or asset in {".", ".."} or len(asset) > 120
            or any(not (c.isalnum() or c in "_-. ") for c in asset)
            or asset != asset.strip()):
        raise ValueError("asset name must be a simple filename stem (letters, digits, spaces, _.-)")
    return asset


def _check_outputs(sp, asset: str) -> None:
    """Reject existing artifacts for this stem before any billable work."""
    props = sp.dir / "props"
    candidates = [props / f"{asset}{suffix}" for suffix in
                  (".glb", ".json", "_plate.png", "_retopo.glb")]
    candidates += list(props.glob(f"{asset}_part*.glb"))
    candidates += [sp.dir / "turntables" / asset,
                   sp.dir / "turntables" / f"{asset}.mp4"]
    for path in candidates:
        if path.exists() or path.is_symlink():
            raise FileExistsError(f"asset output already exists; choose a new --name: {path}")


def mint3d(
    genre: str,
    root: str = "stylepacks",
    from_stills: int = 0,
    prompt: str = "",
    plate: bool = False,
    name: str | None = None,
    pbr: bool = True,
    retopo: bool = False,
    split: bool = False,
    render: bool = True,
    frames: int = 48,
    size: int = 768,
    backend: str = "auto",
    face_count: int | None = None,
) -> dict:

View on GitHub (pinned to 8321021c54)