You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
salt-ssh scp transfer hangs on Photon OS 4 when destination path contains a space #70204
PR #70085 quotes the local/remote paths passed to scp in salt.client.ssh.shell.Shell.send() via shlex.quote() to fix salt-ssh breaking when a path contains a space (#61338).
CI shows this is incomplete: tests/pytests/integration/ssh/test_deploy.py::test_thin_dir_with_space (the regression test #70085 itself added) hangs and times out (>90s), reproducibly, on Photon OS 4 (Arm64 and non-Arm64), on both its initial attempt and its automatic rerun, while the identical test passes cleanly on Photon OS 5 and every other distro in the matrix.
Root cause
OpenSSH switched scp's default transfer protocol from the legacy scp/rcp-style protocol to the modern SFTP-based protocol starting in OpenSSH 9.0 (April 2022). Under the legacy protocol, the local scp binary builds and sends its own remote-shell command (e.g. scp -t '<path>') over the ssh channel to a receiver process on the target. Local shlex.quote() escaping -- correct for the local invoking shell -- does not reliably survive scp's own internal re-quoting of that remote command when the destination path contains a space, and the target simply hangs waiting for a well-formed command rather than erroring out.
Photon OS 4 (2020, EOL-track) ships an OpenSSH predating the SFTP-by-default switch; Photon OS 5 (2022+) ships a newer one -- hence the split between the two.
Fix
Fixed in Shell.send(): scp to a fixed, definitely-space-free staging path (/tmp/.salt-ssh-<uuid>.tmp), then rename it into the real (possibly space-containing) destination over a plain sshmv command, where shlex.quote() is already known-correct (interpreted by a real remote shell, not re-escaped by scp's own transport).
Closing this out -- follow-up debug tracing across multiple distros (Photon OS 4, Debian 12 Arm64, Ubuntu 22.04 Arm64) showed test_thin_dir_with_space's >90s hangs occur on a different underlying command each time (a plain scp with zero spaces involved, a raw ssh shim invocation, and once with no reproducible command at all in the trace). That's the signature of intermittent ssh/scp connection stalls under CI load, not a deterministic space-escaping bug in Shell.send().
The staging-path fix from this issue has been reverted (it solved a problem that didn't exist, and doubled ssh/scp invocations per transfer, which if anything increases exposure to this kind of flake). The test is now marked @pytest.mark.flaky(max_runs=4) instead, with a comment explaining why.
Activity
Fix salt-ssh scp hang on space-containing paths (legacy scp protocol)
twangboy commentedon Sep 2, 2026
Closing this out -- follow-up debug tracing across multiple distros (Photon OS 4, Debian 12 Arm64, Ubuntu 22.04 Arm64) showed
test_thin_dir_with_space's >90s hangs occur on a different underlying command each time (a plain scp with zero spaces involved, a raw ssh shim invocation, and once with no reproducible command at all in the trace). That's the signature of intermittent ssh/scp connection stalls under CI load, not a deterministic space-escaping bug inShell.send().The staging-path fix from this issue has been reverted (it solved a problem that didn't exist, and doubled ssh/scp invocations per transfer, which if anything increases exposure to this kind of flake). The test is now marked
@pytest.mark.flaky(max_runs=4)instead, with a comment explaining why.Fail fast when salt-ssh thin deployment transfer fails
Quote scp paths in salt-ssh to support paths with spaces (#70085)