Skip to content

steampipe query returning exit code 0 when there is an error #4451

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

Open
gabrielsoltz opened this issue Nov 26, 2024 · 8 comments
Open

steampipe query returning exit code 0 when there is an error #4451

gabrielsoltz opened this issue Nov 26, 2024 · 8 comments
Assignees
Labels
bug Something isn't working ext:needs-triage External issues that have been accepted and now need initial review/assessment/fix

Comments

@gabrielsoltz
Copy link

Describe the bug
Hey Team,
We see that when running steampipe query <file.sql?>, the CLI is returning an error but the exit code is 0.

[ec2-user@stg-dashboards ~]$  $STEAMPIPE_BIN --install-dir $STEAMPIPE_CONFIG query XXXX.sql
Error: relation "XXXX" already exists (SQLSTATE 42P07)
[ec2-user@stg-dashboards ~]$ echo $?
0

Thank you!

Steampipe version (steampipe -v)
Steampipe v1.0.1

To reproduce
Steps to reproduce the behavior (please include relevant code and/or commands).

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@gabrielsoltz gabrielsoltz added the bug Something isn't working label Nov 26, 2024
@pskrbasu
Copy link
Contributor

Thank you @gabrielsoltz for raising this issue. We will get it fixed.

@pskrbasu pskrbasu self-assigned this Nov 28, 2024
pskrbasu added a commit that referenced this issue Nov 28, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Jan 28, 2025
@pskrbasu pskrbasu removed the stale No recent activity has been detected on this issue/PR and it will be closed label Jan 28, 2025
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale No recent activity has been detected on this issue/PR and it will be closed label Mar 30, 2025
@pskrbasu pskrbasu removed the stale No recent activity has been detected on this issue/PR and it will be closed label Apr 24, 2025
@gabrielsoltz
Copy link
Author

@pskrbasu any update on this one?

@pskrbasu
Copy link
Contributor

pskrbasu commented Jun 1, 2025

@gabrielsoltz This is currently planned and is on my list. We will get this sorted soon. Thanks!

@frek818
Copy link
Contributor

frek818 commented Jun 9, 2025

@pskrbasu , will this handle return non-zero on errors in general?

I know that the check sub-command has been deprecated and removed. However, I expect steampipe check ... (or any non-existant sub-command) to return a non-zero exit code.

Should I open a separate issue for this?

@pskrbasu
Copy link
Contributor

@frek818 All Steampipe commands return non-zero exit codes in the event of errors. This issue is a specific bug in steampipe query where the relation already exists returns a 0 exit code.
If you find any existing Steampipe commands which don't return a non-zero exit code in case of failures, you should report to us and create an issue.

@frek818
Copy link
Contributor

frek818 commented Jun 10, 2025

Apology for piggybacking on this issue. I created a new issue #4563 for the bug that I'm experiencing. I've also took a stab at a pull request (#4564) to fix it.

@pskrbasu pskrbasu added the ext:needs-triage External issues that have been accepted and now need initial review/assessment/fix label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ext:needs-triage External issues that have been accepted and now need initial review/assessment/fix
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants