Skip to content

Conversation

michae2
Copy link
Collaborator

@michae2 michae2 commented Sep 5, 2025

In #125154 we added a put command to send files to a gceworker via scp. The scp command allows for multiple source files, but it was using a scalar bash variable to hold the sourcepaths. This variable was not handling paths with spaces properly. For example:

% touch my\ file.txt
% scripts/gceworker.sh put 'my file.txt'
/usr/bin/scp: stat local "my": No such file or directory
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [255].

The fix is to use a bash array to hold the source paths, and to add quoting. With this fix it works correctly:

% touch my\ file.txt
% scripts/gceworker.sh put 'my file.txt'
my file.txt      100%    0     0.0KB/s   00:00

Epic: None
Release note: None

In cockroachdb#125154 we added a put command to send files to a gceworker via
scp. The scp command allows for multiple source files, but it was using
a scalar bash variable to hold the sourcepaths. This variable was not
handling paths with spaces properly. For example:

```
% touch my\ file.txt
% scripts/gceworker.sh put 'my file.txt'
/usr/bin/scp: stat local "my": No such file or directory
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [255].
```

The fix is to use a bash array to hold the source paths, and to add
quoting. With this fix it works correctly:

```
% touch my\ file.txt
% scripts/gceworker.sh put 'my file.txt'
my file.txt      100%    0     0.0KB/s   00:00
```

Epic: None
Release note: None
@michae2 michae2 requested a review from rickystewart September 5, 2025 23:59
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@michae2
Copy link
Collaborator Author

michae2 commented Sep 6, 2025

(This was found from an LLM analysis of old PRs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants