Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control socket filename is too big when using host name of tor v3 hostname #194

Closed
tlaurion opened this issue May 12, 2024 · 7 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@tlaurion
Copy link
Contributor

tlaurion commented May 12, 2024

@tasket the socket filename is too big when using host name of tor v3 to be ssh'ed hostname. Could that be truncated to max size (100/108 chars from what I get?)

Originally posted by @tlaurion in #187 (comment)

That is

wyng-backup/src/wyng

Lines 2149 to 2152 in 08177d4

ssh_opts = ["-x", "-o", "ControlPath=~/.ssh/controlsocket-%r@%h-%p",
"-o", "ControlMaster=auto", "-o", "ControlPersist=60",
"-o", "ServerAliveInterval=30", "-o", "ConnectTimeout=30",
"-o", "Compression=no"]

@tasket tasket added the bug Something isn't working label May 13, 2024
@tasket tasket added this to the v0.8 milestone May 13, 2024
@tasket
Copy link
Owner

tasket commented May 13, 2024

Are there any captured ssh command lines from wyng --debug?

@tasket
Copy link
Owner

tasket commented May 13, 2024

Also, have you tried replacing:

    ssh_opts    = ["-x", "-o", "ControlPath=~/.ssh/controlsocket-%r@%h-%p",
                         "-o", "ControlMaster=auto", "-o", "ControlPersist=60",
                         "-o", "ServerAliveInterval=30", "-o", "ConnectTimeout=30",
                         "-o", "Compression=no"]

with this:

    ssh_opts    = ["-x"]

@tlaurion
Copy link
Contributor Author

Are there any captured ssh command lines from wyng --debug?

@tasket here you go:

[user@dom0 ~]
(5)$ time sudo wyng --dest qubes-ssh://wyng-InsurgoLab-tor:root@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion/mnt/Backups/nv41 --all --dedup --remap --authmin 1080 send --verbose --debug
Wyng 0.8wip release 20240511
CalledProcessError(255, [['/usr/bin/qvm-run', '--no-color-stderr', '--no-color-output', '-p', 'wyng-InsurgoLab-tor', '/usr/bin/ssh -x -o ControlPath=~/.ssh/controlsocket-%r@%h-%p -o ControlMaster=auto -o ControlPersist=60 -o ServerAliveInterval=30 -o ConnectTimeout=30 -o Compression=no root@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion "$(/usr/bin/cat /tmp/wyngrpc/tmp8h7tknkp)"'], ['/usr/bin/cat', '-v'], ['/usr/bin/tail', '--bytes=2000']])

, 'wyng-InsurgoLab-tor', '/usr/bin/mkdir -p /tmp/wyngrpc/; /usr/bin/cat >/tmp/wyngrpc/tmp8h7tknkp']]
[['/usr/bin/qvm-run', '--no-color-stderr', '--no-color-output', '-p', 'wyng-InsurgoLab-tor', '/usr/bin/ssh -x -o ControlPath=~/.ssh/controlsocket-%r@%h-%p -o ControlMaster=auto -o ControlPersist=60 -o ServerAliveInterval=30 -o ConnectTimeout=30 -o Compression=no root@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion "$(/usr/bin/cat /tmp/wyngrpc/tmp8h7tknkp)"'], ['/usr/bin/cat', '-v'], ['/usr/bin/tail', '--bytes=2000']]
unix_listener: path "/home/user/.ssh/controlsocket-root@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion-22.Db0STEBNvCJq6RQe" too long for Unix domain socket^M
[0, 255]
[['/usr/bin/cat', '-v', '/tmp/wyngfwqsrip4/dest-state.log'], ['/usr/bin/tail', '--bytes=1000'], ['/usr/bin/grep', '-vFx', ' --+--']]
[['/usr/bin/cat', '-v', '/tmp/wyngfwqsrip4/err.log'], ['/usr/bin/tail', '--bytes=1000'], ['/usr/bin/grep', '-vFx', ' --+--']]

Destination not ready to receive commands.

real	0m14.976s
user	0m0.339s
sys	0m0.181s

@tlaurion
Copy link
Contributor Author

tlaurion commented May 13, 2024

Also, have you tried replacing:

    ssh_opts    = ["-x", "-o", "ControlPath=~/.ssh/controlsocket-%r@%h-%p",
                         "-o", "ControlMaster=auto", "-o", "ControlPersist=60",
                         "-o", "ServerAliveInterval=30", "-o", "ConnectTimeout=30",
                         "-o", "Compression=no"]

with this:

    ssh_opts    = ["-x"]

@tasket : works.

Notes:

  • 30 seconds might be misguided as a general option here. 60 is good enough for syn + syn-ack + established tcp session and then keep alive would be good even on tor. I get connection timed out without changing that in code.
$ diff /sbin/wyng.orig /sbin/wyng
2159,2162c2159
<     ssh_opts    = ["-x", "-o", "ControlPath=~/.ssh/controlsocket-%r@%h-%p",
<                          "-o", "ControlMaster=auto", "-o", "ControlPersist=60",
<                          "-o", "ServerAliveInterval=30", "-o", "ConnectTimeout=30",
<                          "-o", "Compression=no"]
---
>     ssh_opts    = ["-x"]
[user@dom0 ~]
[user@dom0 ~]
(130)$ time sudo wyng --dest qubes-ssh://wyng-InsurgoLab-tor:root@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion/mnt/Backups/nv41 --all --dedup --remap --authmin 1080 list --verbose --debug
Wyng 0.8wip release 20240511
Fetched archive.ini 5558
Fetched archive.salt 424
Fetched salt.bak 424
metadata cipher = xchacha20-poly1305-msr
[var]
uuid = 92b4ee16-735e-406b-963c-672064b8bcae
updated_at = 1715574096.7731464
format_ver = 3
chunksize = 131072
compression = zstd
compr_level = 3
hashtype = hmac-sha256
ci_mode = 35
dataci_count = 4965360
mci_count = 66460

[volumes]

[...redacted...]


real	1m30.680s
user	0m0.579s
sys	0m0.372s

@tlaurion
Copy link
Contributor Author

tlaurion commented May 13, 2024

"ControlPath=~/.ssh/controlsocket-%r@%h-%p"

I think you could truncate hostname so that archive id stays valid for current users, but limit the size for create unique ID that don't break things.

tor v3 is 57 chars + .onion here which causes #187 (comment)

unix_listener: path "/home/user/.ssh/controlsocket-root@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion-22.Db0STEBNvCJq6RQe" too long for Unix domain socket^M
[0, 255]

Reported with debug trace at #194 (comment)

@tlaurion
Copy link
Contributor Author

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.onion is std length of tor v3 hostname (of course redacted)

tasket added a commit that referenced this issue May 14, 2024
@tasket
Copy link
Owner

tasket commented May 14, 2024

@tlaurion Fixed.

@tasket tasket closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants