Global Administration Notifications are not triggering

Must-share information (formatted with Markdown):

  • SonarQube EE version 8.xx
  • Receive Email notification for License Expiring and LOC threshold reached
  • Configure SMTP relay server and able to fire test email from it

Hi @gdeep,

The instructions for configuring SMTP for SonarQube are not unique so you can find many articles on internet to find one. Here’s one that helped me: Configure SMTP for outbound emails

Here’s a gmail example I used:

  • Secure connection: starttls
  • SMTP host: smtp.gmail.com
  • SMTP password: the password
    • See Settings Encryption if you want to obfuscate the password in the database.
    • To get a password, go to myaccount.google.com > Security > “Signing in to Google” > App passwords >select “Other (Custom name)” app and “Other (Custom name)” device, then type your own app name (like the name of your SQ server) > click “Generate” to get app password and record the password
  • SMTP port: 587
  • SMTP username: your-email-you-want@gmail.com

Joe

I am able to setup smtp relay server but the global notifications (License Expiry and LOC threshold notifications )are not getting triggered although I am able to fire test notification from SQ as well.

Hi @gdeep:
As shown in the License Administration | SonarQube Docs documentation:

Global Administrator notifications

The License Manager has two built-in notification mechanisms (notifications are sent to Global Administrators). Global administrators will get notifications when:

  • the license is about to expire – a reminder is sent two months and again one month before your license expires.
  • the configurable LOC threshold is exceeded – you can change this threshold using the indicator on the LOC gauge.
    • A background job runs at server startup and then every 24 hours to check the LOC threshold and decide if a notification should be sent.
    • The background job does not check the validity of SMTP server settings and whether the global administrator email addresses are set up. For global administrators to receive notifications, these >settings need to be correctly configured before the LOC threshold is reached or exceeded.

Try following my instructions to test the LOC threshold email notification:

  1. Verify test email sending works via test configuration/email from SonarQube
  2. Ensure email is added to an admin account and this same admin account is part of sonar-administrators group
  3. Set threshold notification to high enough value for the next analysis to cross the threshold
  4. Analyze a project
  5. Delete “license.notif.loc” row in internal_properties table:
delete from internal_properties where kee = 'license.notif.loc';

Then verify it’s missing:

select * from internal_properties order by kee asc;
  1. Stop SQ server
  2. Restart SQ server
  3. Check for email
  4. Verify “license.notif.loc” row exists in internal_properties table. Timestamp will not necessarily match your local computer time.
  5. Utilize sonar.notifications.delay by reducing it from 60s to smaller value to ensure trigger works. Please review documentation about the sonar.notification.delay parameter in SonarQube to make the delay shorter: Notifications | SonarQube Docs.
1 Like

Somehow it worked after restarting thanks for the help

1 Like

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