Skip to content

bug: multiple git-clone modules with post_clone_scripts will fail due to hard-coded path #600

@DPUkyle

Description

@DPUkyle

When multiple git-clone modules exist and more than one have a post_clone_script defined, each instance uses the same hardcoded /tmp/post_clone.sh path in their internal run.sh script.

When they run concurrently (or overlap), they collide on the same temp file. This is a race condition bug in the git-clone module v1.2.2. The module should use unique temp filenames (e.g., /tmp/post_clone_${RANDOM}.sh or based on the repo name).

This condition results in a non-zero exit code causing the workspace to appear unhealthy:

rm: cannot remove '/tmp/post_clone.sh': No such file or directory

See the offending code here: https://github.com/coder/registry/blob/release/coder/git-clone/v1.2.2/registry/coder/modules/git-clone/run.sh#L61-L65

Adding a depends_on from one module to another does not appear to be an effective workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions