Skip to content

apparent incomplete intialization with secrets, failure to mount volumes #14093

Closed

Description

@gabemontero

See https://ci.openshift.redhat.com/jenkins/job/test_branch_origin_extended_builds/54/consoleFull

This time, the job failed, and then when we attempted to get job log, we got 403's. And sure enough,
within the test, we see that we are being authenticated as anonymous, which oc whoami -t not returning a valid token:


STEP: get token via whoami
May  7 10:17:58.536: INFO: Running 'oc whoami --config=/tmp/extended-test-jenkins-pipeline-bk2z1-x400d-user.kubeconfig --namespace=extended-test-jenkins-pipeline-bk2z1-x400d -t'
Retrieving Jenkins resource: "http://172.30.19.134:80//job/extended-test-jenkins-pipeline-bk2z1-x400d-openshift-jee-sample/1/consoleText"
<html><head><meta http-equiv='refresh' content='1;url=/securityRealm/commenceLogin?from=%2F%2Fjob%2Fextended-test-jenkins-pipeline-bk2z1-x400d-openshift-jee-sample%2F1%2FconsoleText'/><script>window.location.replace('/securityRealm/commenceLogin?from=%2F%2Fjob%2Fextended-test-jenkins-pipeline-bk2z1-x400d-openshift-jee-sample%2F1%2FconsoleText');</script></head><body style='background-color:white; color:white;'>


Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
  
Permission you need to have (but didn't): hudson.model.Hudson.Read
 ... which is implied by: hudson.security.Permission.GenericRead
 ... which is implied by: hudson.model.Hudson.Administer
-->

</body></html>                                                                                                                                                                                                                                                                                                            

Minimally, the user which instantiated the jenkins template and created the pods, etc. should have proper credentials set up.
Also, in the dump of the jenkins pod logs, I see none of the expected messages that we were able to read in the secrets mounted into the jenkins pod.

I've seen some messages about failures if mounting to pods in the master logs before with recent flakes, but could never correlate it time wise with our runs. This time though, there errors are more precise and damning for the namespace in question:

openshift.log:146252:E0507 08:43:30.512950    6308 secret.go:201] Couldn't get secret extended-test-jenkins-pipeline-bk2z1-7cjrf/deployer-token-tqh6d
openshift.log:146253:E0507 08:43:30.513027    6308 nestedpendingoperations.go:262] Operation for "\"kubernetes.io/secret/aa0c10c8-3322-11e7-b69e-0e2d300b6578-deployer-token-tqh6d\" (\"aa0c10c8-3322-11e7-b69e-0e2d300b6578\")" failed. No retries permitted until 2017-05-07 08:43:31.012998619 -0400 EDT (durationBeforeRetry 500ms). Error: MountVolume.SetUp failed for volume "kubernetes.io/secret/aa0c10c8-3322-11e7-b69e-0e2d300b6578-deployer-token-tqh6d" (spec.Name: "deployer-token-tqh6d") pod "aa0c10c8-3322-11e7-b69e-0e2d300b6578" (UID: "aa0c10c8-3322-11e7-b69e-0e2d300b6578") with: secret "extended-test-jenkins-pipeline-bk2z1-7cjrf"/"deployer-token-tqh6d" not registered

and

openshift.log:259074:E0507 09:05:16.691612    6308 kubelet.go:1554] Unable to mount volumes for pod "ruby-1-build_extended-test-jenkins-pipeline-bk2z1-f4krb(5c15d535-3325-11e7-b69e-0e2d300b6578)": timeout expired waiting for volumes to attach/mount for pod "extended-test-jenkins-pipeline-bk2z1-f4krb"/"ruby-1-build". list of unattached/unmounted volumes=[docker-socket builder-dockercfg-b3hvd-push builder-token-08xnf]; skipping pod
openshift.log:259075:I0507 09:05:16.691797    6308 server.go:345] Event(v1.ObjectReference{Kind:"Pod", Namespace:"extended-test-jenkins-pipeline-bk2z1-f4krb", Name:"ruby-1-build", UID:"5c15d535-3325-11e7-b69e-0e2d300b6578", APIVersion:"v1", ResourceVersion:"7485", FieldPath:""}): type: 'Warning' reason: 'FailedMount' Unable to mount volumes for pod "ruby-1-build_extended-test-jenkins-pipeline-bk2z1-f4krb(5c15d535-3325-11e7-b69e-0e2d300b6578)": timeout expired waiting for volumes to attach/mount for pod "extended-test-jenkins-pipeline-bk2z1-f4krb"/"ruby-1-build". list of unattached/unmounted volumes=[docker-socket builder-dockercfg-b3hvd-push builder-token-08xnf]
openshift.log:259076:E0507 09:05:16.691808    6308 pod_workers.go:182] Error syncing pod 5c15d535-3325-11e7-b69e-0e2d300b6578 ("ruby-1-build_extended-test-jenkins-pipeline-bk2z1-f4krb(5c15d535-3325-11e7-b69e-0e2d300b6578)"), skipping: timeout expired waiting for volumes to attach/mount for pod "extended-test-jenkins-pipeline-bk2z1-f4krb"/"ruby-1-build". list of unattached/unmounted volumes=[docker-socket builder-dockercfg-b3hvd-push builder-token-08xnf]

Activity

  1. added
    kind/test-flake
    on May 7, 2017
  2. bparees commented on May 8, 2017

    @bparees
    Contributor

    if secrets aren't getting mounted into pods (and your analysis seems sound to me), let's start with @derekwaynecarr's team. hopefully it's a known upstream issue.

  3. gabemontero commented on May 9, 2017

    @gabemontero
    ContributorAuthor

    @mfojtik just in case, fyi

  4. drewhemm commented on May 10, 2017

    @drewhemm

    We've just hit the same error message when starting a build in OpenShift Enterprise 3.4.18:

    LASTSEEN                        FIRSTSEEN                       COUNT     NAME                          KIND      SUBOBJECT   TYPE      REASON        SOURCE                   MESSAGE
    2017-05-10 11:53:47 +0100 BST   2017-05-10 11:49:20 +0100 BST   3         il3-broker-snapshot-8-build   Pod                   Warning   FailedMount   {kubelet 10.165.5.102}   Unable to mount volumes for pod "il3-broker-snapshot-8-build_il-core-bld(0aebb1c3-356e-11e7-b94a-066d47d250b1)": timeout expired waiting for volumes to attach/mount for pod "il3-broker-snapshot-8-build"/"il-core-bld". list of unattached/unmounted volumes=[docker-socket builder-dockercfg-wnhil-push git-user-source builder-token-flgve]
    2017-05-10 11:53:47 +0100 BST   2017-05-10 11:49:20 +0100 BST   3         il3-broker-snapshot-8-build   Pod                 Warning   FailedSync   {kubelet 10.165.5.102}   Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "il3-broker-snapshot-8-build"/"il-core-bld". list of unattached/unmounted volumes=[docker-socket builder-dockercfg-wnhil-push git-user-source builder-token-flgve]
    

    It worked yesterday, so I'm not sure what has caused it. Any luck with mitigation or workarounds?

  5. drewhemm commented on May 10, 2017

    @drewhemm

    I noticed that all the errors were coming from pods running on a single node, so I marked that node as unschedulable. Builds and deployments are now working on other pods. I've rebooted the troublesome node and will watch it for future failures. I also sent a sosreport to RH.

  6. oatmealraisin commented on May 10, 2017

    @oatmealraisin

    This happened again today,

    Jenkins logs

  7. bparees commented on May 23, 2017

    @bparees
    Contributor

    we're continuing to see issues w/ mounting secrets:

    https://ci.openshift.redhat.com/jenkins/job/test_branch_origin_extended_builds/73/testReport/junit/(root)/Extended/_builds__Slow__openshift_pipeline_build_Pipeline_using_jenkins_client_plugin_should_build_and_complete_successfully/

    May 23 08:50:20.523: INFO: At 2017-05-23 08:44:18.719566053 -0400 EDT - event for mongodb-1-deploy: {kubelet 172.18.1.238} FailedMount: MountVolume.SetUp failed for volume "kubernetes.io/secret/6866189e-3fb5-11e7-b08b-0ebe0c94f756-deployer-token-svngd" (spec.Name: "deployer-token-svngd") pod "6866189e-3fb5-11e7-b08b-0ebe0c94f756" (UID: "6866189e-3fb5-11e7-b08b-0ebe0c94f756") with: secret "extended-test-jenkins-pipeline-xtkt8-6ptnm"/"deployer-token-svngd" not registered
    
  8. bparees commented on May 23, 2017

    @bparees
    Contributor

    @derekwaynecarr is there anyone on your team who can shed some light on these mount failures?

  9. liggitt commented on May 31, 2017

    @liggitt
    Contributor

    the "secret not registered" error is from https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/secret/secret_manager.go#L204 which means the kubelet's view of secrets needed is not accurate

  10. derekwaynecarr commented on Jul 5, 2017

    @derekwaynecarr
    Member

    @joelsmith -- can you help triage further?

  11. gabemontero commented on Jul 6, 2017

    @gabemontero
    ContributorAuthor

    If it helps, I have not seen this in our jenkins pipeline extended tests in the 2 weeks since we bumped the container memory limit. We were seeing a variety of intermittent, "lower level" issues in those tests that I concluded coincided with container level memory exhaustion.

    I was running tests fairly regularly in #14013 and after a quick perusal, don't think we went 2 weeks without hitting this while still running at the lower memory limit for those tests.

    If intermittent container memory exhaustion seems like a plausible reason for a failure like this, we could consider closing this as "environmental", or at least lowering the severity and monitoring our overnight jenkins tests a while longer to see if it still occurs.

    Of course if this scenario warrants some investigation into more fault tolerance, retry, etc. in this path, I'll defer to the SME's here.

  12. gabemontero commented on Aug 3, 2017

    @gabemontero
    ContributorAuthor

    I still have not seen this in our jenkins pipeline tests since the env change noted in #14093 (comment)

  13. joelsmith commented on Sep 6, 2017

    @joelsmith
    Contributor

    We think we've tracked this down. We'll work on getting this upstream PR merged: kubernetes/kubernetes#52044 then backport to origin.

  14. gabemontero commented on Sep 6, 2017

    @gabemontero
    ContributorAuthor

    Certainly a race condition like that could line up with the timing changes one might expect when we relaxed the memory resource constraints of our jenkins pipeline tests.

    Thanks for the follow up.

  15. joelsmith commented on Oct 25, 2017

    @joelsmith
    Contributor

    As it turns out, the bug that we thought we found wasn't a bug and the secrets not mounting error was a red herring. The log message happens when a pod is going away right at the same time that the volume manager is checking if it needs to mount anything. So I think that your theory about your pod needing more memory is a good one. If the pod was dying as a result of it not having enough resources, the error you saw would be likely to show up in the logs. I'm going to close this since I believe that the real issue is fixed thanks to the larger pod sizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

component/kuberneteskind/test-flakepriority/P1

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions