Jenkins plugin not working after upgrade to 2.30.1

Hi, it’s me again :slightly_smiling_face:

After migration from 1.60 to 2.30.1 we have an issue with Jenkins plugin. Before migration we were using it (of course old version, for 1.60) and configuration was stored in jenkins.xml file in conf directory. After upgrade there was no Jenkins plugin installed which for sure is normal behaviour. But when I then install it from available plugins and restart scm instance, application doesn’t work and in web browser and logs I see onlyerror message An error occurred during SCM-Manager startup and java stack trace:

sonia.scm.migration.UpdateException: could not execute update for type sonia.scm.jenkins.config.repository.xml to version 2.0.0 in class sonia.scm.update.UpdateEngine$GlobalUpdateStepWrapper
at sonia.scm.update.UpdateEngine.execute(UpdateEngine.java:100)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at sonia.scm.update.UpdateEngine.update(UpdateEngine.java:88)

Caused by: java.lang.NullPointerException
at sonia.scm.jenkins.update.JenkinsV2ConfigMigrationUpdateStep.buildConfig(JenkinsV2ConfigMigrationUpdateStep.java:79)
at sonia.scm.jenkins.update.JenkinsV2ConfigMigrationUpdateStep.lambda$doUpdate$0(JenkinsV2ConfigMigrationUpdateStep.java:73)
at sonia.scm.update.MapBasedPropertyReaderInstance.call(MapBasedPropertyReaderInstance.java:58)

Something related with update. To get application running again I need to erase scm-jenkins-plugin from plugins directory. With LDAP plugin removing ldap.xml helped so I tried here the same but it didn’t help. I would like to be able to use Jenkins plugin. Can I do something to fix it?

Hi,

this one’s on us. It looks like we missed a case in the migration for the jenkins plugin. To make SCM-Manager run again, please delete the folder <scm-home>/plugins/scm-jenkins-plugin to remove the plugin again and restart SCM-Manager.

We will release a fixed version of the plugin probably today.

If you cannot wait, you can try to fix this manually: Somwhere in your config folder there should be a file repositories.xml.v1.backup. In this you will find many repository entries. For each such entry that has a jenkins.... propery (for example jenkins.url), this has to have a jenkins.branches property, too:

                <item>
                    <key>jenkins.branches</key>
                    <value></value>
                </item>

By the way: Yes, after the migration SCM-Manager does not install the old plugins automatically.

I have no problem waiting for a new version of plugin but just to let you know I tried your workaround and although I think I did everything right it doesnt work (the same outcome as before). In my repositories.xml.v1.backup was only one repository entry with jenkins.* keys in it and I just added snippet you provided inside it.

OK, thanks for the feedback. We released a new version of the Jenkins plugin with a fixed migration (2.2.2). Please check whether this works for you.

Now it works. Thank you!

1 Like

I have closed this thread since there was no activity in the last 30 days.