@mattab opened this Issue on April 28th 2014 Owner

Bug reported in the forum:

 Warning:</strong> <em>rename(C:\Webservices\htdocs\piwik/misc/GeoIPCity.dat.new,C:\Webservices\htdocs\piwik/misc/GeoIPCity.dat): The process cannot access the file because it is being used by another process. (code: 32)</em> in <strong>C:\Webservices\htdocs\piwik\plugins\UserCountry\GeoIPAutoUpdater.php</strong> on line <strong>268</strong>

This is triggered in the cron, Scheduled tasks.

I'm not sure what should be done with this issue?

@grzchr15 commented on February 22nd 2016

This does still not work with Piwik 2.16.0 . So the autodownloader of GeoIP DBs is still senseless
Only manual updating works
Renaming cannot work, but 2 files which are used alternative may work

@sanso2010 commented on October 9th 2016

Hi all, so I've encountered this error as well. For now I've changed the GeoIPAutoUpdater.php, line 271 to copy instead of rename - ofc this will leave the .new file in the folder. It will be overwritten in the next scheduled update though. It's still better than not being able to autodownload those files. Unfortunately there seems to be no way to "close" the GeoIP Database before deleting/renaming. I have no idea what's keeping that file open reading the code.

@Globulopolis commented on October 9th 2016 Contributor

Yes, this is a bug on Windows platform. In some situations rename function cannot work. In my other project i do copy instead of rename.

@huan086 commented on April 7th 2017

Still broken in Piwik 3.0.3. @sanso2010's workaround https://github.com/piwik/piwik/issues/5050#issuecomment-252486101 still works.

@mattab commented on June 21st 2017 Owner

Thanks for letting us know, we'll take a look at this

@mstenz commented on August 1st 2017

I am wondering why this easy change is not yet done as a fix is already provided
I cant do it because i am not used to git so much, but for someone dealing anyhow with the piwik code it took 5 seconds to fix this.

@mattab commented on August 1st 2017 Owner

@mstenz Would you please share a patch (even if not a pull request) that you have tested and fixes the issue for sure?

@mstenz commented on August 1st 2017

I don't know how to do this, but you just need to replace one word on line 271 in plugins\UserCountry\Ge
rename($tempFile, $oldDbFile);
copy($tempFile, $oldDbFile);
Solution was provided already by other users in this thread.

This Issue was closed on September 18th 2017
Powered by GitHub Issue Mirror