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
Starting with php 7.3 on windows OS the geoip2php Update procedure is not working anymore. #17023
Comments
Hi @mstenz when you go to Matomo => Admin => Plugins, can you check if the GeoIP2 plugin is enabled? If not, can you try to enable it and see if works now? |
Hi @tsteur |
@mstenz just to correctly understand. You basically need to configure Geolocation every time from scratch and need to configure things like the URL from where to download the file and get Matomo to download it etc? Any chance you can send us the output of your Matomo system report? You find it in "Matomo => Admin => System check" and the output should be anonymised. |
Just enabled debugging and found out that:
|
@sgiehl any idea how this might happen? |
@mstenz is maybe the geoip2 database removed somehow? Can't think of another reason why it should automatically disable the provider 🤔 |
i have just downloaded the file again. it is stored in misc folder and there is no antivirus (except from Windows Defender) installed on the system that is able to delete the file. i don't think there is any other processes on the system that would potentially delete any file. Let me watch the file and i will give you an update on this. |
ok. I found out that the
in GeoIP2AutoUpdater.php arround line 320 is the problem. When i uncomment this line everything works as expected and the file get replaced.
I think the update process for Windows machines need to be re-thought completely to make it more stable and really working. |
Interesting @mstenz thanks for finding this. @sgiehl do you have a windows with a running Matomo installation maybe? Any chance you could reproduce this? I wonder if eg https://github.com/matomo-org/matomo/blob/4.1.1-b2/core/Http.php#L108 is a problem and keeps the file handle open. But doubt it would be the specific issue cause it should be first downloaded through HTTP into a tmp dir. |
But you are right. The http function in core is also faulty as it doesnt close it, its just no problem because the file is not needed after php.exe is finished. |
@tsteur No, don't have set up PHP on windows atm. But could try doing that in a VM |
Sounds good to like time restrict maybe max 2 hours or so in order to see if we can reproduce it. |
Just set up a WAMP environment. Running the geoip update with an existing file always results in a deleted file. There are no other processes accessing the file. So it seems not possible to remove the file within the process. Need to check if there is a simple possibility to circumvent this |
The ideas i have for preventing this and make it working both with Linux and windows:
|
👍 adding it into the milestone If I understand things correctly it should be maybe fixable that all file handles to it are closed? But not sure where it's left open (maybe the Geo IP lib or so) |
as the move fails. i assume there is a bug in php and php itself does not close the handle. with would be possible with fopen and so on to rebuild the move command but I do not think thats worth the effort. in my comment before with the screenshot you see that the file is opened 7 times but only closed 3 times. so there are 4 handles that are not closed. |
I think you can do a "Fast workarround" as i have did and just coment out the unlink line as this fixes the problem for both windows and linux. |
@sgiehl it works for me |
I enable geoip2php, download the file and save the settings,
then after at least one week it disables automatically and when navigating to the geo configuration page it shows this error message in red:
The configured geolocation provider geoip2php is not available anymore, please configure another one.
I need then to download the file again and start from beginning.
The text was updated successfully, but these errors were encountered: