Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrivacyManager.ipAnonymizerEnabled overwritten on restart #18735

Open
darkSideOfPink opened this issue Feb 3, 2022 · 11 comments
Open

PrivacyManager.ipAnonymizerEnabled overwritten on restart #18735

darkSideOfPink opened this issue Feb 3, 2022 · 11 comments
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.

Comments

@darkSideOfPink
Copy link

In Matomo 4.6.2 the option PrivacyManager.ipAnonymizerEnabled is overwritten when the pod is restarted.

Expected Behavior

The value of ipAnonymizerEnabled stays the same in the database

Current Behavior

After a restart, the value is changed to 0

Steps to Reproduce (for Bugs)

  1. Start Matomo, go to Administration -> Privacy -> Anonymize data
  2. Check the Anonymize Visitors' IP addresses
  3. Restart Pod
  4. Start Matomo, go to Administration -> Privacy -> Anonymize data

Context

I'm trying to get this working on a OpenShift platform. I'm not allowed to use a PVC

Your Environment

  • Matomo Version: 4.6.2
@darkSideOfPink darkSideOfPink added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Feb 3, 2022
@sgiehl
Copy link
Member

sgiehl commented Feb 4, 2022

@darkSideOfPink Thanks for the report. So is this more likely a display issue? The values is stored correctly in the database, but the UI doesn't reflect it. Or is the UI value only changing after restart?

@darkSideOfPink
Copy link
Author

@sgiehl No, it's more then a display issue, it doesn't hide the IP addresses anymore either, the value in de database is changed after restart, so the option is actually altered

@sgiehl
Copy link
Member

sgiehl commented Feb 4, 2022

That sound weird.
So the value is changed in the database when you change it in the UI, but is reset when restarting pod?
Is there anything done with Matomo or the database upon restart?

@darkSideOfPink
Copy link
Author

Yes, I find it weird too. Especially since other values aren't changed. There is nothing done with Matomo or the database upon restart as far as I could track down. Like I said, on my local computer with persistent volume it does work, so it feels like it gets the value from there somewhere and since there isn't a persistent volume, it uses the default? I'm not sure, but like I said, other values (like the amount of bytes obscured) aren't changed

@sgiehl
Copy link
Member

sgiehl commented Feb 4, 2022

Those settings are both stored the same way. So if one gets lost, actually the other one should reset too.

For what exactly are you using a non persistent volume? Matomo requires at least the config to be persistent

Note: There are only two places where the ipAnonymizer is disabled:

  • When calling the API method PrivacyManager.setAnonymizeIpSettings with anonymizeIPEnable=0
  • Within the installation process.

And the default value should actually be true...

@darkSideOfPink
Copy link
Author

Thank you for your reply. I looked into it. The installation does get called when the pod is restarted because it doesn't have persistant storage (so no config file). I will try to convince the company to use persistant storage. Still find it odd only this value is changed

@sgiehl
Copy link
Member

sgiehl commented Feb 7, 2022

@darkSideOfPink maybe copying in the config file from an external static source might be another option.
But not having the config.ini.php persistent is not recommended. As changing some settings in the UI or even when updating Matomo might add/change the config file. And that might get lost on restart in your case and could in some cases even cause other trouble.

@qiuminwei
Copy link

@sgiehl I also had this problem: PrivacyManager.ipAnonymizerEnabled is changed in the database when I change it in the UI, but is reset to 0 when restarting the pod.

I don't think it has anything to do with config, because after I changed it in the UI, the config file doesn't change anything.

@sgiehl
Copy link
Member

sgiehl commented Aug 10, 2022

@qiuminwei If your pod is also running the installation on restart as the config file is not persistent, this might be the reason.

@qiuminwei
Copy link

@sgiehl thanks for the quick replying, we do not use persistent volume but will copy the preset config.ini.php every time Matomo starts, and I have seen the installation script, it will first check the ipAnonymizerEnabled value in the database, if it is true, it will skip the reset, so I'm confused where exactly this value is reset.

@sgiehl
Copy link
Member

sgiehl commented Aug 11, 2022

That's not the part of the installation I was referring to. The update script should only be executed when Matomo is updated. That shouldn't be the case here. I was referring to this part: https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/PrivacyManager/PrivacyManager.php#L434

But actually we don't have enough time to help narrow down issues for such specific use cases. Feel free to investigate the issue on your own. Maybe by commenting out some lines, that might deactivate it and check where it comes from. If you are able to provide enough details we are happy to fix it. You can also try to find some help on our forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants