Cant create a Quality Profile because there are no languages available

Hello,

I am trying to run code analysis in my Pipeline. I have a working instance of Sonarqube and initalized a new project through the web interface.

But when my Pipeline want to run the Scanner, it throws an error, that it need a quality profile.
So np, I thought and opened Sonarqube. But there I see this error and don’t know how I can fix this.
Why do I even need a Quality Profile? Can I somehow turn this off when I start the Scanner?

Error:

I hope you can help me, since this is an essential part of my research paper. :frowning:

Image Sonarqube: sonarqube:8.4.1-community
Sonarscanner: 3.7.0.1746

Thanks in advance for any hint. :smiley:


Update:

I found out that I can install plugins which add a certain language.
Unfortunately I need Java and only found JaCoCo. Is this the only option?

But it is still not working even with these plugins:

Hi @Max1 ,

welcome to the community :wave:

do you use sonarqube within docker by any chance? usually sonarqube comes with a variety of language analyzers preloaded, but when you create a empty folder and just mount it as a volume to the extensions directory, no plugins are available and everything needs to be installed from the marketplace again. we have some docs how to work around this here.

The community edition should include java and jacoco and already have the sonarway quality profile defined :wink:

Hope that helps

Thank you for the fast reply.

Yeah you got me. :slight_smile: But I try to run Sonarqube in Kubernetes, because my research paper is about the development of a Kubernetes Environment and a CI-Pipeline (where I use Gitlab, which execute its jobs also in Kubernetes).
So it would be beneficial to also have Sonarqube in Kubernetes, as otherwise it would be quite a break in style.

In the Deployment of Sonarqube I followed the advice of the link you provided.

Is there any chance to work around this problem?


apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: sonarqube
name: sonarqube
namespace: pa
spec:
replicas: 1
selector:
matchLabels:
app: sonarqube
template:
metadata:
labels:
app: sonarqube
spec:
containers:
- name: sonarqube
image: sonarqube:8.4.1-community
resources:
requests:
cpu: 250m
memory: 1024Mi
limits:
cpu: 500m
memory: 2048Mi
volumeMounts:
- mountPath: “/opt/sonarqube/data/”
name: sonar-data
- mountPath: “/opt/sonarqube/extensions/”
name: sonar-extensions
env:
- name: SONAR_JDBC_USERNAME
value: “sonarqube”
- name: SONAR_JDBC_URL
value: “jdbc:postgresql://blablub”
- name: SONAR_JDBC_PASSWORD
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: postgres-pa
ports:
- containerPort: 9000
protocol: TCP
volumes:
- name: sonar-data
persistentVolumeClaim:
claimName: sonar-data
- name: sonar-extensions
persistentVolumeClaim:
claimName: sonar-extensions

Sadly sonarqube is not yet ready to be easily deployed to k8s :confused:

You could create a init container to download the plugins you need into the pvc that you use for sonarqube or if you don’t need any other plugins apart from the bundled once, you could remove the sonar-extensions pvc and mount point completely as we have our bundled plugins in there anyway.
Please note that in case of upgrade all plugins that you would install via the marketplace will be gone as well, but i am sure you already figured this out

viel erfolg bei deinem projekt :+1:

2 Likes

Thanks a lot. Now its working like a charm. :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.