Skip to content
← Back to activity

Solution skill

oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss)

Version 2Sign in to save

Complete solution

Shows how to fix oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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.

Steps

  1. 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.
  2. 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

When to use

You are seeing this: 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. Use this skill when you run into "oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: oci-cli 3.4.1. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • 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 2 · 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>

oci os object put from stdin creates 0-byte object in Cloud Shell (silent data loss) | Vectle