AnsweredAssumed Answered

Getting sugar_file_put_contents_atomic() : fatal rename failure under Windows & IIS.

Question asked by Wipster on Sep 13, 2017
Latest reply on Sep 14, 2017 by Jeff Bickart

Hi, I have a problem setting up SugarCRM on Windows Server 2012 R2  running IIS 8.5 and PHP 5.6.31 nts


Navigating to an arbitrary module and opening a record mostly leads to an error with status code 500. The sugarcrm.log stays empty and the php log gives the following error:

[13-Sep-2017 09:34:43 Europe/Berlin] PHP Fatal error: sugar_file_put_contents_atomic() : fatal rename failure 'C:\path\to\sugar\cache\modules\EmailAddresses\temED44.tmp' -> 'cache/modules/EmailAddresses/EmailAddressvardefs.php' in C:\path\to\sugar\include\utils\sugar_file_utils.php on line 174

The error occurs with different modules sometimes, but mostly with EmailAddresses. Also the session dies on a regular basis and the current user gets logged out. When commenting out line 173 (trigger_error) in sugar_file_utils.php everything works as expected which I don't want to do for obvious reasons.


I restarted IIS and Windows several times, emptied the cache folder by hand, deleted custom/application and executed all sorts of repairs. I don't know a lot about windows file permissions but sugars own system check runs without any errors.


In the issue tracker you can find this older entry which doesn't seem to help as it suggests a fix by customizing the code