Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48274

Saving to Github/GHE requires email with user or it fails

    Details

    • Similar Issues:
    • Sprint:
      Blue Ocean 1.4 - beta 3, Blue Ocean 1.5 - beta 2

      Description

      In Scope

      • If there is no email address available, use $jenkinsUsername@email-address-not-set

      Original request
      A pipeline created with BlueOcean 1.3.3 (from docker image) and repository GHE, won't be saved if you use default admin user without any other data (specifically, no email address).

      Ideally this would either not be required, or notify the user they need to set an email for the admin (default) user. I think this is only a problem with github enterprise (github.com would always have an email associated I believe, and there is no default user). 

       

      A 500 error will be returned during the PUT request:

      java.lang.IllegalArgumentException: E-mail address of PersonIdent must not be null.
          at org.eclipse.jgit.lib.PersonIdent.<init>(PersonIdent.java:279)
          at org.eclipse.jgit.lib.PersonIdent.<init>(PersonIdent.java:229)
          at io.jenkins.blueocean.blueocean_git_pipeline.GitUtils.buildPersonIdent(GitUtils.java:369)
          at io.jenkins.blueocean.blueocean_git_pipeline.GitUtils.commit(GitUtils.java:311)
          at io.jenkins.blueocean.blueocean_git_pipeline.GitBareRepoReadSaveRequest$2.invoke(GitBareRepoReadSaveRequest.java:90)
          at io.jenkins.blueocean.blueocean_git_pipeline.GitBareRepoReadSaveRequest$2.invoke(GitBareRepoReadSaveRequest.java:71)
          at jenkins.plugins.git.GitSCMFileSystem$3.invoke(GitSCMFileSystem.java:193)
          at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.withRepository(AbstractGitAPIImpl.java:29)
          at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.withRepository(CliGitAPIImpl.java:71)
          at jenkins.plugins.git.GitSCMFileSystem.invoke(GitSCMFileSystem.java:189)
          at io.jenkins.blueocean.blueocean_git_pipeline.GitCacheCloneReadSaveRequest.invokeOnScm(GitCacheCloneReadSaveRequest.java:149)
          at io.jenkins.blueocean.blueocean_git_pipeline.GitBareRepoReadSaveRequest.save(GitBareRepoReadSaveRequest.java:71)
          at 
      

      The issue can be workarounded by adding the email to admin user.

        Attachments

          Issue Links

            Activity

            Hide
            michaelneale Michael Neale added a comment - - edited

            Cliff Meyers I am leaning towards just reporting this as something they need to address in the config, vs changing behavior (perhaps there is a way to call the api without requiring an email... )

             

            Maybe check with Keith Zantow - see if he has any ideas, but a clear message in the UI would do fine. In general people would be using personal identities so shouldn't see this, but I can see with GHE setup (especially new unboxing) this would be pretty common at first, so making it friendlier would be well worth while. 

            Show
            michaelneale Michael Neale added a comment - - edited Cliff Meyers I am leaning towards just reporting this as something they need to address in the config, vs changing behavior (perhaps there is a way to call the api without requiring an email... )   Maybe check with  Keith Zantow - see if he has any ideas, but a clear message in the UI would do fine. In general people would be using personal identities so shouldn't see this, but I can see with GHE setup (especially new unboxing) this would be pretty common at first, so making it friendlier would be well worth while. 
            Hide
            zffocus focus zheng added a comment -

            It is present when using gitlab repo 

            Show
            zffocus focus zheng added a comment - It is present when using gitlab repo 
            Hide
            zffocus focus zheng added a comment -

            Hi Michael Neale I set the email for admin.but still can not save the pipeline.

            Show
            zffocus focus zheng added a comment - Hi  Michael Neale  I set the email for admin.but still can not save the pipeline.
            Hide
            michaelneale Michael Neale added a comment -

            focus zheng I don't understand what you mean - but this is for github, not gitlab (gitlab would save as git/ssh I guess?)

            Show
            michaelneale Michael Neale added a comment - focus zheng I don't understand what you mean - but this is for github, not gitlab (gitlab would save as git/ssh I guess?)
            Hide
            dduportal Damien Duportal added a comment -

            I got this issue while building some Jenkins workshops.

            Adding the email in the GUI was not solving the issue until the Jenkins instance was restarted.

            I switched to an automated creation of email, using the ${JENKINS_HOME}/init.groovy.d scripts which are executed on each restart.

            Here is the script I am using, which sets the admin email, hope it helps: https://github.com/oufti-playground/lab-vm/blob/master/docker/jenkins/ref/init.groovy.d/create-admin-user.groovy#L20

            Show
            dduportal Damien Duportal added a comment - I got this issue while building some Jenkins workshops. Adding the email in the GUI was not solving the issue until the Jenkins instance was restarted. I switched to an automated creation of email, using the ${JENKINS_HOME}/init.groovy.d scripts which are executed on each restart. Here is the script I am using, which sets the admin email, hope it helps: https://github.com/oufti-playground/lab-vm/blob/master/docker/jenkins/ref/init.groovy.d/create-admin-user.groovy#L20

              People

              • Assignee:
                imeredith Ivan Meredith
                Reporter:
                michaelneale Michael Neale
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: