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

Salt-API has no Return-Code #47208

Closed
meaksh opened this issue Apr 20, 2018 · 18 comments
Closed

Salt-API has no Return-Code #47208

meaksh opened this issue Apr 20, 2018 · 18 comments
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@meaksh
Copy link
Contributor

meaksh commented Apr 20, 2018

Description of Issue/Question

As discussed with @rallytime , I bring #36318 (comment) as a new issue to rise a discussion about how we can approach this.

"Salt-API does not have Return-Code": You cannot differentiate between a value "False" and Minion down producing "False".

Example:

curl -sSk http://localhost:9080/ 
  -H 'Accept: application/json' 
  -H 'X-Auth-Token: xyz'
   -d client=local
   -d tgt='*'
   -d fun=grains.get -d arg=ip_gw

This return when minion is running:

{"return": [{"minion": true}]}

When I stop the minion I get:

{"return": [{"minion": false}]}

How should I know that "false" mean here "minion down" and that it is not the value for the grain ip_gw?

@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 20, 2018

Can you include a versions report?

@Ch3LL Ch3LL added the info-needed waiting for more info label Apr 20, 2018
@Ch3LL Ch3LL added this to the Blocked milestone Apr 20, 2018
@mchugh19
Copy link
Contributor

Similar to #37043

@brejoc
Copy link
Contributor

brejoc commented Apr 20, 2018

@Ch3LL This is pretty much version independent, since it's more or less a design flaw in Salt-API. So this happens in 2016.x, 2017.x and 2018.x.

@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 23, 2018

Thanks for specifying the versions. appreciate it @brejoc

Through the issue @mchugh19 pointed me too I found this PR: #41356 I know that does not resolve this particular issue but figured it might be useful to know for others related to this issue.

I will keep this issue open while still linked to 37043 as its a specific use case and we can focus on fixing this as well.

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around P3 Priority 3 team-netapi and removed info-needed waiting for more info labels Apr 23, 2018
@Ch3LL Ch3LL modified the milestones: Blocked, Approved Apr 23, 2018
@Ch3LL
Copy link
Contributor

Ch3LL commented Apr 23, 2018

ping @saltstack/team-netapi any ideas here on a fix?

@mattp-
Copy link
Contributor

mattp- commented Apr 25, 2018

as referenced in #41356 you can use full_return kwarg to access the retcode among other metadata of the job. this issue can be resolved.

@mchugh19
Copy link
Contributor

@mattp- I think the referenced feature only supports the LocalClient and Runner cmd function. So it helps, but doesn't fully address the issue raised here and in #37043

@mattp-
Copy link
Contributor

mattp- commented Apr 25, 2018

@mchugh19 it looks like wheel client also supports full_return. the example in the original issue is also covered, ie:

DEBUG 2018-04-25 18:27:04,993 libpepper: [{'tgt_type': 'glob', 'full_return': True, 'tgt': 'testbox', 'batch': None, 'client': 'local', 'arg': [], 'fun': 'test.false'}]
{
    "return": [
        {
            "testbox": {
                "jid": "20180425182705054749",
                "ret": false,
                "retcode": 0
            }
        }
    ]
}

@brejoc
Copy link
Contributor

brejoc commented May 18, 2018

Ah, this looks good. Thanks @mattp-!

@lucidd, what do you think?

@lucidd
Copy link

lucidd commented May 18, 2018

looks good. Is there any documentation regarding retcode?

@brejoc
Copy link
Contributor

brejoc commented May 18, 2018

@lucidd I'm not aware of anything. @meaksh, @isbm maybe?

@stale
Copy link

stale bot commented Aug 31, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Aug 31, 2019
@stale stale bot closed this as completed Sep 7, 2019
@brejoc
Copy link
Contributor

brejoc commented Nov 27, 2019

I don't think that anything has changed here!

@Ch3LL Ch3LL reopened this Dec 17, 2019
@stale
Copy link

stale bot commented Dec 17, 2019

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Dec 17, 2019
@stale
Copy link

stale bot commented Jan 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jan 16, 2020
@sagetherage
Copy link
Contributor

not stale

@stale
Copy link

stale bot commented Jan 22, 2020

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Jan 22, 2020
@sagetherage sagetherage removed the P3 Priority 3 label Jun 3, 2020
@twangboy
Copy link
Contributor

twangboy commented Sep 6, 2023

Closing this issue due to age and lack of activity. Please test this on version 3006.2 and create a new issue if the problem persists. The new issue template has more information and will allow us to track and reproduce the issue more effectively. Thanks!

@twangboy twangboy closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

8 participants