oracle / oracle/oci-cli

OCI GET command does not download a particular version of the object

Open
#459 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

Synopsis

  1. On a versioning enabled bucket, upload two multipart objects by same name.

  2. Download a specific versioned object by explicitly using the --version-id parameter.

Expected to download the right versioned object but the latest versioned object gets downloaded irrespective of the value provided to --version-id parameter.

Logs

$ oci --version
3.1.1
$

$ oci os object list-object-versions --endpoint https://objectstorage.us-ashburn-1.oraclecloud.com -ns zs --config-file /root/.oci/aroci_1 --bucket-name oracle
{
"data": [
{
"archival-state": null,
"etag": "562dd675-e593-410d-aa30-481fab9f921f",
"is-delete-marker": false,
"md5": "KKRDS43OuPhjAwVlwXJM+A==-8",
"name": "file1",
"size": 1073741824,
"storage-tier": "Standard",
"time-created": "2021-10-09T17:54:29.884000+00:00",
"time-modified": "2021-10-09T17:55:26.501000+00:00",
"version-id": "286b736e-ed15-4b55-b8bb-c607f9b25b9a"
},
{
"archival-state": null,
"etag": "83bf663f-be73-42a7-a4a1-ed3867500a26",
"is-delete-marker": false,
"md5": "NAFah5mXDsjHmmyq7xytyw==-40",
"name": "file1",
"size": 5368709120,
"storage-tier": "Standard",
"time-created": "2021-10-09T17:54:29.884000+00:00",
"time-modified": "2021-10-09T17:54:29.884000+00:00",
"version-id": "8326637b-5bd3-4e11-af0a-031bd81d4b96"
}
],
"prefixes": []
}

$ oci os object get --endpoint https://objectstorage.us-ashburn-1.oraclecloud.com -ns zs --config-file /root/.oci/aroci_1 --bucket-name oracle --name file1 --file output --version-id 8326637b-5bd3-4e11-af0a-031bd81d4b96
Downloading object [###########################] 100%

$ ls -l output
-rwxr-xr-x 1 root root 1073741824 Oct 9 11:56 output ===> expected to download the object of size 5G, instead latest versioned object of size 1G is downloaded.
$

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue through the oci os object get entry point with a versioned object and the --version-id parameter, using the commands and object sizes shown in the report. Trace how that parameter is handled during the download and verify that the requested version, rather than the latest version, is saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.