Highlighted

ColdFusion.exe locking files

Explorer ,
Oct 11, 2018

Copy link to clipboard

Copied

Hi,

I have a current development environment where we use a program called GoodSync to copy files from our local computer to a development server where we can then test our code.  We don't run CF locally on our own desktop/laptops.  Usually this works just fine but occasionally we have an issue where we can't copy our files to the server because the file gets locked by ColdFusion.exe.

Any ideas why ColdFusion is locking files and not releasing them?  We have to restart the CF service in order to clear the locks.  It seems like this is happening by mistake for some reason.  I've never encountered it in any other environment.

-Steve

Views

852

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

ColdFusion.exe locking files

Explorer ,
Oct 11, 2018

Copy link to clipboard

Copied

Hi,

I have a current development environment where we use a program called GoodSync to copy files from our local computer to a development server where we can then test our code.  We don't run CF locally on our own desktop/laptops.  Usually this works just fine but occasionally we have an issue where we can't copy our files to the server because the file gets locked by ColdFusion.exe.

Any ideas why ColdFusion is locking files and not releasing them?  We have to restart the CF service in order to clear the locks.  It seems like this is happening by mistake for some reason.  I've never encountered it in any other environment.

-Steve

Views

853

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 11, 2018 0
LEGEND ,
Oct 11, 2018

Copy link to clipboard

Copied

Are there log entries (either the physical server or webserver or CFAdmin) indicating that ColdFusion.exe is locking the files?

I'm just curious as to how you came to the conclusion that CF.exe is the culprit.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 11, 2018 0
Explorer ,
Oct 11, 2018

Copy link to clipboard

Copied

No and ColdFusion runs the files properly if I run it in a web browser.

I determined it was ColdFusion.exe using Process Explorer.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 11, 2018 2
Adobe Community Professional ,
Oct 13, 2018

Copy link to clipboard

Copied

This is perhaps a GoodSync problem. Goodsync might be unable to copy to a file location if the file is currently being processed by ColdFusion.

In any case, GoodSync should be able to copy a locked file. Check out the GoodSync documentation.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 13, 2018 0
Explorer ,
Oct 25, 2018

Copy link to clipboard

Copied

I don't think so because the docs say that it can't copy TO (or over) a locked file.  And if I go into Process Explorer and investigate what locks are on that file, it's coldfusion.exe.  I can't delete the file from the server through Windows Explorer either.  Or overwrite it via FTP.  I have to bounce the CF Service in order to free the file up again.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 25, 2018 1
Participant ,
Oct 26, 2018

Copy link to clipboard

Copied

What files are you talking about? Source files like .cfm or .cfc?

When you use ColdFusion to read data from .xlsx files using POI a lock is maintained because some JAVA object was not closed correctly. ColdFusion also maintains a lock on .jar file imported using this.javaSettings in Application.cfc

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 26, 2018 0
Explorer ,
Oct 26, 2018

Copy link to clipboard

Copied

Yea, usually it's the temporary files that goodsync creates, but it creates them in the sandbox webroot in a folder called _gsdata_ so CF still sees them.  There is no denying that coldfusion.exe opens them for some reason because I can clearly see that in Windows and Process Explorer.  I can kill the locks labeled coldfusion.exe or bounce the service and it's instantly fixed.  But to do this everytime I change a file during development is not productive.  Most days it works perfectly fine, but then we'll get a day where for several hours in a row there is nothing you can do but kill processes on every file change.  Maybe Goodsync can store that _gsdata_ folder outside the webroot.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 26, 2018 1
Adobe Community Professional ,
Oct 27, 2018

Copy link to clipboard

Copied

AdeptDeveloper​, thanks for your explanation. You've made it clear what the problem is. ColdFusion is apparently sticking its nose where it don't belong.

I can think of two possible solutions:

1) moving the folder _gsdata_ to a location outside the webroot, and changing GoodSync's settings accordingly;

2) leaving _gsdata_ in the webroot, but denying ColdFusion access to the directory. You could do this as follows:

    a) right-cick on the folder _gsdata_ and select Properties;

    b) click on the tab Security, then on the button Edit;

    c) click on Add, and add the user, Local Service (that is the user ColdFusion runs as by default);

    d) in the resulting user-interface, click in the checkboxes to deny Local Service all permissions;

    e) click on the Apply button.

N.B: The second solution will only work if GoodSync isn't running as Local Service. If it is, then a variation of this solution is to change the account under which ColdFusion is running. For information on this, Google, for example "running coldfusion as a user" or "running coldfusion under a domain account". After you create the new account, follow the steps in 2), and deny access to the new account.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2018 0
Adobe Community Professional ,
Oct 27, 2018

Copy link to clipboard

Copied

I'll add that while you both seem to be presuming that is doing this lock "for no good reason", I would say I'm not aware of any reason that cf would lock random files or folders, even if they are simply in the web root, by default.

I would wonder if some user-selected feature or process running in cf is behind this. Steve, would you contend that this is a stock cf (so no changed admin features that might be related to this)   and would you feel it's "doing nothing" to or with the files?

If so, have you found any pattern to when the files become locked after the cf restart? Mins? Hours? Any action preceding that?

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2018 0
Explorer ,
Oct 27, 2018

Copy link to clipboard

Copied

Yes, I would consider this a stock CF install.  Since these files are in the _gsdata_ folder, even though its under the webroot, I would think that CF would only need to lock these files if it was requested like you said by a user action or script of some sort, which I'm sure wouldn't be happening.

I haven't noticed a pattern yet.  Sometimes it will go days working just fine and then once you get the locked file problem once, your likely going to get it over and over again.  When that happens I point my IDE at a mapped drive to that folder and work on them that way so that Goodsync doesn't have to do anything, but file access is slower since the server is in Azure.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2018 1
Adobe Community Professional ,
Oct 27, 2018

Copy link to clipboard

Copied

Please give us examples of the files that are locked, including their full path.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 27, 2018 0
Explorer ,
Oct 30, 2018

Copy link to clipboard

Copied

2018-10-30_0945.png

So I changed my GoodSync settings on the Options -> Right tab to check "No _gsdata_ folder here" and things were going smoothly, but now I'm getting the error with the actual CFM file that I'm syncing.  That file definitely would be looked at by CF because when I sync it, I want to test my changes, so I would open the code in the browser.  But it's been working fine for 4 hours and then finally started locking and throwing this error.

At this stage, I'm stuck unless I bounce the CF service or wait an hour or so.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 30, 2018 1
Adobe Community Professional ,
Oct 30, 2018

Copy link to clipboard

Copied

AdeptDeveloper  wrote

2018-10-30_0945.png

... now I'm getting the error with the actual CFM file that I'm syncing.  That file definitely would be looked at by CF because when I sync it, I want to test my changes, so I would open the code in the browser.

I guessed as much, hence my initial post:

BKBK:

Goodsync might be unable to copy to a file location if the file is currently being processed by ColdFusion.

In any case, GoodSync should be able to copy a locked file. Check out the GoodSync documentation.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 30, 2018 0
Explorer ,
Nov 27, 2018

Copy link to clipboard

Copied

It's definitely ColdFusion doing this.  It's a constant problem.  Basically causes development time to triple or quadrupal.  Each time Goodsync copies the file (or manually via ftp through FileZilla) CF locks the file, I can test it, but then to change my file again, I have to RDP to the server, run procexplorer, find the process, kill it and test again.  But of course, killing CF, means after I copy my file successfully, I now have to log in to my app again because my session is dead, find the screen I was on, which sometimes can be several clicks or setup to get my test back to the right spot and try again.  And repeat and repeat all day long.  Really frustrating.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 27, 2018 1
Adobe Community Professional ,
Nov 28, 2018

Copy link to clipboard

Copied

ColdFusion is not to blame. It is apparently using the file as intended. The component, IConXService.cfc, is locked because ColdFusion is running it.

In any case, as I said earlier, it might still be possible to copy the locked files. Have you applied the GoodSync setting​, 'Shadow Copy'?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Explorer ,
Nov 28, 2018

Copy link to clipboard

Copied

There isn't a Shadow Copy option for the version I'm using.  I'm guessing that is only for their server product.  Also the docs regarding this shadow copy feature say the file can't be a network file which it would be, because GoodSync is running on my laptop and the locked file is on the server.

I'm unclear though why you don't think it's ColdFusion?  Process Explorer clearly shows that it's ColdFusion.  Windows Explorer says it's ColdFusion.  I can't do anything with the file unless I kill the process with procexplorer.  I can't edit it with Notepad++, I can't delete it as Administrator through Windows Explorer, etc.  And why is ColdFusion locking only the file I'm working on?  All other files in the app are perfectly fine.  I can literally delete every file in the webroot and subfolders other than the 1 file that I modified.

ColdFusion shouldn't need to lock the cfm or cfc file for minutes or hours.  Shouldn't it just need to the first time it runs the file?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 1
Adobe Community Professional ,
Nov 28, 2018

Copy link to clipboard

Copied

Are you using any of the ColdFusion RDS features to work on the file? That would explain why it's locked while you're working on it.

In general, it's usually not the process in question, in this case ColdFusion, that's causing the underlying problem. The process tells the OS when it needs a file lock and when it no longer needs a file lock, and that by itself is a pretty simple thing.

Dave Watts, Fig Leaf Software

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 0
Explorer ,
Nov 28, 2018

Copy link to clipboard

Copied

I guess I'm just confused why it would be GoodSync's fault/problem.  All it's doing is FTPing or copying over a network share.  There is no GoodSync software on the server.  It's the same as using FileZilla and uploading a file.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 28, 2018 1
New Here ,
Dec 04, 2018

Copy link to clipboard

Copied

I am certainly not trying to hijack this thread, but a client of mine is seeing the same root issue.  We are not using GoodSync, but the .cfm files are getting locked after being moved to the webroot by the developer.  This client uses an IIS FTP site to move files to and from the webroot. As soon as he copies a new .cfm file to the root, the file gets locked by ColdFusion and the process has to be restarted to free up the lock.

I just wanted to mention this, as it seems like GoodSync is most likely not the issue.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2018 1
LEGEND ,
Dec 04, 2018

Copy link to clipboard

Copied

Just out of curiosity.. are the files being FTPd directly from the development system?  Or are the files being burned to CD/DVD, moved to another system, and then FTPd?

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2018 0
New Here ,
Dec 04, 2018

Copy link to clipboard

Copied

The files are FTPd from the developers machine to the webroot.

We are going to test another FTP server solution (Filezilla).  If that doesn't work we are going to point the FTP root to a temp directory and move the files from there to the webroot. I can report back when we have done more troubleshooting.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2018 1
Adobe Community Professional ,
Dec 04, 2018

Copy link to clipboard

Copied

AdeptDeveloper​ and ServerAdminConsultant​, ColdFusion may lock the files it is using. But if, in your experience, it is locking files that it is not using, then that will be a bug. Report it, including a link to this thread.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2018 0
Explorer ,
Feb 07, 2019

Copy link to clipboard

Copied

New information on this issue... it seems like coldfusion only locks the file after you've uploaded code to the server and it encounters an error processing the cfm file.

For instance, I've been working on all day while GoodSync copies files to the server via an FTP account and everything has worked fine.  Then a minute ago, I forgot the closing parenthesis on a function call such as "myfunction(param1, param2" no closing parenthesis after param2.  Navigated to my file through a web browser, saw the detailed CF error message.  Went back and corrected my error and upon uploading to the server was told the destination file is locked by coldfusion.exe and can't be overwritten.

-Steve

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 07, 2019 1
LEGEND ,
Feb 07, 2019

Copy link to clipboard

Copied

Y'know, I wonder.  The other day I had an external USB drive plugged in, copying files.  When I tried to use the "Safely remove hardware and reject media" option before unplugging the drive, I get a message that Windows can't disconnect the drive because a program is still using it.  Which was odd because the files had finished being copied.  But when I closed Windows Explorer and tried again, it worked.

So, I wonder if ColdFusion is throwing the error and not letting go of the file.  As opposed to actually locking the file.  Maybe, just maybe, and I know I'm clutching at straws, here.. maybe CF is still "using" the .cfm file and Windows won't let anything over-write a file that is being used.

Just my two cents.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 07, 2019 0
Community Beginner ,
Feb 07, 2019

Copy link to clipboard

Copied

I've been dealing with this issue as well and I also noticed a pattern of CF 2016 locking cfc/cfm files after an error is thrown. This has happened both locally (CF 2016 installed on the machine I develop with) and when deploying to remote servers (I use rsync to deploy).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 07, 2019 0