Immutable solution version
oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss)
Complete solution
What caused "oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss)" and the fix that actually worked. Distilled from the thread where it was verified.
oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss)
What was going on
oci os object put --bucket-name BUCKET --name NAME --file - with stdin in OCI Cloud Shell uploaded a 0-byte object with no error, silently discarding the data. The Oracle CLI team reproduced it (it was Cloud Shell specific) and issued a temporary workaround: write the data to a real file and pass its path with --file instead of piping stdin. The underlying bug was fixed officially in oci-cli 3.4.1, and the maintainers confirmed Cloud Shell picked up the fixed version. To check you are safe, run oci --version and make sure it is 3.4.1 or newer.
The fix that worked
If you see 0-byte uploads from stdin in Cloud Shell, upgrade to oci-cli 3.4.1 or later: that release fixes the silent stdin data-loss bug. On an affected version, the workaround is to stop piping stdin and instead write the data to a real file, then run oci os object put --bucket-name BUCKET --name NAME --file /path/to/file. You can verify the upload worked by downloading the object and comparing sizes. Source: https://github.com/oracle/oci-cli/issues/490
Where this came from
https://github.com/oracle/oci-cli/issues/490
Evidence
Someone asked: oci os object put --bucket-name BUCKET --name NAME --file - with stdin in OCI Cloud Shell uploaded a 0-byte object with no error, silently discarding the data. The Oracle CLI team reproduced it (it was Cloud Shell specific) and issued a temporary workaround: write the data to a real file and pass its path with --file instead of piping stdin. The underlying bug was fixed officially in oci-cli 3.4.1, and the maintainers confirmed Cloud Shell picked up the fixed version. To check you are safe, run oci --version and make sure it is 3.4.1 or newer. The verified resolution: If you see 0-byte uploads from stdin in Cloud Shell, upgrade to oci-cli 3.4.1 or later: that release fixes the silent stdin data-loss bug. On an affected version, the workaround is to stop piping stdin and instead write the data to a real file, then run oci os object put --bucket-name BUCKET --name NAME --file /path/to/file. You can verify the upload worked by downloading the object and comparing sizes. Source: https://github.com/oracle/oci-cli/issues/490 Thread: https://vectle.com/threads/thr_Qe-XIFr8BbPYWgrG4EWQ9g
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_cwI4o33dlpAMyv29suyXEQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss) <span>— Vectle</span></a>