openshiftio / openshift.io

Red Hat OpenShift.io is an end-to-end development environment for planning, building and deploying modern applications.
https://openshift.io
97 stars 66 forks source link

Stack analyses report is not generated #4399

Closed ljelinkova closed 6 years ago

ljelinkova commented 6 years ago
Issue Overview

The stack report is not generated after successful build. This happens 100% times.

report

Expected Behaviour

Stack report should be present on space dashboard page.

Current Behaviour

Stack report is not present on space dashboard page.

Additional Information

Jenkins log: http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-openshift.io-smoketest-us-east-2-released/837/05-06-jenkins-log.html

ERROR: Bayesian analysis failed com.redhat.jenkins.plugins.bayesian.BayesianStepResponse@1c2c65c
Retrying
[Pipeline] {
[Pipeline] sh
[e_e2e-1010-0707-5657_master-6DTDTXNQJZ7GXZ4ZGF4EXT4EVGRRLEDNLF7FMOR2UNLO3RNRKSGQ] Running shell script
[Pipeline] bayesianAnalysis
Found dependencies.
Running Bayesian stack analysis...
Bayesian API URL is https://recommender.api.openshift.io/api/v1
com.redhat.jenkins.plugins.bayesian.BayesianException: Bayesian error: 401
    at com.redhat.jenkins.plugins.bayesian.Bayesian.submitStackForAnalysis(Bayesian.java:135)
    at com.redhat.jenkins.plugins.bayesian.BayesianAnalysisStep$Execution.run(BayesianAnalysisStep.java:118)
    at com.redhat.jenkins.plugins.bayesian.BayesianAnalysisStep$Execution.run(BayesianAnalysisStep.java:78)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1$1.call(SynchronousNonBlockingStepExecution.java:49)
    at hudson.security.ACL.impersonate(ACL.java:260)
    at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution$1.run(SynchronousNonBlockingStepExecution.java:46)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

[Pipeline] error
[Pipeline] }
[Pipeline] // retry
[Pipeline] echo
Unable to run Bayesian analysis: hudson.AbortException: Bayesian analysis failed com.redhat.jenkins.plugins.bayesian.BayesianStepResponse@17950ed
[Pipeline] echo
Checking sonarqube exists
[Pipeline] echo
Code validation service: sonarqube not available
[Pipeline] echo
s2i mode: true
[Pipeline] stash
Stashed 8 file(s)
abs51295 commented 6 years ago

I can reproduce this issue on prod-preview.

msrb commented 6 years ago

So the problem here is that newly introduced auth library used by Analytics service checks if email_verified field in provided JWT token is True. This works just fine for user tokens, but tokens used by Jenkins don't have this field. This means that Analytics calls triggered from build pipelines are affected, but IDEs should be fine.

msrb commented 6 years ago

Note Jenkins tokens used in prod/prod-preview are different from our CI tokens, that's why this issue was not caught earlier.

miteshvp commented 6 years ago

This change is in prod-preview. @ljelinkova - can you please validate on prod-preview?

ldimaggi commented 6 years ago

The E2E test includes a test of the analytics report, yes.

On Wed, Oct 10, 2018 at 9:33 AM GeorgeActon notifications@github.com wrote:

@ljelinkova https://github.com/ljelinkova why is this labeled with e2e-test? did the E2E test fail?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openshiftio/openshift.io/issues/4399#issuecomment-428573063, or mute the thread https://github.com/notifications/unsubscribe-auth/AAnOPYc76Tfrh0FycFtbqCKRSIsDJdQBks5ujfczgaJpZM4XU_dC .

-- Len DiMaggio (ldimaggi@redhat.com) JBoss by Red Hat 314 Littleton Road Westford, MA 01886 USA tel: 978.392.3179 cell: 781.472.9912 http://www.redhat.com http://community.jboss.org/people/ldimaggio

msrb commented 6 years ago

I've tested the fix in staging and promoted it prod.

ppitonak commented 6 years ago

@msrb it's still failing

msrb commented 6 years ago

@ppitonak which environment? I've tested it in prod-preview before promoting to prod. I see the stack report.

ppitonak commented 6 years ago

@msrb it really passed at least twice on Jenkins but doesn't work for my account ppitonak-preview on prod-preview

msrb commented 6 years ago

@ppitonak I see some AuthError(401, 'Authentication failed - token missing') errors on prod-preview. Could you please check if your Jenkins master has the token in RECOMMENDER_API_TOKEN env variable?

msrb commented 6 years ago

And if you haven't updated your tenant since May, then it could be the reason :)

sbose78 commented 6 years ago

Aslak usually updates all tenants using his script :)

msrb commented 6 years ago

Aslak usually updates all tenants using his script :)

Ah, cool :) Ignore my previous comment then :wink:

ppitonak commented 6 years ago

@ppitonak I see some AuthError(401, 'Authentication failed - token missing') errors on prod-preview. Could you please check if your Jenkins master has the token in RECOMMENDER_API_TOKEN env variable?

I don't have the permissions to check that.

ppitonak commented 6 years ago

@msrb it passed twice with my account, closing.

miteshvp commented 6 years ago

I can confirm it's working in production as well.