Skip to content

Update commands with implicit confirmation prompt hang silently in non-TTY environments #1111

Description

@surapuramakhil

Description

Several update commands (e.g., oci bv backup update) prompt for confirmation interactively. When run in a non-TTY environment (CI pipeline, SSH session, script), the prompt is invisible and the command hangs indefinitely with no output, waiting for input that will never come.

Steps to Reproduce

Run an update command in a non-TTY context (e.g., a CI runner, SSH piped command, or script):

# Hangs silently — prompt is invisible in non-TTY:
oci bv backup update --volume-backup-id $ID --display-name "new-name"

The command blocks forever because it's waiting for a y/n confirmation that can never be provided in a non-interactive context.

Expected Behaviour

Either:

  1. Auto-detect non-TTY and skip the confirmation (like apt-get -y or docker rm), OR
  2. Error out immediately with a clear message: "This command requires confirmation. Use --force to skip the prompt.", OR
  3. Document --force prominently in the basic usage line, not buried deep in --help output.

Actual Behaviour

  • The command hangs silently with no output.
  • The --force flag exists but is only discoverable via oci bv backup update --help deep in the option list.
  • Users unfamiliar with OCI CLI patterns may spend significant time debugging what appears to be a network hang or API timeout.

Affected Commands

This pattern affects multiple update commands across the CLI that use click.confirm() with a force flag. The oci bv backup update command is one example; others likely exist.

Impact

In CI/CD pipelines, this causes task timeouts that are difficult to diagnose because there's no error output — just silence.

Suggested Fix

  1. Add non-TTY detection (e.g., sys.stdin.isatty()) and either auto-accept or error out with a message directing users to --force.
  2. Alternatively, make --force the documented default for update commands in non-interactive contexts (similar to how apt-get requires -y for non-interactive use).
  3. At minimum, ensure the --force flag is mentioned in the basic usage line, not just in the detailed help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions