Skip to content

snapcraft init fails when the working directory's name is longer than 40 characters #6093

@brlin-tw

Description

@brlin-tw

Check existing issues

  • I've verified that this bug isn't described by any existing issues.

Bug description

Project initialization command should still work even when the name of the working directory is longer than usual.

Steps to reproduce

mkdir this-working-directory-has-a-very-long-name
cd this-working-directory-has-a-very-long-name
snapcraft init

Current behavior

$ snapcraft init
Invalid snap name 'this-working-directory-has-a-very-long-name': snap names must be 40 characters or less.
Recommended resolution: Provide a valid name with '--name' or rename the project directory.
Full execution log: '/home/brlin/.local/state/snapcraft/log/snapcraft-20260312-211208.774528.log'

Environment

OS: Ubuntu 25.10
Snapcraft: 8.14.0.post68 (17232)
Locale: zh_TW.UTF-8

snapcraft.yaml

# N/A

Log output

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions