8000 coder_agent dir property breaks Mutagen file sync from Windows · Issue #16568 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content
coder_agent dir property breaks Mutagen file sync from Windows #16568
Closed
coder/mutagen
#1
@spikecurtis

Description

@spikecurtis

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

[Mutagen] fails to install it's agent on a Coder workspace were the dir property is set. For example, our Write Coder on Coder template uses:

resource "coder_agent" "dev" {
  arch = "amd64"
  os   = "linux"
  dir  = local.repo_dir
  env = {
    OIDC_TOKEN : data.coder_workspace_owner.me.oidc_access_token,
  }
  startup_script_behavior = "blocking"

  ...
  }

Mutagen works by scp'ing an agent file, then chmod'ing the file and executing it over SSH.

scp defaults to the user's home directory as the place to start any relative paths for scp. So the agent binary gets copied to ~/mutagen-agent<some UUID>. However, because we set dir in the terraform template, the default working directory for SSH is not the home directory, and so the SSH commands cannot locate the mutagen agent file.

Essentially this issue arises because Mutagen assumes scp and ssh will default to the home directory, or at least the same directory, but we break this assumption for SSH 67B8 .

Options to fix:

  1. Change our SSH server to also default scp to the dir path by default.
    a. note that successful install moves the binary and doesn't leave the file in the dir directory, unless there is a failure

  2. Patch mutagen so that it uses explicit paths

Relevant Log Output

C:\Users\micha\mut\mut-dg> mutagen sync create --name=mut-dg . coder@mut-dg.coder:1:~/repos/coder
Setting agent executability...
Error: unable to connect to beta: unable to connect to endpoint: unable to dial agent endpoint: unable to install agent: unable to set agent executability: remote error: chmod: cannot access '.mutagen-agentf0875a2b-f7c7-401a-a799-e36178f5fa5b': No such file or directory

Expected Behavior

Mutagen copies its agent over and is able to file sync.

Steps to Reproduce

  1. Install Mutagen
  2. Install Coder Desktop or run coder config-ssh to get SSH working with your workspace
  3. Push or use a template that sets the dir property on coder_agent to something other than the home directory
  4. Create a file sync with the workspace using Mutagen

Environment

  • Host OS: Windows 11
  • Coder version: Coder v2.18.4+6125358

Additional Context

No response

Metadata

Metadata

Assignees

Labels

networkingArea: networkings2Broken use cases or features (with a workaround). Only humans may set this.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0