The problem of jenkins gitlab plugin after gitlab api is upgraded from v3

Phanix
·
·
IPFS
·

It happened in early 2019, so let's record it. Mainly because after the gitlab upgrade, the old version of the v3 api has been removed, so the jenkins gitlab plugin cannot be used.

cause

The gitlab plugin on the original jenkins (v 2.51, installed on macos) is an old version, and there is no problem with gitlab. One day, after the gitlab upgrade, the old v3 api was eliminated, leaving only the v4 api, but because jenkins has not been updated for a long time, the gitlab plugin can only support the v3 api, so jenkins sprays error and cannot work. Then because there is only an error message when entering jenkins (because the gitlab account is tied), there is no way to update the plugin.

In theory, the gitlab plugin of jenkins should be upgraded before upgrading gitlab, and then the gitlab upgrade can be performed painlessly. But because I didn't notice it, it all rotted.

Handling & new issues

Ok, then try to restore the image restore before the gitlab upgrade. First upgrade the gitlab plugin of jenkins and then do a gitlab upgrade again. As a result, the plugin was upgraded and it rotted...

Check that the config.xml file exists and that there is no problem with access permissions.

Solution

I found it on the Internet and found that the gitlab plugin originally installed on jenkins is v1.4.x, and it has to be upgraded to v1.5.x to support gitlab v4 api. But the v1.5.x plugin must be jenkins v2.73 or above to work properly, but it is v2.51 in use, so…. Then the bad thing is that according to the instructions found on the jenkins plugin page, the gitlab plugin says that as long as jenkins 1.6 or above can be used =_=

So the next step is that gitlab has already been upgraded, so there is no need to change it. First, move the config.xml of jenkins away and back it up as a jenkins plugin. Then upgrade jenkins to v2.73 or above, and then install the gitlab plugin v1 as a precedent. 5.x, and then merge the backup config.xml back (only the gitlab plugin-related problems need to be paid attention to) and it is over.

Original link: Phanix's Blog

CC BY-NC-ND 2.0

Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!