GoogleCloudPlatform / GoogleCloudPlatform/gsutil

regression: rsync -r fails if destination folder has no trailing slash

Open
#966 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

## gcloud info

```
Google Cloud SDK [281.0.0]

Platform: [Windows, x86_64] ('Windows', 'DESKTOP-E9T5K4M', '10', '10.0.18362', 'AMD64', 'Intel64 Family 6 Model 158 Stepping 10, GenuineIntel')
Locale: ('en_US', 'cp65001')
Python Version: [2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)]]
Python Location: [C:\Users\danie\AppData\Local\Google\Cloud SDK\google-cloud-sdk\platform\bundledpython\python.exe]
Site Packages: [Disabled]
```

## Issue

I'm running into an issue when running the following command:
`gsutil -m rsync -r build/ gs://aci-front-releases/v1.2.0`

It fails with the following output:
`CommandException: arg (gs://aci-front-releases/v1.2.0) does not name a directory, bucket, or bucket subdir.`

Adding a trailing slash to the destination works:
`gsutil -m rsync -r build/ gs://aci-front-releases/v1.2.0/`

I think this is a regression because I had a cloud builder configuration that was running this exact command and had always succeeded until recently.

Here is my cloudbuild configuration file:

```
steps:
- name: 'node:12'
entrypoint: npm
args: ['ci']
- name: 'node:12'
env:
- NODE_ENV=production
entrypoint: npm
args: ['run', 'build']
- name: 'gcr.io/cloud-builders/gsutil'
args:
[
'-m',
'rsync',
'-r',
'-d',
'build/',
'gs://aci-front-releases/$BRANCH_NAME',
]
```

Contributor guide

Open the contributing guide

Research direction

Start with the gsutil rsync command shown in the issue and reproduce it using a local build/ directory and the Google Cloud Storage destination without a trailing slash. Compare it with the working trailing-slash form; done means the original command succeeds without requiring that slash.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.