#I am having a weird (to me) issue trying to use a private repo via ssh (dagger 0.12.7 on macOS)

1 messages ยท Page 1 of 1 (latest)

sharp bone
#

I set -x SSH_AUTH_SOCK '~/.1password/agent.sock' (which is a symlink to the actual socket)
but then dagger tells me
NotFound: NotFound: rpc error: code = NotFound desc = socket /.1password/agent.sock not found: stat /.1password/agent.sock: no such file or directory

I can "trick" it by setting it to set -x SSH_AUTH_SOCK '~//Users/emuller/./.1password/agent.sock' and things work, but that is obv not where the auth sock actually is.

I've also tried set -x SSH_AUTH_SOCK '/Users/emuller/.1password/agent.sock' ... and it errors out the same as above stat /.1password/agent.sock: no such file or directory

I've also set SSH_AUTH_SOCK directly to the socket (instead of using the symlink) with similar results - I can also trick it with the same "hack"

AFAICT dagger is replacing $HOME with / (to state it simplistically)

These also happen to work and tricks dagger to use the right path...
set -x SSH_AUTH_SOCK './Users/emuller/.1password/agent.sock'
set -x SSH_AUTH_SOCK '~/./Users/emuller/.1password/agent.sock'

My shell is fish, but I've tried under BASH as well.
My docker environment is a pretty basic colima (if it matters)
I re-created the vm just in case and some thing

Note: I am pretty sure this issue is not with 1password, but dagger's handling of the path.

#

looks like the auth sock is munged through that function

plain tartan
bronze sinew
#

This helps

sharp bone
#

FWIW: I cloned dagger (just a few minutes ago) and added a test case that looks like my situation (w/o the special characters) and it returned what was expected, so I'm stumped.

plain tartan
sharp bone
#

My problem happens with either

#

let me know if I should do / test anything else

#

btw the entire trace is .....

! failed to get configured module: failed to get module ref kind: input: moduleSource resolve: failed to resolve git src to commit: failed to load cache key: NotFound: NotFound: rpc error: code = NotFound desc = socket /.1password/agent.sock not found: stat /.1password/agent.sock: no such file or directory
  โœ˜ resolving module ref 0.4s
  ! failed to get configured module: failed to get module ref kind: input: moduleSource resolve: failed to resolve git src to commit: failed to load cache key: NotFound: NotFound: rpc error: code = NotFound desc = socket /.1password/agent.sock not found: stat /.1password/agent.sock: no such file or directory
    โœ˜ moduleSource(refString: "ssh://github.com/xxx/yyy/zzz-go"): ModuleSource! 0.3s
    ! failed to resolve git src to commit: failed to load cache key: NotFound: NotFound: rpc error: code = NotFound desc = socket /.1password/agent.sock not found: stat /.1password/agent.sock: no such file or directory
      โœ˜ cache request: git://github.com/xxx/yyy 0.0s
      ! NotFound: NotFound: rpc error: code = NotFound desc = socket /.1password/agent.sock not found: stat /.1password/agent.sock: no such file or directory

Error: failed to get configured module: failed to get module ref kind: input: moduleSource resolve: failed to resolve git src to commit: failed to load cache key: NotFound: NotFound: rpc error: code = NotFound desc = socket /.1password/agent.sock not found: stat /.1password/agent.sock: no such file or directory
bronze sinew
sharp bone
#

The test I added that pases is

        {
            name:     "ssh auth sock 1",
            cwdPath:  "/Users/user/project",
            modPath:  "/Users/user/.ssh/auth.sock",
            expected: "../.ssh/auth.sock",
        },
#

since I also tried with the full path and get the same error (see first message)

bronze sinew
#

and agent.sock is a symlink, mmmh, weird indeed. Absolute paths do work for me, but haven't tried with symlinks, testing it out

sharp bone
#

@bronze sinew the SAME thing happens w/o the symlink

#

from above I've also set SSH_AUTH_SOCK directly to the socket (instead of using the symlink) with similar results - I can also trick it with the same "hack"

#

and my "trick" works with symlink or socket directly

bronze sinew
bronze sinew
sharp bone
#

if it matters on colima the home directory is a mount

#
mount0 on /Users/emuller type virtiofs (rw,relatime)
#

and that is normal for colima

bronze sinew
#

This is indeed due to the LexicalRelativePath function + the fact that buildkit's mounting function expects a path prepended with ./ such as ./socket and not socket.

Fix incoming ๐Ÿ™ Your "hack" led to some shanigan in which the path of the socket is weird but correctly interpreted as it prepends ../ to the path and the ./ makes the current dir included

#

No issue regarding the symlink afaik

bronze sinew
#

and you trick made it: ../emuller/.1password/agent.sock

plain tartan
#

Is it because of the .1password in the path?

bronze sinew
#

Most people have their SSH_AUTH_SOCK generated by the ssh-agent in a tmpdir, which is why most people don't face this issue, because this relativepath func would usually have ../../..

plain tartan
bronze sinew
#

I'll add an integration test as part of the fix

bronze sinew
#

(Erik and Justin requested me to have all moduleSource paths as relative for consistency. And we made this one too, but it is weird that a path not starting with / nor . is not interpreted yes)

sharp bone
#

Awesome! Thx!
When is the next release planned?

plain tartan
#

now since this is an actual bug, it's likel that we release another minor next week.