Skip to content

devpod up --recreate fails with "symlink .gitignore → .dockerignore: file exists" #1972

@lwabish

Description

@lwabish

What happened?

Running devpod up <workspace> --recreate fails with a symlink conflict error:

info  symlink .gitignore /root/.devpod/agent/contexts/default/workspaces/<workspace>/content/.dockerignore: file exists
fatal Process exited with status 1
      run agent command
      github.com/loft-sh/devpod/pkg/devcontainer/sshtunnel.ExecuteCommand.func2
        .../pkg/devcontainer/sshtunnel/sshtunnel.go:129

The workspace content directory on the remote is not cleaned up before re-syncing, so stale files cause the symlink creation to fail.

What did you expect to happen instead?

--recreate should rebuild the dev container from scratch. Stale files (including .dockerignore) in the remote content/ directory should be removed before re-syncing.

How can we reproduce the bug? (as minimally and precisely as possible)

  1. Create a workspace from a local folder source: devpod up <local-path>
  2. Run devpod up <workspace> --recreate --debug
  3. The command fails immediately after the folder upload step

My devcontainer.json:

{
    "name": "..."
}

Local Environment:

  • DevPod Version: v0.6.15
  • Operating System: mac
  • ARCH of the OS: ARM64

DevPod Provider:

  • Local/remote provider: ssh

Anything else we need to know?

The fix likely belongs in up.go: prepareWorkspace or downloadLocalFolder — stale files/symlinks in content/ should be removed before extract.Extract runs.

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