Investigate: Usage Ping gets sent even with disabled configuration on self managed
What happened
RCA: https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/401
We detected an issue with disabling usage ping from config file does not get picked up and we're still sending usage ping data.
- Slack Message from customer response: https://gitlab.slack.com/archives/CMJ8JR0RH/p1623320111453100
- Slack Message for potential issue: https://gitlab.slack.com/archives/CETG54GQ0/p1623269807224600
Reproduce Steps
-
Set
gitlab_rails['usage_ping_enabled'] = falsein gitlab.rb
-
Go to Admin Panel to Usage Statistics
-
Usage Ping should have a disabled checkbox
✅ To confirm
Even though usage ping got disabled with gitlab.rb, it still gets send. We need to validate if Usage Ping still gets send.
- If this is the case
- If yes: Why this happens
- If no: Why it is happening for the customer
Explanation
- In
SubmitUsagePingServicewe check ifGitlab::CurrentSettings.usage_ping_enabled? -
Gitlab::CurrentSettings.usage_ping_enabled?goes toGitlab::CurrentSettingsand forwards theusage_ping_enabled?method toApplicationSettings.ApplicationSettingsis includingApplicationSettingImplementationwhich makes sure that we can override configs from config files or the database.- In
ApplicationSettingImplementationwe have a method where we overrideusage_ping_enabledto account for the logic to first check if the config file has changed tofalseand then later check the database
- However, when calling
CurrentSettings.usage_ping_enabled?we do this with the?version (which comes from ActiveRecord) so we don't go to the overriddenusage_ping_enabledmethod and therefore we ignore the config settings.
- In
Next steps
Figure out how long this issue persists
Since version 9.3 and introduced with 26dde5f5
Figure out which customers are affected
We need to delete data from customers we have submitted usage ping data although they though it's disabled.
- We likely can't find out automatically which customers is affected
- Customers could check on their own instance if they are affected and report us & we delete the data
Edited by Justin Farris