Giter VIP home page Giter VIP logo

Comments (31)

ddrown avatar ddrown commented on May 29, 2024 2

I think I'm seeing the same issue:
image

What's strange is it runs outside of socat:

$ curl https://github.com/masahide/OmniSSHAgent/releases/latest/download/omni-socat.zip -sLo omni-socat.zip
$ unzip omni-socat.zip
Archive:  omni-socat.zip
  inflating: omni-socat.exe
$ ls -l
total 5612
-rwxrwxrwx 1 ddrown ddrown 3675648 May 27 07:16 omni-socat.exe
-rw-rw-r-- 1 ddrown ddrown 2067854 May 31 10:17 omni-socat.zip
$ sha1sum omni-socat.exe
d34e4797eaa493b301356d361a8d5473913b41fb  omni-socat.exe
$ ./omni-socat.exe -h
Usage of omni-socat.exe:
  -debug
        Output debug log
$ socat UNIX-LISTEN:/home/ddrown/.ssh/agent.sock,fork EXEC:"./omni-socat.exe -debug" &
$ ssh-add -l
error fetching identities: communication with agent failed

from omnisshagent.

ddrown avatar ddrown commented on May 29, 2024 2

It was working on Friday (May 27) but broke between then and today (May 31).

I tried:

  • building omni-socat from source
  • switching to npiperelay
  • switching omni-socat.exe to windows 8 compatability mode

None of those worked

Rebooted my laptop, and it's back to working again 🤷

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

When does this occur?

There isn't a specific time when this occurs

Does it always result in an error?

Yes, the error of the OP

Please ps the socat process startup in WSL.

This after updating to 0.3.1:

~ ❯ ps axuw|grep socat  12s 15:44:40
maicol07 3558 0.0 0.0 10280 2952 ? Ss 15:10 0:00 socat UNIX-LISTEN:/home/maicol07/.ssh/agent.sock,fork E
XEC:/home/maicol07/omni-socat/omni-socat.exe -debug
maicol07 4837 0.0 0.0 6476 2272 pts/0 S+ 15:44 0:00 grep --color=auto socat

After update the result is:

~ ❯ ssh-add -l                                                                                              15:44:42
error fetching identities: communication with agent failed
~ ❯ cat /mnt/c/Users/Maicol/omni-socat.log                                                                  15:46:17
cat: /mnt/c/Users/Maicol/omni-socat.log: No such file or directory

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

First console:

~ ❯ ssh-add -l                                                                                              09:20:12
error fetching identities: communication with agent failed
~ ❯ echo $SSH_AUTH_SOCK                                                                                     09:20:23
/home/maicol07/.ssh/agent.sock
~ ❯ ~/omni-socat/omni-socat.exe -h                                                                          09:20:29
fish: The file '/home/maicol07/omni-socat/omni-socat.exe' is not executable by this user
~ ❯ killall socat                                                                                     ✘ 126 09:20:42
~ ❯ socat UNIX-LISTEN:$HOME/.ssh/agent.sock,fork EXEC:"$HOME/omni-socat/omni-socat.exe -debug"              09:21:07
2022/05/28 09:21:12 socat[855] E "/home/maicol07/.ssh/agent.sock" exists

Second console:

~ ❯ ls -la $SSH_AUTH_SOCK                                                                                   09:21:25
srwxr-xr-x 1 maicol07 maicol07 0 mag 28 09:21 /home/maicol07/.ssh/agent.sock=
~ ❯ ssh-add -l                                                                                              09:21:28
error fetching identities: communication with agent failed

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1
~ ❯ ls -la ~/omni-socat/omni-socat.exe                                                                      11:46:55
-rw-r--r-- 1 maicol07 maicol07 3675648 mag 27 21:16 /home/maicol07/omni-socat/omni-socat.exe

Let me try to chmod it

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

Chmodded. Now I get:

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1
~ ❯ ssh-add -l                                                                                              11:49:18
error fetching identities: communication with agent failed
~ ❯ cd omni-socat/                                                                                  1m 51s 11:51:13
~/omni-socat ❯ curl https://github.com/masahide/OmniSSHAgent/releases/latest/download/omni-socat.zip -sLo omni-socat
.zip
~/omni-socat ❯ unzip omni-socat.zip                                                                         12:26:02
Archive:  omni-socat.zip
replace omni-socat.exe? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: omni-socat.exe
~/omni-socat ❯ sha1sum omni-socat.exe                                                                   4s 12:26:17
d34e4797eaa493b301356d361a8d5473913b41fb  omni-socat.exe
~/omni-socat ❯ ls -la omni-socat.exe                                                                        12:26:30
-rwxrwxrwx 1 maicol07 maicol07 3675648 mag 27 14:16 omni-socat.exe*
~/omni-socat ❯ ./omni-socat.exe -h                                                                          12:26:44
Usage of omni-socat.exe:
  -debug
        Output debug log
~/omni-socat ❯ uname -a                                                                                     12:26:52
Linux MAICOL-ROG 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
~/omni-socat ❯ ssh-add -l                                                                                   12:27:02
error fetching identities: communication with agent failed
~/omni-socat ❯ killall socat                                                                                12:27:28
~/omni-socat ❯ socat UNIX-LISTEN:$HOME/.ssh/agent.sock,fork EXEC:"$HOME/omni-socat/omni-socat.exe -debug"   12:27:37
2022/05/28 12:27:44 socat[3705] E "/home/maicol07/.ssh/agent.sock" exists

~/omni-socat ❯ ssh-add -l                                                                                   12:28:00
3072 SHA256:xInBcA48YT6jmmOEWQrXtC+xw+c6V2V2cVgAWT6K9hg id_rsa (RSA)
256 SHA256:ZgvmgA5CNIpEbTZWepclAdXC9fVBFsB1kvmM14Egjm8 id_ed25519 (ED25519)

I don't know redownloading helped, I'll let you know in some days if I get the error again.

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

@masahide got this again and nothing has been logged

~ ❯ ssh-add -l                                                                                              23:45:45
error fetching identities: communication with agent failed
~ ❯ cat /mnt/c/Users/Maicol/omni-socat.log                                                                  23:45:47
2022/05/28 12:27:59 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:27:59 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:27:59 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 12:28:03 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:28:03 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:28:03 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 12:29:14 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:29:14 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:29:14 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 12:29:44 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:29:44 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:29:44 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 20:53:24 npipe2stdin.go:44: Started omni-socat
2022/05/28 20:53:24 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 20:53:28 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/29 01:45:16 npipe2stdin.go:44: Started omni-socat
2022/05/29 01:45:16 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/29 01:45:16 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/29 01:45:19 npipe2stdin.go:44: Started omni-socat
2022/05/29 01:45:19 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/29 01:45:19 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/29 16:28:28 npipe2stdin.go:44: Started omni-socat
2022/05/29 16:28:28 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/29 16:28:33 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/31 12:45:21 npipe2stdin.go:44: Started omni-socat
2022/05/31 12:45:21 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/31 12:45:27 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/31 15:36:39 npipe2stdin.go:44: Started omni-socat
2022/05/31 15:36:39 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/31 15:36:39 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 01:27:35 npipe2stdin.go:44: Started omni-socat
2022/06/01 01:27:35 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 01:27:40 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 13:25:59 npipe2stdin.go:44: Started omni-socat
2022/06/01 13:25:59 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 13:26:03 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 13:45:46 npipe2stdin.go:44: Started omni-socat
2022/06/01 13:45:46 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 13:45:49 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 14:42:04 npipe2stdin.go:44: Started omni-socat
2022/06/01 14:42:04 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 14:42:10 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 14:56:12 npipe2stdin.go:44: Started omni-socat
2022/06/01 14:56:12 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 14:56:12 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:10:22 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:10:22 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:10:22 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:20:15 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:20:15 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:20:15 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:27:34 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:27:34 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:27:34 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:40:48 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:40:48 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:40:48 npipe2stdin.go:58: Disconnected. [<nil>]
~ ❯ ps axuw|grep socat                                                                                      23:45:51
maicol07   484  0.0  0.0  10276  3008 ?        Ss   15:54   0:00 socat UNIX-LISTEN:/home/maicol07/.ssh/agent.sock,fork EXEC:/home/maicol07/omni-socat/omni-socat.exe -debug
maicol07 11729  0.0  0.0   6476  2248 pts/2    S+   23:46   0:00 grep --color=auto socat

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

Rebooted and works... next time!

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

@masahide new case:

  ~ ❯ ssh-add -l                                                                                              17:41:18
error fetching identities: communication with agent failed
  ~ ❯ cat /mnt/c/Users/Maicol/omni-socat.log                                                                  22:10:52
2022/05/28 12:27:59 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:27:59 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:27:59 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 12:28:03 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:28:03 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:28:03 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 12:29:14 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:29:14 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:29:14 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 12:29:44 npipe2stdin.go:44: Started omni-socat
2022/05/28 12:29:44 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 12:29:44 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/28 20:53:24 npipe2stdin.go:44: Started omni-socat
2022/05/28 20:53:24 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/28 20:53:28 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/29 01:45:16 npipe2stdin.go:44: Started omni-socat
2022/05/29 01:45:16 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/29 01:45:16 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/29 01:45:19 npipe2stdin.go:44: Started omni-socat
2022/05/29 01:45:19 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/29 01:45:19 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/29 16:28:28 npipe2stdin.go:44: Started omni-socat
2022/05/29 16:28:28 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/29 16:28:33 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/31 12:45:21 npipe2stdin.go:44: Started omni-socat
2022/05/31 12:45:21 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/31 12:45:27 npipe2stdin.go:58: Disconnected. [<nil>]
2022/05/31 15:36:39 npipe2stdin.go:44: Started omni-socat
2022/05/31 15:36:39 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/31 15:36:39 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 01:27:35 npipe2stdin.go:44: Started omni-socat
2022/06/01 01:27:35 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 01:27:40 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 13:25:59 npipe2stdin.go:44: Started omni-socat
2022/06/01 13:25:59 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 13:26:03 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 13:45:46 npipe2stdin.go:44: Started omni-socat
2022/06/01 13:45:46 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 13:45:49 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 14:42:04 npipe2stdin.go:44: Started omni-socat
2022/06/01 14:42:04 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 14:42:10 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 14:56:12 npipe2stdin.go:44: Started omni-socat
2022/06/01 14:56:12 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 14:56:12 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:10:22 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:10:22 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:10:22 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:20:15 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:20:15 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:20:15 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:27:34 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:27:34 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:27:34 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/01 15:40:48 npipe2stdin.go:44: Started omni-socat
2022/06/01 15:40:48 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/01 15:40:48 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/03 09:00:37 npipe2stdin.go:44: Started omni-socat
2022/06/03 09:00:37 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/03 09:00:37 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/03 09:01:08 npipe2stdin.go:44: Started omni-socat
2022/06/03 09:01:08 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/03 09:01:08 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/03 09:01:22 npipe2stdin.go:44: Started omni-socat
2022/06/03 09:01:22 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/03 09:01:24 npipe2stdin.go:58: Disconnected. [<nil>]
2022/06/03 15:16:45 npipe2stdin.go:44: Started omni-socat
2022/06/03 15:16:45 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/03 15:16:48 npipe2stdin.go:58: Disconnected. [<nil>]
  ~ ❯ ps axuw|grep socat                                                                                      22:12:16
maicol07   497  0.0  0.0  10276  2964 ?        Ss   10:29   0:00 socat UNIX-LISTEN:/home/maicol07/.ssh/agent.sock,fork EXEC:/home/maicol07/omni-socat/omni-socat.exe -debug
maicol07  2972  0.0  0.0   6476  2328 pts/1    S+   22:12   0:00 grep --color=auto socat
  ~ ❯ /home/maicol07/omni-socat/omni-socat.exe -h                                                             22:12:36
Usage of omni-socat.exe:
  -debug
        Output debug log
  ~ ❯ sha1sum /home/maicol07/omni-socat/omni-socat.exe                                                        22:12:46
d34e4797eaa493b301356d361a8d5473913b41fb  /home/maicol07/omni-socat/omni-socat.exe
  ~ ❯ ls -la $SSH_AUTH_SOCK                                                                                   22:13:01
srwxr-xr-x 1 maicol07 maicol07 0 giu  6 10:29 /home/maicol07/.ssh/agent.sock=

from omnisshagent.

masahide avatar masahide commented on May 29, 2024 1

Thanks.
From the information you gave us, it looks like the omni-socat.exe is fine and the socat process is causing the problem.

It may be a problem with the combination of socat and WSL2.
microsoft/WSL#7560

I'll look into it some more, but if there's nothing I can do about it. I think I can solve this problem by creating something like socat myself. Please give me some time.

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

New issue today, but I don't know if it's related:

sign_and_send_pubkey: signing failed for RSA "/home/maicol07/.ssh/id_rsa" from agent: agent refused operation
sign_and_send_pubkey: signing failed for ED25519 "id_ed25519" from agent: agent refused operation
[email protected]: Permission denied (publickey)

Log:

2022/06/10 16:16:59 npipe2stdin.go:44: Started omni-socat
2022/06/10 16:16:59 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/06/10 16:16:59 npipe2stdin.go:58: Disconnected. [<nil>]

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

Useful detail (maybe): restarting 1password when this happens fixes the issue

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

Yes, I only restart 1Password. Other things and services are untouched

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

@masahide windows ssh-add never worked for me (in the PC I'm currrently using. On another PC works):

PS C:\Users\Maicol> ssh-add -L
Error connecting to agent: No such file or directory
PS C:\Users\Maicol> ssh-add.exe -L
Error connecting to agent: No such file or directory

I'm not sure whether restarting 1Password fixes the original test (I will try that when I get it), but it fixes this one: #20 (comment)

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

I've debugged a bit and it seems Omni overwrites the pipe used by Microsoft OpenSSH:

 Maicol    ~  ﮫ0ms⠀   ssh-add.exe -L                                            pwsh   100  09:24:29 
Error connecting to agent: No such file or directory
 Maicol    ~  ﮫ39ms⠀   echo $env:SSH_AUTH_SOCK                                  pwsh   100  09:24:34 
/c/Users/Maicol/OmniSSHCygwin.sock
 Maicol    ~  ﮫ18ms⠀   $env:SSH_AUTH_SOCK = '\\.\pipe\openssh-ssh-agent'        pwsh   100  09:24:40 
 Maicol    ~  ﮫ2ms⠀   echo $env:SSH_AUTH_SOCK                                   pwsh   100  09:24:44 
\\.\pipe\openssh-ssh-agent
 Maicol    ~  ﮫ30ms⠀   ssh-add.exe -l                                           pwsh   100  09:24:48 
3072 SHA256:xInBcA48YT6jmmOEWQrXtC+xw+c6V2V2cVgAWT6K9hg id_rsa (RSA)
256 SHA256:ZgvmgA5CNIpEbTZWepclAdXC9fVBFsB1kvmM14Egjm8 id_ed25519 (ED25519)

I've checked in env variables and there was a manually added SSH_AUTH_SOCK variable that was causing this issue.

I'll keep you updated if I have the previous issues

from omnisshagent.

maicol07 avatar maicol07 commented on May 29, 2024 1

No, I'm not using Cygwin and the others.

I'm only using WSL2 and rarely Powershell

from omnisshagent.

ddrown avatar ddrown commented on May 29, 2024 1

I've been using this every day since I added my comments, and it's been stable ever since then. I guess something changed, but I don't know what.

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

There may be something wrong with the omni-socat process.
When does this occur?
Does it always result in an error?

Create a debug log output mode to check the status.

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

Please ps the socat process startup in WSL.

$ ps axuw|grep socat
masahide 14784  0.0  0.0   6968  1788 ?        Ss   13:43   0:00 socat UNIX-LISTEN:/home/masahide/.ssh/agent.sock,fork EXEC:/home/masahide/omni-socat/omni-socat.exe,nofork

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

https://github.com/masahide/OmniSSHAgent/releases/tag/0.3.1

Added debug log output mode to omni-socat.
Debug mode is enabled by doing the following.
Logs are output to /mnt/c/User/<user_name>/omni-socat.log.

In WSL console, do the following

# kill socat prosess
killall socat 
# remove old omni-socat.exe
rm ~/omni-socat/omni-socat.exe

Rewrite ~/omni-socat/ubuntu-bash.setup.sh

(setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"$OMNISOCATCMD",nofork &) >/dev/null 2>&1

to

(setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"$OMNISOCATCMD -debug",nofork &) >/dev/null 2>&1

Restart WSL console.

# Try ssh-agent communication
ssh-add -l
# cat logfile
cat  /mnt/c/User/<user_name>/omni-socat.log
2022/05/27 21:24:19 npipe2stdin.go:44: Started omni-socat
2022/05/27 21:24:19 npipe2stdin.go:51: Opened pipe:[\\.\pipe\openssh-ssh-agent]
2022/05/27 21:24:19 npipe2stdin.go:58: Disconnected. [<nil>]

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

It seems that /usr/bin/socat and $HOME/omni-socat/omni-socat.exe are not communicating.

Check $SSH_AUTH_SOCK

$ echo $SSH_AUTH_SOCK
/home/masahide/.ssh/agent.sock

Check if omni-socat.exe is executable from WSL.

$ ~/omni-socat/omni-socat.exe -h
Usage of omni-socat.exe:
  -debug
        Output debug log

Manually start socat and check operation

# Kill already activated socat
killall socat
# Start socat
socat UNIX-LISTEN:$HOME/.ssh/agent.sock,fork EXEC:"$HOME/omni-socat/omni-socat.exe -debug"

Start another console to check.

masahide@DESKTOP-BI62AKS:~$ ls -la $SSH_AUTH_SOCK
srwxr-xr-x 1 masahide masahide 0 May 28 16:16 /home/masahide/.ssh/agent.sock
masahide@DESKTOP-BI62AKS:~$ ssh-add -l

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

fish: The file '/home/maicol07/omni-socat/omni-socat.exe' is not executable by this user

Perhaps you do not have execute permissions?

Check the permissions on ~/omni-socat/omni-socat.exe

> ls -la ~/omni-socat/omni-socat.exe
-rwxrwxrwx 1 masahide masahide 3675648 May 27 21:16 /home/masahide/omni-socat/omni-socat.exe*

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

I wonder why... It looks like the file is corrupt.
There may be a problem with the download script.
In the meantime, let's get the file directly with curl and check it out!

$ curl https://github.com/masahide/OmniSSHAgent/releases/latest/download/omni-socat.zip -sLo omni-socat.zip
$ unzip omni-socat.zip
Archive:  omni-socat.zip
  inflating: omni-socat.exe
$ sha1sum  omni-socat.exe
d34e4797eaa493b301356d361a8d5473913b41fb  omni-socat.exe
$ ls -la  omni-socat.exe
-rwxrwxrwx 1 masahide masahide 3675648 May 27 21:16 omni-socat.exe
$ ./omni-socat.exe -h
Usage of omni-socat.exe:
  -debug
        Output debug log
$ uname -a
Linux DESKTOP-BI62AKS 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

Thank you for your report.
It seems that there is some kind of problem with the linkage between socat and omni-socat.
However, I think the internal implementation of npiperelay is almost the same, so if npiperelay doesn't work either, there may be a problem elsewhere.
I will also investigate.(I haven't been able to reproduce the problem yet, but from there...)

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

Thank you very much.

Do you get help by running /home/maicol07/omni-socat/omni-socat.exe -h?
Also
sha1sum /home/maicol07/omni-socat/omni-socat.exe
and
ls -la $SSH_AUTH_SOCK
please.

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

Useful detail (maybe): restarting 1password when this happens fixes the issue

When 1password was restarted, did socat recover without KILL?

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

It may be a glitch on 1password's part.
If you get the error again, could you try ssh-add.exe in windows.

Could you try ssh-add -L?

C:\Windows\System32\OpenSSH\ssh-add.exe -L
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIChI8AXMLP3pp1/9++H9Ebh3BiqMGJMIhc5f4Pxtk+By id_ed25519 masahide 20220322

If you get a key list error with ssh-add.exe, it may be a bug on 1password's side.

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

If C:\WindowsSystem32\OpenSSH\ssh-add.exe outputs "Error connecting to agent: No such file or directory", the 1password ssh agent is not functioning properly.

https://developer.1password.com/docs/ssh/agent

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

Sorry, I'm sorry, I'm not sure if you are using Cygwin/MSYS2/Git for windows.
In that case, ssh-add.exe may not work because you have rewritten the environment variable "SSH_AUTH_SOCK" as you indicated.

from omnisshagent.

masahide avatar masahide commented on May 29, 2024

Thank you for the information.
However, the cause of this particular problem is still unknown and no particular measures have been taken. Maybe there is some underlying timing or combination problem. I will continue to wait for the report.

from omnisshagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.