Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: Failure to start when when output is piped #12128

Open
@JonathanWoollett-Light

Description

@JonathanWoollett-Light

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Running a minimal viable example by starting a process with localstack start when stdout and stderr are piped it fails to start. When stdout and stderr are inherited from the parent process it succeeds in starting.

The error:

PS C:\Users\jonat\Documents\testing> cargo run
   Compiling testing v0.1.0 (C:\Users\jonat\Documents\testing)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
     Running `target\debug\testing.exe`
❌ Error: timeout

Expected Behavior

PS C:\Users\jonat\Documents\testing> cargo run
   Compiling testing v0.1.0 (C:\Users\jonat\Documents\testing)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
     Running `target\debug\testing.exe`

     __                     _______ __             __
    / /   ____  _________ _/ / ___// /_____ ______/ /__
   / /   / __ \/ ___/ __ `/ /\__ \/ __/ __ `/ ___/ //_/
  / /___/ /_/ / /__/ /_/ / /___/ / /_/ /_/ / /__/ ,<
 /_____/\____/\___/\__,_/_//____/\__/\__,_/\___/_/|_|

 💻 LocalStack CLI 3.8.1
 👤 Profile: default

[09:32:23] starting LocalStack in Docker mode 🐳                          localstack.py:503
────────────────────── LocalStack Runtime Log (press CTRL-C to quit) ──────────────────────

LocalStack version: 3.8.2.dev120
LocalStack build date: 2024-11-15
LocalStack build git hash: 75436efc5

Ready.

How are you starting LocalStack?

With the localstack script

Steps To Reproduce

The minimal viable example (the project zip):

use std::process::Stdio;
use std::process::Command;

fn main() {
    let _child = Command::new("localstack")
        .arg("start")
        .stdout(Stdio::inherit()) // Change to `Stdio::piped()` to error.
        .stderr(Stdio::inherit()) // Change to `Stdio::piped()` to error.
        .spawn()
        .unwrap();
    let _wait = Command::new("localstack")
        .args(["wait","-t",&10u32.to_string()])
        .stdout(Stdio::inherit())
        .stderr(Stdio::inherit())
        .output()
        .unwrap();
}

Run cargo run (which requires Rust to be installed).

Environment

- OS: Windows
- LocalStack:
  LocalStack version: 3.8.2.dev120
  LocalStack Docker image sha:
  LocalStack build date: 2024-11-15
  LocalStack build git hash: 75436efc5

Anything else?

Of course I can run the process in detached mode to avoid spamming my terminal, but I don't want to do this, I want to capture these logs so I can make test assertions on them. So for now I will use detached mode to workaround this issue but this should ultimately be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: backlogTriaged but not yet being worked onstatus: staleTo be closed soon due to stalenesstype: bugBug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions