Skip to content

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.

Reproduce Steps

  1. Set

    gitlab_rails['usage_ping_enabled'] = false

    in gitlab.rb

  2. Go to Admin Panel to Usage Statistics

  3. 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.

  1. If this is the case
    1. If yes: Why this happens
    2. If no: Why it is happening for the customer

Explanation

  • In SubmitUsagePingService we check if Gitlab::CurrentSettings.usage_ping_enabled?
  • Gitlab::CurrentSettings.usage_ping_enabled? goes to Gitlab::CurrentSettings and forwards the usage_ping_enabled? method to ApplicationSettings. ApplicationSettings is including ApplicationSettingImplementation which makes sure that we can override configs from config files or the database.
    • In ApplicationSettingImplementation we have a method where we override usage_ping_enabled to account for the logic to first check if the config file has changed to false and 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 overridden usage_ping_enabled method and therefore we ignore the config settings.

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