报错信息:
Sonarqube安装插件时提示:An error has occurred. Please contact your administrator
解决方法:
1.查询报错日志
使用docker logs查询Sonarqube日志,插件下载失败。如下:
# docker logs --tail 100 sonarqube
java.lang.IllegalStateException: Fail to download the plugin (l10nzh, version 8.9) from https://github.com/xuhuisheng/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-8.9/sonar-l10n-zh-plugin-8.9.jar (error is : Fail to download: https://github.com/xuhuisheng/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-8.9/sonar-l10n-zh-plugin-8.9.jar (no proxy))
从以上报错可以指定https://github.com/xuhuisheng/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-8.9/sonar-l10n-zh-plugin-8.9.jar包下载失败
2.手动下载插件包到plugins目录
(1)进入plugins目录
#docker内部plugins目录
#cd /opt/sonarqube/data/web/deploy/plugins
#docker-composer内plugins目录,请参考博主上一篇docker-compose安装SonarQube
#cd ./conf/sonarqube/data/web/deploy/plugins
(2)使用wget下载报错插件到plugins目录
# wget https://github.com/xuhuisheng/sonar-l10n-zh/releases/download/sonar-l10n-zh-plugin-8.9/sonar-l10n-zh-plugin-8.9.jar
3.重启sonarqube服务,插件安装完成
此处安装的是中文汉化插件,重启sonarqube服务后可看到界面已改为中文
注:SonarQube安装可参考本博主的上一篇《docker-compose安装SonarQube》,搭配部署更简单更快捷。