Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin exclude does not work #5447

Closed
jdelvecchio opened this issue Oct 30, 2024 · 3 comments
Closed

Plugin exclude does not work #5447

jdelvecchio opened this issue Oct 30, 2024 · 3 comments

Comments

@jdelvecchio
Copy link

SUMMARY

Cannot exclude plugins from default plugin list.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Plugin exclusion with var sonar_default_excluded_plugins or sonar_excluded_plugins

ANSIBLE VERSION
2.15.12
CONFIGURATION

N/A

OS / ENVIRONMENT

Ubuntu 2404 on host and bastion

STEPS TO REPRODUCE

Use your latest exemple playbook on a Ubuntu2404 with ansible 2.15.12 -> error on csharp plugin, and cannot exclude it even if I specify it in the corresponding variables

your latest example playbook with modified excluded vars
EXPECTED RESULTS

Plugin is correctly excluded

ACTUAL RESULTS

Plugin is not excluded, sonar fails to launch

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdk.internal.loader.ClassLoaders$AppClassLoader@5ffd2b27-org.sonar.server.plugins.ServerPluginManager': Initialization of bean failed; nested exception is Found a plugin 'C# Code Quality and Security' in the directory 'extensions/plugins' with the same key [csharp] as a built-in feature 'C# Code Quality and Security'. Please remove 'extensions/plugins/sonar-csharp-plugin-9.10.0.77988.jar'.
@dzmitry-rudnouski
Copy link
Member

@jdelvecchio, share the full playbook please.

@jdelvecchio
Copy link
Author

jdelvecchio commented Nov 14, 2024

playbook :

---
- name: Install SonarQube
  hosts: devops_prod_sonar
  become: true
  roles:
    - role: lean_delivery.java
    - role: geerlingguy.postgresql
    - role: lean_delivery.sonarqube

vars file :

---
sonar_db_password: superpass

sonar_db:
  type: postgresql
  port: 5432
  options: ''
  host: localhost
  name: sonar
  user: sonar
  password: "{{ sonar_db_password }}"

sonar_web_password: magicpass

sonar_version: 10.7.0.96327
sonar_check_url: 'http://{{ ansible_fqdn }}:9000'
sonar_proxy_server_name: sonarqube.org.com
sonar_install_recommended_plugins: false
sonar_install_optional_plugins: false

sonar_default_excluded_plugins: 
  - '{{ sonar_plugins_path }}/sonar-csharp-plugin-9.10.0.77988.jar'

# or i've also tried this and it does not seem to exclude it either.
# sonar_excluded_plugins: 
#  - '{{ sonar_plugins_path }}/sonar-csharp-plugin-9.10.0.77988.jar'



change_password: true
sonar_migrate_db: false  # set to true if updating SonarQube to new version

So with the above, I get the error described, the plugin is not excluded. I have to set :

sonar_default_plugins: []

for the play to work (or just list the valid plugins but I didn't bother since I don't really need them)

dzmitry-rudnouski added a commit that referenced this issue Dec 23, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 23, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 23, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 24, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 26, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 26, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 26, 2024
dzmitry-rudnouski added a commit that referenced this issue Dec 26, 2024
@dzmitry-rudnouski
Copy link
Member

Fixed in 2.16.0.
Usage example:

sonar_default_excluded_plugins: 
  - sonar-csharp-plugin-<version>.jar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants