Seems to be caused by some weird logic in this class if there is no configuration yet.
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/jenkins/model/JenkinsLocationConfiguration.java#L67-L83 So it means you don't have any configuration set for jenkins.model.JenkinsLocationConfiguration. I would recommend calling something like def jlc = jenkins.model.JenkinsLocationConfiguration.get() jlc.setUrl("http://domain.com") jlc.setAdminAddress("[email protected]") jlc.save() Vincent Le ven. 28 sept. 2018 à 20:43, Jeroen Wolff <[email protected]> a écrit : > Hi all, > > > I've got an init.d/ groovy script to configure the mailer task: > > import jenkins.model.* > def jenkinsInst = Jenkins.getInstance() > def mailerDesc = jenkinsInst.getDescriptor("hudson.tasks.Mailer"); > mailerDesc.setSmtpHost("smtp.domain.com") > mailerDesc.setUseSsl(false) > mailerDesc.setDefaultSuffix("@domain.com") > mailerDesc.setReplyToAddress("[email protected]") > mailerDesc.setCharset("UTF-8") > mailerDesc.save() > > When the next time Jenkins restarts after this script i get an > warning "You have data stored in an older format and/or unreadable data." > > type: > jenkins.model.JenkinsLocationConfiguration > name: > JenkinsLocationConfiguration > error: > MissingFieldException: No field 'defaultSuffix' found in class > 'jenkins.model.JenkinsLocationConfiguration', MissingFieldException: No > field 'replyToAddress' found in class > 'jenkins.model.JenkinsLocationConfiguration', MissingFieldException: No > field 'smtpHost' found in class 'jenkins.model.JenkinsLocationConfiguration' > > > What can be wrong? > > Regards, > > Jeroen > > -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/cf900a97-cdcf-4bd9-a4be-d4d1098338c5%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/cf900a97-cdcf-4bd9-a4be-d4d1098338c5%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAH-zGCgxe%3DTcfuX8Zb0CvrL2Dr%3DOJC2gVfiZOs_86OLvgVry6g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
