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

randomly failures when using Erratum to fetch rpmdiff test results for advisories #185

Open
lmilbaum opened this issue Nov 6, 2019 · 15 comments
Labels

Comments

@lmilbaum
Copy link

lmilbaum commented Nov 6, 2019

Every once in a while, hitting this message. It is not consistent. No clear understanding what is going on and how to troubleshoot it.

This is the stacks-trace:

 File "/home/lmilbaum/src/code.engineering.redhat.com/et-reporter/lib/gateslib/rpmdiff.py", line 24, in rpmdiff
    results = [result for result in e.externalTests(test_type='rpmdiff')
  File "/home/lmilbaum/.virtualenvs/venv3/lib/python3.6/site-packages/errata_tool/erratum.py", line 462, in externalTests
    response = self._get(url)
  File "/home/lmilbaum/.virtualenvs/venv3/lib/python3.6/site-packages/errata_tool/connector.py", line 185, in _get
    'Pigeon crap. Did it forget to run kinit?')```

@yazug
Copy link
Collaborator

yazug commented Nov 8, 2019

this seems to be an issue that kerberos authentication is not being recognized. try running klist to see if you have a valid ticket.

@ktdreyer
Copy link
Contributor

ktdreyer commented Nov 8, 2019

Maybe we should change that error message to suggest what you suggested: "klist"

@lmilbaum
Copy link
Author

I have reason to believe it is related to the ssl verification. Verifying it.

@ktdreyer
Copy link
Contributor

If it was an SSL problem, you should have seen an SSLException from python-requests.

The code is here:

            elif ret_data.status_code in [401]:
                raise ErrataException(
                    'Pigeon crap. Did it forget to run kinit?')

It looks to me like the SSL handshake completed, and you got a real HTTP response code from the server.

@lmilbaum
Copy link
Author

lmilbaum commented Nov 12, 2019

@ktdreyer I see your point. The program which uses it, is running in a mock environment. I have difficulties to debug it. Replacing the usage of errata_tool with the errata REST API just to verify it.

@ktdreyer
Copy link
Contributor

Would you please say more about the mock environment?

@lmilbaum
Copy link
Author

@yazug yazug changed the title Pigeon crap. Did it forget to run kinit? randomly failures when using Erratum to fetch rpmdiff test results for advisories Nov 14, 2019
@yazug
Copy link
Collaborator

yazug commented Nov 14, 2019

Thanks lioramilbaum for talking with me and providing more details for this bug report.

Updated summary of failure. The script/usage would work most of the time but randomly it would fail and spit out the above error message.

Based on the behavior I think we can rule out krb auth and certs being there as the primary failure cause. I think there is likely an edge case that is being caught by errata-tool and reporting just one failure mode back.

The code being substituted in is something like the following:

def rpmdiff(errata_id):
    e = Erratum(errata_id)
    results = [result for result in e.externalTests(test_type='rpmdiff') ...]

Which is replacing the following from their existing working code:

def rpmdiff(errata_id):
    res = requests.get( .../v1/external_tests/?filter....)
    results = [result for result in res.json()['data'] ... ]

An initial guess is that ET is getting overloaded with extra calls that Erratum init method is doing to prep the object upfront when the only thing you are really wanting to process at this point is the external test results.

@yazug yazug added the bug label Nov 14, 2019
@ktdreyer
Copy link
Contributor

It is really weird that the ET would be giving a 401 status code. @lioramilbaum can you break up that res.json()['data'] line into several more lines, so we can see the exact problem?

Like you can make your rpmdiff(errata_id) method do the following:

    res = requests.get( .../v1/external_tests/?filter....)
    res.raise_for_status()  # If we get an HTTP 401, we will raise here
    json_result = res.json()
    data = json_result['data']
    results = [result for result in data ... ]

@ktdreyer
Copy link
Contributor

Also, with the external_tests stuff, the Errata Tool does have to wait for the external test system to report back to it. In this case with RPMDiff, the ET waits for the RPMDiff systems to report the results back to the ET. It's still strange that we would get an HTTP 401 error here, but anyway, we might be hitting some small corner case here.

@yazug
Copy link
Collaborator

yazug commented Nov 14, 2019

what you have is essentially what is already there and it works. I think the issue might be the extra overhead that Setting up the Erratum object adds to ET but not certain. We need to look closer and likely instrument up a test case for this to figure out the issue.

@ktdreyer
Copy link
Contributor

Yeah, I would like to confirm in particular that this truly is a 401 error.

@ktdreyer
Copy link
Contributor

ktdreyer commented Feb 3, 2020

@lioramilbaum , a while ago we talked IRC about Kerberos. You had a Jenkins job that was wrapping some calls in withKerberosCredentialsCache.groovy. I think we discovered that Groovy script was not operating the way you expected. The Jenkins job you mentioned was not using Errata Tool specifically, but I'm wondering if that same environmental problem could be applying in this case as well.

@lmilbaum
Copy link
Author

lmilbaum commented Feb 4, 2020

@ktdreyer We wrap the Jenkins job script with the function - 'withKrbAuth'. Have you noticed issues with this function in particular?

@ktdreyer
Copy link
Contributor

ktdreyer commented Feb 4, 2020

That was just wild speculation - I'm not familiar with Groovy or withKerberosCredentialsCache or withKrbAuth :)

@red-hat-storage red-hat-storage deleted a comment Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants