Deployed on a Windows server and running as a service
PostgreSQL 15 being used
We are trying to set up email notifications for getting notified when the LOC threshold limit is reached or when we are nearing license expiry.
The SMTP configuration is accurate and we have tested it by sending the test email.
However, we are not receiving the LOC threshold limit notification.
The only thing that has worked is the steps mentioned in this post - Global Administration Notifications are not triggering - #4 by Joe
So, have a few questions:
If there is a threshold change or smtp configuration change, does it always require updating the internal_properties table and SonarQube server restart?
For the LOC threshold limit email, doesn’t it get triggered daily until the LOC goes below the threshold limit?
Is there a way to check in the logs if the email was triggered?
As per the above post, it says there is a background job which runs every 24 hours. Is there a way to check if that job is working and also can the background job run time be changed e.g. configure it to run every 1 hour while testing?
We (finally) uncovered the (private) source code that handles this notification. A few things to keep in mind:
The e-mail gets set to users with the global Administer System permission. Those users must have an e-mail address associated with their account.
SonarQube checks every 24 hours to see if the threshold has been exceeded, and stores the last time the notification was sent in the internal_properties table with the key license.notif.loc
SonarQube will only send the notification if the current date is a month past the date stored as license.notif.loc
So to answer your questions:
No, you shouldn’t need to update or restart anything.
As mentioned above, the notification gets sent and then won’t be sent for another month.
Unfortunately, the visibility into whether or not it got sent is limited to the value for license.notif.loc in the internal_properties table got updated.
So probably a good first debugging step for you would be – is there a value for license.notif.loc in the internal_properties table? if so, what is it?
A simple SELECT should do the trick
SELECT * FROM internal_properties WHERE kee='license.notif.loc'
Mostly, would have set it to notify weekly.
With a monthly frequency, in case you miss that email, you might have already consumed a lot more lines of code by the time you are notified again.