no write access to source file

56 views
Skip to first unread message

Simon Goldschmidt

unread,
Dec 8, 2015, 7:06:46 PM12/8/15
to Lucee
We have recently been getting the occasional "no write access to source file" error when writing to a file. Our setup is Lucee 4.5.2.018 with Tomcat 7.0.59 and Java 1.8.0_60 on Windows 2012R2. The error may have coincided with the update to 4.5.2 but I can't be sure. I have noticed the error on different servers hosted with different providers, so it isn't isolated to a particular server.

The line that creates the error is:
  <cffile action="append" file="C:\Logs\score.log" output="#myoutput#">
Record in the exception log is attached.

We write very little to files, so I was surprised to see this type of error. Any suggestions what might cause the error and if there might be a workaround?

Thanks,
Simon
trace.txt

Nando Breiter

unread,
Dec 9, 2015, 10:01:15 AM12/9/15
to lu...@googlegroups.com
Simon,

You might try using <cflog> as a workaround. Shot in the dark, no idea if it would help, but it came to mind. Note you could also try with the attribute async="true" so the file is written to in a separate thread.



Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/494fe24e-e6ca-45e9-9a27-58b4067842cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Denard Springle

unread,
Dec 10, 2015, 3:33:21 PM12/10/15
to Lucee
Hey Simon,

It sounds a bit like you have more than one process attempting to write to the same file at the same time, thus locking the file in one process and preventing the subsequent process from gaining write access. You may wish to lock file access here (and anywhere else that is writing to the same file) using cflock. Something along the lines of:

<cflock name="#hash('score.log')#" timeout=30 type="Exclusive"> 
    <cffile action="Append" file="C:\Logs\score.log" output="#myoutput#"> 
</cflock>

Hope that helps :)

-- Denny
Reply all
Reply to author
Forward
0 new messages