In Matomo 4.6.2 the option PrivacyManager.ipAnonymizerEnabled is overwritten when the pod is restarted.
The value of ipAnonymizerEnabled stays the same in the database
After a restart, the value is changed to 0
I'm trying to get this working on a OpenShift platform. I'm not allowed to use a PVC
@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?
@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
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?
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
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:
And the default value should actually be
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
@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.
@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.
@qiuminwei If your pod is also running the installation on restart as the config file is not persistent, this might be the reason.
@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.
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.