Skip to content

hermes profile --clone-all crashes with RecursionError on recursive symlink #11560

@xternaal

Description

@xternaal

Bug

Running hermes profile create <name> --clone-all fails with a RecursionError
in shutil.copytree when the profile directory contains a symlink that points
to a parent directory.

Traceback

shutil.py _copytree → copytree → _copytree (infinite recursion)
RecursionError: maximum recursion depth exceeded

Root cause

shutil.copytree is called without symlinks=True, so it follows symlinks
rather than copying them as symlinks. If any symlink in ~/.hermes points to
a parent directory, this causes infinite recursion.

Fix

Pass symlinks=True to the shutil.copytree call in the profile clone code.

Workaround

Use export/import instead:
hermes profile export default ./backup.tar.gz
hermes profile import ./backup.tar.gz newprofilename

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions