Description
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:
-
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 thedir
directory, unless there is a failure -
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
- Install Mutagen
- Install Coder Desktop or run
coder config-ssh
to get SSH working with your workspace - Push or use a template that sets the
dir
property oncoder_agent
to something other than the home directory - 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