Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command run with run_sh failing silently #2576

Closed
MegaRedHand opened this issue Oct 29, 2024 · 3 comments
Closed

Command run with run_sh failing silently #2576

MegaRedHand opened this issue Oct 29, 2024 · 3 comments
Labels
bug Something isn't working cli For bugs relating to the CLI painful Painful bug

Comments

@MegaRedHand
Copy link

What's your CLI version?

1.3.1

Description & steps to reproduce

When running kurtosis run main.star with the following minimal package:

# main.star
def run(plan, args={}):
    plan.run_sh(run="exit 1")

I get the following output:

INFO[2024-10-29T17:54:19-03:00] Creating a new enclave for Starlark to run inside... 
INFO[2024-10-29T17:54:21-03:00] Enclave 'vast-fen' created successfully      

Container images used in this run:
> badouralix/curl-jq - locally cached

Running sh script: `exit 1`
Command returned with exit code '0' with no output

Starlark code successfully run. No output was returned.

⭐ us on GitHub - https://github.com/kurtosis-tech/kurtosis
INFO[2024-10-29T17:54:24-03:00] ================================================= 
INFO[2024-10-29T17:54:24-03:00] ||          Created enclave: vast-fen          || 
INFO[2024-10-29T17:54:24-03:00] ================================================= 
Name:            vast-fen
UUID:            8d1a612efba9
Status:          RUNNING
Creation Time:   Tue, 29 Oct 2024 17:54:19 -03
Flags:           

========================================= Files Artifacts =========================================
UUID   Name

========================================== User Services ==========================================
UUID   Name   Ports   Status

Desired behavior

I expected this command to fail after executing that step. Not failing right then propagates errors to other steps, sometimes with quite confusing results.

What is the severity of this bug?

Painful; this is causing significant friction in my workflow.

What area of the product does this pertain to?

CLI: the Command Line Interface

@MegaRedHand MegaRedHand added the bug Something isn't working label Oct 29, 2024
@github-actions github-actions bot added cli For bugs relating to the CLI painful Painful bug labels Oct 29, 2024
@tedim52
Copy link
Contributor

tedim52 commented Oct 31, 2024

Hey I'll take a look into this. Specifically wondering why the exit code is 0. For now, I imagine you are running this against a specific workflow. Are you able to check the output of result.output and use that to fail instead?

@MegaRedHand
Copy link
Author

Yes. For cases where we're not already using the output, we could append an echo $? or similar and verify it at the end. Otherwise, we'd need to parse the output first.

Also, just re-read the docs and it seems I mixed up the run_sh and exec commands. I thought both behaved the same wrt non-zero exit codes. Sorry for the confusion!

@tedim52
Copy link
Contributor

tedim52 commented Nov 7, 2024

awesome!

@tedim52 tedim52 closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli For bugs relating to the CLI painful Painful bug
Projects
None yet
Development

No branches or pull requests

2 participants